-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Access name of reader in template #1102
Comments
That seems a job for a plugin. Currently, I don't think we have a signal which does that, but it can Then, the plugin can add any meadata to the article which could be used |
I don't think templates should depend on certain plugins being installed. Especially for functionality that should be accessible for every template in the first place :) Pelican makes use of Docutils for it's RST reading/parsing. Docutils requires the inclusion of a certain stylesheet for proper rendering of the output HTML. Because Pelican supports multiple readers (Markdown for instance), the RST stylesheet should not be included in every page/article. It seems logical that if Pelican supports/uses Docutils and Docutils requires the stylesheet, Pelican should offer a way to include it conditionally! |
then we would need to add a metadata by the reader. |
That would be the right course of action I think :) I can try and whip something up, but I don't know when I'll have the time. Sometime next week at the earliest. |
Hello Daan. Just wanted to check in... Any update on your progress with this issue? |
Hey Daan. How is it going so far? Any updates? |
I must confess I totally forgot about that! Will try to put something together, hopefully this week. |
Hey @dandydev. Just following up regarding this issue. Any updates? |
Gosh, I really feel bad about this! I totally forgot to look into it. Anyways, I wipped something up here: #1323 Hope that's to your liking! |
This issue was fixed and merged in #1323, so I guess it can be closed now. |
Is there a way to know what reader is used in a template? I'd like to conditionally include a certain CSS file based on what reader is used. For instance: include the css file only if we're dealing with a Restructured text article, but not if the source is Markdown.
Is this in any way possible?
The text was updated successfully, but these errors were encountered: