From d1deb8486f1f70e5ad44cb65279e52e1ed64ba89 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 31 May 2022 01:24:13 -0700 Subject: Seo Per Page --- templates/categories/list.html | 15 +++++++++++++++ templates/categories/single.html | 15 +++++++++++++++ templates/contact.html | 24 ++++++++++++++++++++++++ templates/page.html | 32 +++++++++++++++++++++++++++++++- templates/pages.html | 25 +++++++++++++++++++++++++ templates/posts.html | 18 ++++++++++++++++++ templates/tags/list.html | 15 +++++++++++++++ templates/tags/single.html | 15 +++++++++++++++ 8 files changed, 158 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/categories/list.html b/templates/categories/list.html index 485d54d..f85f732 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -1,5 +1,20 @@ {% extends "base.html" %} +{%- block seo %} + {{- super() }} + {%- set title = "Categories" %} + + {%- if config.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- else %} + {%- set title_addition = "" %} + {%- endif %} + + {%- set description = config.description %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }} +{%- endblock seo %} + {%- block content %}
diff --git a/templates/categories/single.html b/templates/categories/single.html index 0fe639d..f1c5cfe 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -1,5 +1,20 @@ {% extends "base.html" %} +{%- block seo %} + {{- super() }} + {%- set title = term.name ~ " category" %} + + {%- if config.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- else %} + {%- set title_addition = "" %} + {%- endif %} + + {%- set description = config.description %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }} +{%- endblock seo %} + {%- block content %}

{{ term.name }}

diff --git a/templates/contact.html b/templates/contact.html index 7304551..eabb00f 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -1,5 +1,29 @@ +{# This Page Shows the contact page eg: example.com/contact/ #} + {% extends "base.html" %} +{%- block seo %} + {{- super() }} + {%- set title_addition = "" %} + + {%- if page.title and config.title %} + {%- set title = page.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- elif page.title %} + {%- set title = page.title %} + {%- else %} + {%- set title = config.title %} + {%- endif %} + + {%- if page.description %} + {%- set description = page.description %} + {%- else %} + {%- set description = config.description %} + {%- endif %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description) }} +{%- endblock seo %} + {%- block content %}

Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!

diff --git a/templates/page.html b/templates/page.html index 6ea50d6..8482633 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,5 +1,35 @@ +{# This Page Shows the Individual Blog Posts#} + {% extends "base.html" %} -{% import "macros/macros.html" as macros %} + +{%- block seo %} + {{- super() }} + {%- set title_addition = "" %} + {%- if page.title and config.title %} + {%- set title = page.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- elif page.title %} + {%- set title = page.title %} + {%- else %} + {%- set title = config.title %} + {%- endif %} + + {%- if page.description %} + {%- set description = page.description %} + {%- else %} + {%- set description = config.description %} + {%- endif %} + {%- set created_time = page.date %} + {%- set updated_time = page.updated %} + {%- if current_section %} + {%- set page_section = current_section %} + {%- else %} + {%- set page_section = "" %} + {%- endif %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }} +{%- endblock seo %} + {%- block content %}
{{- macros::title(page=page) }} diff --git a/templates/pages.html b/templates/pages.html index a9147c7..38dfd7f 100644 --- a/templates/pages.html +++ b/templates/pages.html @@ -1,4 +1,29 @@ +{# This Page Shows the 'Pages' (abridge/content/pages) eg: example.com/about/ example.com/privacy/ #} + {% extends "base.html" %} + +{%- block seo %} + {{- super() }} + {%- set title_addition = "" %} + + {%- if page.title and config.title %} + {%- set title = page.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- elif page.title %} + {%- set title = page.title %} + {%- else %} + {%- set title = config.title %} + {%- endif %} + + {%- if page.description %} + {%- set description = page.description %} + {%- else %} + {%- set description = config.description %} + {%- endif %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description) }} +{%- endblock seo %} + {%- block content %}
{{ page.content | safe }} diff --git a/templates/posts.html b/templates/posts.html index 3d4184d..bd5d0d8 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -1,4 +1,22 @@ +{# This Page Shows the Posts Grouped by Year: example.com/posts/ #} + {% extends "base.html" %} + +{%- block seo %} + {{- super() }} + {%- set title = "Posts" %} + + {%- if config.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- else %} + {%- set title_addition = "" %} + {%- endif %} + + {%- set description = config.description %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }} +{%- endblock seo %} + {%- block content %} {%- set section_item = get_section(path="_index.md") %}
diff --git a/templates/tags/list.html b/templates/tags/list.html index 2dd3497..e03b6df 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -1,5 +1,20 @@ {% extends "base.html" %} +{%- block seo %} + {{- super() }} + {%- set title = "Tags" %} + + {%- if config.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- else %} + {%- set title_addition = "" %} + {%- endif %} + + {%- set description = config.description %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }} +{%- endblock seo %} + {%- block content %}
diff --git a/templates/tags/single.html b/templates/tags/single.html index d9d03eb..b4428ff 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -1,5 +1,20 @@ {% extends "base.html" %} +{%- block seo %} + {{- super() }} + {%- set title = term.name ~ " tag" %} + + {%- if config.title %} + {%- set title_addition = title_separator ~ config.title %} + {%- else %} + {%- set title_addition = "" %} + {%- endif %} + + {%- set description = config.description %} + + {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }} +{%- endblock seo %} + {%- block content %}

{{ term.name }}

-- cgit v1.3.1