diff options
author | Wolfgang Müller | 2021-06-16 13:58:12 +0200 |
---|---|---|
committer | Wolfgang Müller | 2021-06-16 13:58:12 +0200 |
commit | 00a186d12a2ad530a39fafe726150d67a212ecbf (patch) | |
tree | 402e6d6ebae9cdbf4d3b93506cc22d1b1e0126f2 /templates/base.html | |
parent | 3946c3bfbdabc24cf57bcb1c0fa5a066dc23087e (diff) | |
download | zunzuncito-00a186d12a2ad530a39fafe726150d67a212ecbf.tar.gz |
templates: Do not show slogan on all pages
Currently we show the slogan both on the index as well as all sub-pages.
This needs some special handling in the template, since the page
description for the index is empty (the slogan takes its place).
Simplify the template further by making sure description is always set,
and set it to the slogan only on the index page.
Diffstat (limited to 'templates/base.html')
-rw-r--r-- | templates/base.html | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/templates/base.html b/templates/base.html index 8c42d17..9190f0e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,17 +1,16 @@ {% import "macros.html" as macros -%} +{%- set description = config.description -%} + {%- if page -%} - {%- set description = "post № " ~ page.slug -%} - {%- set title = page.title | default(value=description) -%} + {%- set description = page.title | default(value="post № " ~ page.slug) -%} {%- elif term -%} {%- set description = "posts tagged with #" ~ term.name -%} - {%- set title = description -%} {%- elif terms -%} {%- set description = "all tags" -%} - {%- set title = description -%} {%- endif -%} -{%- set title = title | default(value=config.description) -%} +{%- set title = title | default(value=description) -%} <!DOCTYPE html> <html lang="en"> @@ -33,7 +32,7 @@ <header> <h1><a href="/">{{ config.title }}</a></h1> <div class="banner smaller"> - {{ config.description }}{% if description %} · {{ description }}{% endif %} + {{ description }} {% if section -%} · <a href="/atom.xml">feed</a> · <a href="/tags">tags</a> {% elif term -%} |