chore: book meta + og images

This commit is contained in:
Cory Dransfeldt 2024-05-21 12:40:29 -07:00
parent 3ccc07ee63
commit 41d3d4b8c3
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View file

@ -1,9 +1,11 @@
{%- capture fullUrl -%}{{ meta.url }}{{ page.url }}{%- endcapture -%} {%- capture fullUrl -%}{{ meta.url }}{{ page.url }}{%- endcapture -%}
{%- capture pageTitle -%} {%- capture pageTitle -%}
{% if page.url | isPost %} {%- if schema == 'blog' -%}
{{ title }} {{ title }}
{% elsif title %} {% elsif title %}
{{ title }} • {{ meta.siteName }} {{ title }} • {{ meta.siteName }}
{% elsif book.title %}
Books • {{ book.title }} • {{ meta.siteName }}
{% else %} {% else %}
{{ meta.siteName }} {{ meta.siteName }}
{% endif %} {% endif %}
@ -19,6 +21,8 @@
{%- elsif schema == 'books' -%} {%- elsif schema == 'books' -%}
{%- assign featuredBook = books | bookStatus: 'started' | reverse | first -%} {%- assign featuredBook = books | bookStatus: 'started' | reverse | first -%}
{{ featuredBook.image }} {{ featuredBook.image }}
{%- elsif schema == 'book' -%}
{{ book.image }}
{%- else -%} {%- else -%}
{{ meta.meta_data.opengraph_default }} {{ meta.meta_data.opengraph_default }}
{%- endif -%} {%- endif -%}

View file

@ -5,6 +5,8 @@ pagination:
size: 1 size: 1
alias: book alias: book
permalink: /books/{{ book.isbn }}/ permalink: /books/{{ book.isbn }}/
isbn: {{ book.isbn }}
schema: book
--- ---
<a class="back-link-header link-icon flex-centered" href="/books">{% tablericon "arrow-left" "Go back" %} Go back</a> <a class="back-link-header link-icon flex-centered" href="/books">{% tablericon "arrow-left" "Go back" %} Go back</a>
<article class="book-focus"> <article class="book-focus">