-
Notifications
You must be signed in to change notification settings - Fork 95
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
ENH: include the sidebar from the sidebar plugin when building the pages #375
Comments
It might be sufficient to add the 'public' path to the python code in
Then I can include the snippet in my templates
|
@mattip the problem with the sidebar is that its contents depend on essentially the whole site. So if the sidebar would already be included during the build in every page, every change to the site would require re-creating all pages. For small pages that's ok, for larger ones it's pretty excessive. That's why it generates a separate file that needs to be included in another step. I personally use a substitution script / two-phase deployment to create a final version of the site with the sidebar included, to avoid the use of JavaScript to include it. |
With sed via a marker in the post template? I guess that could work too. My site (www.pypy.org after importing blog posts + comments from https://morepypy.blogspot.com in this MR) has ~500 posts and the strategy I outlined above requires about 3 seconds to recreate the pages, so I am not to worried about rebuilding once a week or so when we have new blog posts. |
Note the sidebar needs to be "included", use sed instead of Jinja2 getnikola/plugins#375
Note the sidebar needs to be "included", use sed instead of Jinja2 getnikola/plugins#375
Rather than generate a sidebar-en.inc file as a task, perhaps the sidebar plugin could add a
set_site
method and add the sidebar as a blinker.signal callback, like static_comments does. This would make the snippet more useful since no server-side or javascript would be needed to include it. Did I understand correctly the sequence of processes?The text was updated successfully, but these errors were encountered: