feat(*): refactor dynamic vs. static structure and distinctions; make additional elements dynamic
This commit is contained in:
parent
7a0b808f24
commit
4d76a3ba1e
138 changed files with 998 additions and 970 deletions
|
@ -1,63 +0,0 @@
|
|||
{%- capture appVersionString -%}{% appVersion %}{%- endcapture -%}
|
||||
{%- assign source = page -%}
|
||||
{%- case schema -%}
|
||||
{%- when 'artist', 'genre', 'book', 'movie', 'show', 'tags' -%}
|
||||
{% render "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 "metadata/dynamic.php.liquid"
|
||||
fullUrl: fullUrl,
|
||||
oembedUrl: oembedUrl,
|
||||
pageTitle: meta.title,
|
||||
pageDescription: meta.description,
|
||||
ogImage: meta.open_graph_image,
|
||||
globals: globals,
|
||||
%}
|
||||
{%- else -%}
|
||||
{% render "metadata/static.liquid"
|
||||
fullUrl: fullUrl,
|
||||
oembedUrl: oembedUrl,
|
||||
pageTitle: meta.title,
|
||||
pageDescription: meta.description,
|
||||
ogImage: meta.open_graph_image,
|
||||
globals: globals,
|
||||
%}
|
||||
{%- endif %}
|
||||
{% render "metadata/base.liquid"
|
||||
pageTitle: meta.title,
|
||||
globals: globals,
|
||||
eleventy: eleventy,
|
||||
appVersion: appVersion,
|
||||
%}
|
Loading…
Add table
Add a link
Reference in a new issue