{{ page.title }}
diff --git a/templates/index.html b/templates/index.html index aa3dd8b..42366b5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,6 +2,7 @@ {% import "macros/head.html" as head_macros -%} {% import "macros/menu.html" as menu_macros -%} {% import "macros/post.html" as post_macros -%} +{% import "macros/title.html" as title_macros -%} diff --git a/templates/macros/title.html b/templates/macros/title.html new file mode 100644 index 0000000..a8575de --- /dev/null +++ b/templates/macros/title.html @@ -0,0 +1,17 @@ +{% macro title(page_title, main_title) %} + {%- if config.extra.page_titles == "combined" -%} + {%- if page_title -%} + {{ page_title }} | {{ main_title }} + {%- else -%} + {{ main_title }} + {%- endif -%} + {%- elif config.extra.page_titles == "page_only" -%} + {%- if page_title -%} + {{ page_title }} + {%- else -%} + {{ main_title }} + {%- endif -%} + {%- else -%} + {{ main_title }} + {%- endif -%} +{% endmacro title %} diff --git a/templates/page.html b/templates/page.html index 9f3125e..f59d965 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,5 +1,9 @@ {% extends "index.html" %} +{%- block title -%} +{{ title_macros::title(page_title=page.title, main_title=config.title) }} +{%- endblock -%} + {% block content %}
{{ post_macros::header(page=page) }}
diff --git a/templates/tags/list.html b/templates/tags/list.html
index 0d2e6bf..98cd693 100644
--- a/templates/tags/list.html
+++ b/templates/tags/list.html
@@ -1,5 +1,9 @@
{% extends "index.html" %}
+{%- block title -%}
+{{ title_macros::title(page_title="Tags", main_title=config.title) }}
+{%- endblock -%}
+
{% block content %}