summaryrefslogtreecommitdiffstatshomepage
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/base.html32
-rw-r--r--templates/page.html12
-rw-r--r--templates/tags/list.html8
-rw-r--r--templates/tags/single.html12
4 files changed, 26 insertions, 38 deletions
diff --git a/templates/base.html b/templates/base.html
index edce080..8c42d17 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,12 +1,30 @@
{% import "macros.html" as macros -%}
+
+{%- if page -%}
+ {%- set description = "post № " ~ page.slug -%}
+ {%- set title = page.title | default(value=description) -%}
+{%- 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) -%}
+
<!DOCTYPE html>
<html lang="en">
<head>
- <title>{{ config.title ~ " · " }}{% block title %}{{ config.description }}{% endblock %}</title>
+ <title>
+ {{ config.title ~ " · " ~ title }}
+ </title>
<link rel="stylesheet" href="/style.css"/>
<link rel="icon" href="/icon.svg"/>
<link rel="alternate" type="application/atom+xml" title="zunzuncito" href="/atom.xml" />
- {%- block additional_feeds %}{% endblock %}
+ {% if term -%}
+ <link rel="alternate" type="application/atom+xml" title="zunzuncito - #{{ term.name }}" href="atom.xml" />
+ {% endif -%}
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
</head>
@@ -15,10 +33,12 @@
<header>
<h1><a href="/">{{ config.title }}</a></h1>
<div class="banner smaller">
- {{ config.description }} ·
- {%- block description %}
- <a href="/atom.xml">feed</a> · <a href="/tags">tags</a>
- {%- endblock %}
+ {{ config.description }}{% if description %} · {{ description }}{% endif %}
+ {% if section -%}
+ · <a href="/atom.xml">feed</a> · <a href="/tags">tags</a>
+ {% elif term -%}
+ · <a href="atom.xml">feed</a>
+ {% endif -%}
</div>
</header>
{%- block content %}{% endblock -%}
diff --git a/templates/page.html b/templates/page.html
index 394dd97..07fe19d 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -1,17 +1,5 @@
{% extends "base.html" -%}
-{%- block title -%}
-{%- if page.title -%}
-{{ page.title }}
-{%- else -%}
-post № {{ page.slug }}
-{%- endif -%}
-{%- endblock title -%}
-
-{%- block description %}
-post № {{ page.slug }}
-{%- endblock description %}
-
{%- block content %}
{{ macros::render_post(post=page, in_feed=false) }}
{%- if "mentions" in page.extra and page.extra.mentions | length > 0 -%}
diff --git a/templates/tags/list.html b/templates/tags/list.html
index 0cab254..260bb57 100644
--- a/templates/tags/list.html
+++ b/templates/tags/list.html
@@ -1,13 +1,5 @@
{% extends "base.html" %}
-{%- block title -%}
-all tags
-{%- endblock title -%}
-
-{%- block description %}
-all tags
-{%- endblock description %}
-
{% block content %}
<nav class="tags">
<ul class="inline">
diff --git a/templates/tags/single.html b/templates/tags/single.html
index 2238061..3cbdde4 100644
--- a/templates/tags/single.html
+++ b/templates/tags/single.html
@@ -1,17 +1,5 @@
{% extends "base.html" %}
-{%- block additional_feeds %}
-<link rel="alternate" type="application/atom+xml" title="zunzuncito - #{{ term.name }}" href="atom.xml" />
-{%- endblock %}
-
-{%- block title -%}
-posts tagged with #{{ term.name }}
-{%- endblock title -%}
-
-{%- block description %}
-posts tagged with #{{ term.name }} · <a href="atom.xml">feed</a>
-{%- endblock description %}
-
{%- block content %}
{%- for post in paginator.pages %}
{{ macros::render_post(post=post) }}