chore: cleanup

This commit is contained in:
Cory Dransfeldt 2024-10-25 12:52:20 -07:00
parent 56c9a128f0
commit e327e44f1d
No known key found for this signature in database
38 changed files with 93 additions and 106 deletions

View file

@ -0,0 +1,53 @@
{%- assign fullUrl = globals.url | append: page.url -%}
{%- assign pageTitle = globals.site_name -%}
{%- assign pageDescription = globals.site_description -%}
{%- assign ogImage = globals.cdn_url | append: globals.avatar -%}
{%- case schema -%}
{%- when 'blog' -%}
{%- assign pageTitle = post.title -%}
{%- assign pageDescription = post.description | markdown | strip_html | default: globals.site_description -%}
{%- when 'music-index' -%}
{%- assign pageTitle = 'Music / ' | append: globals.site_name -%}
{%- when 'music-period' -%}
{%- assign pageTitle = 'Music / ' | append: page.title | append: ' / ' | append: globals.site_name -%}
{%- when 'music' -%}
{%- assign ogImage = globals.cdn_url | append: page.image -%}
{%- when 'music-index' -%}
{%- assign ogImage = globals.cdn_url | append: music.week.artists[0].grid.image -%}
{%- when 'watching' or 'favorite-movies' -%}
{%- assign featuredMovie = movies.recentlyWatched | first -%}
{%- assign ogImage = globals.cdn_url | append: featuredMovie.grid.backdrop -%}
{%- when 'watching-shows' or 'favorite-shows' -%}
{%- assign featuredShow = tv.recentlyWatched | first -%}
{%- assign ogImage = globals.cdn_url | append: featuredShow.grid.backdrop -%}
{%- when 'books' or 'books-year' -%}
{%- assign featuredBook = books.all | filterBooksByStatus: 'started' | reverse | first -%}
{%- assign ogImage = globals.cdn_url | append: featuredBook.grid.image -%}
{%- when 'books-year' -%}
{%- assign pageTitle = year.value | append: ' / Books / ' | append: globals.site_name -%}
{%- when 'page' -%}
{%- assign pageTitle = page.title | append: ' / ' | append: globals.site_name -%}
{%- else -%}
{%- assign pageTitle = globals.site_name -%}
{%- endcase -%}
{% if title %}
{%- assign pageTitle = title | append: ' / ' | append: globals.site_name -%}
{% endif %}
{%- if page.description -%}
{%- assign pageDescription = page.description -%}
{%- elsif description -%}
{%- assign pageDescription = description -%}
{%- endif -%}
{%- assign escapedPageDescription = pageDescription | escape -%}
<title data-dynamic="title">{{ pageTitle }}</title>
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{{ pageTitle }}" data-dynamic="og:title" />
<meta name="description" content="{{ escapedPageDescription }}" data-dynamic="description" />
<meta property="og:description" content="{{ escapedPageDescription }}" data-dynamic="og:description" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ fullUrl }}" data-dynamic="og:url" />
<meta property="og:image" content="{{ ogImage }}?class=w800" data-dynamic="og:image" />