mosra / m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites
https://mcss.mosra.cz
Other
406 stars 92 forks source link

wrap page/article content in blocks for easier extension of templates (v2) #142

Closed lpirl closed 4 years ago

lpirl commented 4 years ago

This PR wraps, where useful, all [page|article].contents in Jinja blocks for easier (as in "less verbose") extension/customization/overriding of templates.

An example use case is to build a custom index page using the page.html template. Say we want to add some Jinja-powered content before the rendered page.content itself. In the current revision, we'd have to copy the whole main block. Over time, we'd have to maintain this copy in order to stay in sync with the theme's development. This use case could be achieved way less verbose if we could extend page.html and only override the part where the rendered content is inserted.

(This PR is an updated version of #141)

codecov[bot] commented 4 years ago

Codecov Report

Merging #142 into master will increase coverage by 0.00%. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #142   +/-   ##
=======================================
  Coverage   98.01%   98.01%           
=======================================
  Files          27       27           
  Lines        6459     6460    +1     
  Branches       44       44           
=======================================
+ Hits         6331     6332    +1     
  Misses        128      128           
Impacted Files Coverage Δ
documentation/doxygen.py 99.19% <0.00%> (+<0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 830352f...5987d48. Read the comment docs.

mosra commented 4 years ago

Now it works, thanks. Merged as a9853bfde89826a7ff9e1bb21401862bb5613532.