Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
74 stars 32 forks source link

Stop rendering the sidebar three times per page render #395

Closed happy-river closed 3 years ago

happy-river commented 3 years ago

app/html/shared/layout.html was rendering the sidebar once to determine which class to use on the main div, once to determine whether to create the sidebar div, and a third time to fill the sidebar div. This is a lot of extra work, especially for the pages which have top posts and recent activity on the sidebar.

Add wheezy's CodeExtension to allow arbitrary Python code in the templates, and use that to store the rendered sidebar in a variable.