63 lines
2.6 KiB
Text
63 lines
2.6 KiB
Text
{%- capture appVersionString -%}{% appVersion %}{%- endcapture -%}
|
|
{%- assign source = page -%}
|
|
{%- case schema -%}
|
|
{%- when 'artist', 'genre', 'book', 'movie', 'show', 'tags' -%}
|
|
{% render "dynamic/fetchers/{{ schema }}.php.liquid" %}
|
|
{%- when 'blog' -%}
|
|
{%- assign source = post -%}
|
|
{%- when 'music-index', 'music-week-artists' -%}
|
|
{%- assign source = music.week.artists[0] -%}
|
|
{%- when 'music-week-albums', 'music-week-tracks' -%}
|
|
{%- assign source = music.week.albums[0] -%}
|
|
{%- when 'music-month-artists' -%}
|
|
{%- assign source = music.month.artists[0] -%}
|
|
{%- when 'music-month-albums' -%}
|
|
{%- assign source = music.month.albums[0] -%}
|
|
{%- when 'music-releases' -%}
|
|
{%- assign source = albumReleases.upcoming[0] -%}
|
|
{%- when 'books' -%}
|
|
{%- assign source = books.all | filterBooksByStatus: 'started' | reverse | first -%}
|
|
{%- when 'reading-year' -%}
|
|
{%- assign title = 'Books • ' | append: year.value | append: ' • ' | append: globals.site_name -%}
|
|
{%- assign description = "Here's what I read in " | append: year.value | append: '.' -%}
|
|
{%- assign bookYear = year.data | filterBooksByStatus: 'finished' | shuffleArray | first -%}
|
|
{%- assign source = bookYear -%}
|
|
{%- when 'favorite-movies' -%}
|
|
{%- assign source = movies.favorites | shuffleArray | first -%}
|
|
{%- when 'favorite-shows' -%}
|
|
{%- assign source = tv.favorites | shuffleArray | first -%}
|
|
{%- when 'watching' -%}
|
|
{%- assign mergedMovies = movies.recentlyWatched | mergeArray: movies.favorites -%}
|
|
{%- assign mergedShows = tv.recentlyWatched | mergeArray: tv.favorites -%}
|
|
{%- assign source = mergedMovies | mergeArray: mergedShows | shuffleArray | first -%}
|
|
{%- when 'upcoming-shows' -%}
|
|
{%- assign source = upcomingShows.watching | shuffleArray | first -%}
|
|
{%- endcase %}
|
|
{%- assign meta = source | getMetadata: globals, page, title, description, schema -%}
|
|
{%- assign fullUrl = meta.url -%}
|
|
{%- assign oembedUrl = globals.url | append: "/oembed" | append: page.url -%}
|
|
{%- if type == 'dynamic' -%}
|
|
{% render "dynamic/metadata/index.php.liquid"
|
|
fullUrl: fullUrl,
|
|
oembedUrl: oembedUrl,
|
|
pageTitle: meta.title,
|
|
pageDescription: meta.description,
|
|
ogImage: meta.open_graph_image,
|
|
globals: globals,
|
|
%}
|
|
{%- else -%}
|
|
{% render "static/metadata/static.liquid"
|
|
fullUrl: fullUrl,
|
|
oembedUrl: oembedUrl,
|
|
pageTitle: meta.title,
|
|
pageDescription: meta.description,
|
|
ogImage: meta.open_graph_image,
|
|
globals: globals,
|
|
%}
|
|
{%- endif %}
|
|
{% render "static/metadata/base.liquid"
|
|
pageTitle: meta.title,
|
|
globals: globals,
|
|
eleventy: eleventy,
|
|
appVersion: appVersion,
|
|
%}
|