Rewrite and simplify stylesheet handling

Thanks to tk0miya's comment, I learnt one can add stuff to template
blocks, that allows a much simpler stylesheet configuration, considering
that changes at the template level will be more... well, low-level.
Hopefully this is now acceptable.
This commit is contained in:
Jellby
2017-04-15 17:07:33 +02:00
parent 1cfed262d2
commit e59a8028d7
9 changed files with 38 additions and 70 deletions

View File

@@ -1,7 +1,8 @@
{% extends "!layout.html" %}
{% set css_files = css_files + ["_static/more_persistent.css", "_static/more_persistent2.css", "_static/more_default.css", "_static/more_alternate1.css", "_static/more_alternate2.css"] %}
{% set _dummy = css_props.update(
{"_static/more_default.css": {"title": "Default", "alternate": False},
"_static/more_alternate1.css": {"title": "Alternate"},
"_static/more_alternate2.css": {"alternate": True} }
) %}
{%- block csss %}
{{ super() }}
<link rel="stylesheet" href="_static/more_persistent.css" type="text/css" />
<link rel="stylesheet" href="_static/more_default.css" type="text/css" title="Default" />
<link rel="alternate stylesheet" href="_static/more_alternate1.css" type="text/css" title="Alternate" />
<link rel="alternate stylesheet" href="_static/more_alternate2.css" type="text/css" />
{%- endblock %}