Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid overwriting base.html when the site config changes #147

Closed
isaisabel opened this issue Apr 30, 2020 · 0 comments
Closed

Avoid overwriting base.html when the site config changes #147

isaisabel opened this issue Apr 30, 2020 · 0 comments
Assignees
Labels
timescale/short-term Becomes timescale/imminent in weeks or months

Comments

@isaisabel
Copy link
Contributor

isaisabel commented Apr 30, 2020

As a maintainer of the ATT&CK website, changes to the overall site configuration (e.g banner message) should not change the content of base.html. In other words, this stuff should not be written to base.html based on the config whenever the build script runs.

  • Templates should not be overwritten by python scripts in general, rather they should pull dynamic data from fields in their markdown
  • Having the data in both the config and html makes maintainanace confusing to new users, who may change the version in base, not realizing it's overwritten from the config on build.
  • Changes to site config end up showing up as changes to base.html in git, leading to more work reviewing changes and during merges.

Instead of encoding site-wide config as variables in base.html, the config could write them as a siteconfig dict in every generated markdown file. Then, just like {% set parsed = page.data | from_json %} we can import the siteconfig in the base as {% set siteconfig = page.siteconfig | from_json %}.

The complicating factor is that there are some static pages that don't have dynamically generated markdown. And not all of them can easily be converted to dynamic markdown, for example the update logs contain actual content and can't easily be generated by a python script.

@isaisabel isaisabel added enhancement New feature or request timescale/short-term Becomes timescale/imminent in weeks or months and removed enhancement New feature or request labels Apr 30, 2020
@isaisabel isaisabel added this to the Website Modularization milestone May 11, 2020
@IanDavila IanDavila self-assigned this May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
timescale/short-term Becomes timescale/imminent in weeks or months
Projects
None yet
Development

No branches or pull requests

2 participants