diff --git a/templates/base.html b/templates/base.html index 903f451..89db46b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -77,7 +77,7 @@ { "@type": "Person", "@id": "{{ config.base_url | safe }}/#author", - "name": {{ config.extra.author | default(value="andwati") | json_encode | safe }}, + "name": {{ config.extra.author | json_encode | safe }}, "url": "{{ config.base_url | safe }}/about/", "sameAs": [ {% if config.extra.github_url %}"{{ config.extra.github_url | safe }}"{% if config.extra.twitter_url or config.extra.youtube_url %},{% endif %}{% endif %} diff --git a/templates/index.html b/templates/index.html index 185062a..3c3a1e9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,9 +21,14 @@ block og_url %}{{ config.base_url }}/{% endblock og_url %} {% block head %} "@type": "BlogPosting", "@id": "{{ page.permalink | safe }}#article", "headline": {{ page.title | json_encode | safe }}, - "image": "{{ config.base_url | safe }}/images/og-image.png", - "url": "{{ page.permalink | safe }}" + "image": "{{ config.base_url | safe }}{% if page.extra.image %}{{ page.extra.image | safe }}{% else %}/images/og-image.png{% endif %}", + "url": "{{ page.permalink | safe }}", + "author": { + "@type": "Person", + "@id": "{{ config.base_url | safe }}/#author" + } {% if page.date %},"datePublished": "{{ page.date | date(format="%+") }}"{% endif %} + {% if page.updated %},"dateModified": "{{ page.updated | date(format="%+") }}"{% elif page.date %},"dateModified": "{{ page.date | date(format="%+") }}"{% endif %} }{% if not loop.last %},{% endif %} {% endfor %} ] diff --git a/templates/page.html b/templates/page.html index 15fc49c..0ba140d 100644 --- a/templates/page.html +++ b/templates/page.html @@ -14,7 +14,7 @@ {% if page.ancestors is containing("posts/_index.md") %} {% if page.date %}{% endif %} {% if page.updated %}{% endif %} - + {% if page.taxonomies.tags %} {% for tag in page.taxonomies.tags %} @@ -41,8 +41,8 @@ "@id": "{{ page.permalink | safe }}" }, "headline": {{ page.title | json_encode | safe }}, - "description": {{ page.description | default(value=config.description) | json_encode | safe }}, - "image": "{{ config.base_url | safe }}{{ page.extra.image | default(value="/images/og-image.png") | safe }}", + "description": {% if page.description %}{{ page.description | json_encode | safe }}{% else %}{{ config.description | json_encode | safe }}{% endif %}, + "image": "{{ config.base_url | safe }}{% if page.extra.image %}{{ page.extra.image | safe }}{% else %}/images/og-image.png{% endif %}", "url": "{{ page.permalink | safe }}", "inLanguage": "en-US", {% if page.date %}"datePublished": "{{ page.date | date(format="%+") }}",{% endif %} @@ -50,13 +50,13 @@ "author": { "@type": "Person", "@id": "{{ config.base_url | safe }}/#author", - "name": {{ config.extra.author | default(value="andwati") | json_encode | safe }}, + "name": {{ config.extra.author | json_encode | safe }}, "url": "{{ config.base_url | safe }}/about/" }, "publisher": { "@type": "Person", "@id": "{{ config.base_url | safe }}/#author", - "name": {{ config.extra.author | default(value="andwati") | json_encode | safe }}, + "name": {{ config.extra.author | json_encode | safe }}, "url": "{{ config.base_url | safe }}/about/" }, "isPartOf": { @@ -91,7 +91,7 @@ "@type": "WebPage", "@id": "{{ page.permalink | safe }}", "name": {{ page.title | json_encode | safe }}, - "description": {{ page.description | default(value=config.description) | json_encode | safe }}, + "description": {% if page.description %}{{ page.description | json_encode | safe }}{% else %}{{ config.description | json_encode | safe }}{% endif %}, "url": "{{ page.permalink | safe }}", "inLanguage": "en-US", "isPartOf": { diff --git a/templates/partials/head.html b/templates/partials/head.html index 2fa0daa..66808ec 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -64,7 +64,7 @@ { "@type": "Person", "@id": "{{ config.base_url | safe }}/#author", - "name": {{ config.extra.author | default(value="andwati") | json_encode | safe }}, + "name": {{ config.extra.author | json_encode | safe }}, "url": "{{ config.base_url | safe }}/about/", "sameAs": [ {% if config.extra.github_url %}"{{ config.extra.github_url | safe }}"{% if config.extra.twitter_url or config.extra.youtube_url %},{% endif %}{% endif %} diff --git a/templates/partials/profile.html b/templates/partials/profile.html index 9073313..b13903a 100644 --- a/templates/partials/profile.html +++ b/templates/partials/profile.html @@ -1,6 +1,6 @@ {% if config.extra.show_profile %}
{{ config.extra.author | default(value="andwati") }}{% if config.extra.profile_subtitle %} — {{ config.extra.profile_subtitle }}{% endif %}
+{{ config.extra.author }}{% if config.extra.profile_subtitle %} — {{ config.extra.profile_subtitle }}{% endif %}
{{ config.description }}
diff --git a/templates/posts.html b/templates/posts.html index 2f6252a..295ed7e 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -30,9 +30,14 @@ og_description %}{{ config.extra.posts_page_subtitle | default(value="Exploring "@type": "BlogPosting", "@id": "{{ page.permalink | safe }}#article", "headline": {{ page.title | json_encode | safe }}, - "image": "{{ config.base_url | safe }}{{ page.extra.image | default(value="/images/og-image.png") | safe }}", - "url": "{{ page.permalink | safe }}" + "image": "{{ config.base_url | safe }}{% if page.extra.image %}{{ page.extra.image | safe }}{% else %}/images/og-image.png{% endif %}", + "url": "{{ page.permalink | safe }}", + "author": { + "@type": "Person", + "@id": "{{ config.base_url | safe }}/#author" + } {% if page.date %},"datePublished": "{{ page.date | date(format="%+") }}"{% endif %} + {% if page.updated %},"dateModified": "{{ page.updated | date(format="%+") }}"{% elif page.date %},"dateModified": "{{ page.date | date(format="%+") }}"{% endif %} }{% if not loop.last %},{% endif %} {% endfor %} ] diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 978318b..2954d35 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -5,7 +5,7 @@ description %} {% block canonical %}{{ term.permalink }}{% endblock canonical %} config.extra.tag_descriptions[term.slug] | default(value='Posts tagged "' ~ term.name ~ '" on ' ~ config.title) }}{% endblock og_description %} {% block og_url %}{{ term.permalink }}{% endblock og_url %} {% block head %} {% set tag_ld_name = 'Posts tagged "' ~ term.name ~ '" | ' ~ config.title %} -{% set tag_ld_description = config.extra.tag_descriptions[term.slug] | default(value='Posts tagged "' ~ term.name ~ '" on ' ~ config.title) %} +{% set tag_ld_fallback_description = 'Posts tagged "' ~ term.name ~ '" on ' ~ config.title %}