aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2022-11-10 03:28:16 +0300
committerValentin Popov <valentin@popov.link>2022-11-10 03:28:16 +0300
commitfd90ea2db3b5b17d871346210ad80f5d9ee441ad (patch)
tree5920c0969e750820e97c19302e35502db97ba0b9
parent02fecc39124b768523acc85b178dbdd3421e714e (diff)
downloadpopov.link-fd90ea2db3b5b17d871346210ad80f5d9ee441ad.tar.xz
popov.link-fd90ea2db3b5b17d871346210ad80f5d9ee441ad.zip
Added a dynamic title
Signed-off-by: Valentin Popov <valentin@popov.link>
-rw-r--r--templates/base.html2
-rw-r--r--templates/includes/title.html9
2 files changed, 10 insertions, 1 deletions
diff --git a/templates/base.html b/templates/base.html
index 7ce44ca..b0c0e80 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -12,7 +12,7 @@
<link href="{{ get_url(path='atom.xml', trailing_slash=false) | trim }}" rel="alternate" title="RSS" type="application/atom+xml" />
{% endblock %}
- <title>{{ config.title | trim }}</title>
+ {% include 'includes/title.html' %}
<!-- CSS -->
{% set css = load_data(path='styles.css', format='plain') %}
diff --git a/templates/includes/title.html b/templates/includes/title.html
new file mode 100644
index 0000000..bf724ed
--- /dev/null
+++ b/templates/includes/title.html
@@ -0,0 +1,9 @@
+{% if page.title %}
+{% set title = page.title ~ ' | ' ~ config.title %}
+{% endif %}
+
+{% if section.title %}
+{% set title = section.title ~ ' | ' ~ config.title %}
+{% endif %}
+
+<title>{{ title | default(value=config.title) | trim }}</title> \ No newline at end of file