-
Notifications
You must be signed in to change notification settings - Fork 459
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
Add comments on templates to show where the HTML is coming from #2985
Comments
Mako and Jinja have a comment feature. Those do not end up in the source output. We already use them in some places (in particular to specify the file encoding for Mako) |
Yeah, but I do want them in the output so people trying to make a theme know what template to tweak |
Then it gets a huge 👎 from me. This is completely irrelevant to most people and will look strange to people reading the source, unaware of what it means. |
In combination with a "draft" and "release" switch this would become really useful while editing themes, templates and changing styles. Applying some kind of "build configuration" to the filters, etc. one could easily choose between different tidy profiles and remove those comments in production builds, generate non-minified or minified css, etc. 👍 |
Hm, just recognized that nikola supports a --conf= option (is it documented somewhere?) that could be used to differentiate between a "draft" and a "release". |
Could be done as an option enabled/disabled by a switch. Honestly, trying to do a theme without this is complicated. And I wrote the damned theme engine. |
#3760 will at least offer logging which templates went into which output file (when that has been merged finally, might happen any month now). This is not exactly what was wanted here, but a different approach to roughly the same problem field. |
For example, it happens that you are trying to edit a theme's index page.
You look at it and ... which template is generating that?
We could add comments in all templates and in blocks so that is explicit.
Sure, it makes the output larger, but if you are minifying html, the comments go away.
The text was updated successfully, but these errors were encountered: