This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/_includes/base.liquid

155 lines
No EOL
6.7 KiB
Text

{%- capture fullUrl -%}{{ meta.url }}{{ page.url }}{%- endcapture -%}
{%- capture pageTitle -%}
{%- if schema == 'blog' -%}
{{ title }}
{% elsif title %}
{{ title }} • {{ meta.siteName }}
{% elsif book.title %}
Books • {{ book.title }} • {{ meta.siteName }}
{% elsif movie.title %}
Movies • {{ movie.title }}{% if movie.rating %} ({{ movie.rating }}){% endif %} • {{ meta.siteName }}
{% elsif movie.title %}
Shows • {{ show.title }} • {{ meta.siteName }}
{% else %}
{{ meta.siteName }}
{%- endif -%}
{%- endcapture -%}
{%- capture pageDescription -%}
{%- if schema == 'blog' -%}
{{ post_excerpt | markdown | strip_html }}
{% elsif book.description %}
{{ book.description }}
{% elsif movie.description %}
{% if movie.review %}{{ movie.review }}{% else %}{{ movie.description }}{% endif %}
{% elsif show.description %}
{% if show.review %}{{ show.review }}{% else %}{{ show.description }}{% endif %}
{% elsif description %}
{{ description }}
{% else %}
{{ meta.siteDescription }}
{%- endif -%}
{%- endcapture -%}
{%- capture ogImage -%}
{%- if schema == 'blog' -%}
{{ meta.url }}/assets/img/ogi/{{ title | slugifyString }}-preview.png
{%- elsif schema == 'music' -%}
{{ music.recent.artists[0].image }}
{%- elsif schema == 'watching' -%}
{%- assign featuredMovie = movies.recentlyWatched | first -%}
{{ featuredMovie.backdrop }}
{%- elsif schema == 'books' -%}
{%- assign featuredBook = books | bookStatus: 'started' | reverse | first -%}
{{ featuredBook.image }}
{%- elsif schema == 'book' -%}
{{ book.image }}
{%- elsif schema == 'movie' -%}
{{ movie.backdrop }}
{%- elsif schema == 'show' -%}
{{ meta.url }}/media/shows/backdrops/backdrop-{{ show.tmdb_id }}.jpg
{%- else -%}
{{ meta.meta_data.opengraph_default }}
{%- endif -%}
{%- endcapture -%}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ pageTitle }}</title>
<link rel="preload" href="/assets/fonts/MonoLisa.min.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="/assets/styles/index.css?v={% appVersion %}" type="text/css" />
<script async data-id="101449513" src="/23af0256fe76a.js"></script>
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{{ pageTitle }}" />
<meta name="description" content="{{ pageDescription | escape | strip }}" />
<meta property="og:description" content="{{ pageDescription | escape | strip }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ fullUrl }}" />
<meta property="og:image" content="{{ ogImage }}" />
<meta name="theme-color" content="{{ meta.themeColor }}" />
<meta name="generator" content="Eleventy">
<meta name="robots" content="noai, noimageai">
<link href="/assets/icons/favicon.ico?v={% appVersion %}" rel="icon" sizes="any">
<link href="/assets/icons/favicon.svg?v={% appVersion %}" rel="icon" type="image/svg+xml">
<link href="/assets/icons/apple-touch-icon.png?v={% appVersion %}" rel="apple-touch-icon">
<link rel="webmention" href="https://webmention.io/coryd.dev/webmention" />
<link rel="pingback" href="https://webmention.io/coryd.dev/xmlrpc" />
<link type="application/atom+xml" rel="alternate" title="{{ meta.siteName }}" href="https://feedpress.me/coryd">
<link rel="alternate" type="application/json" title="{{ meta.siteName }}" href="https://feedpress.me/coryd.json" />
<link rel="alternate" href="https://feedpress.me/coryd-follow" title="{{ meta.siteName }}'s activity feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-links" title="{{ meta.siteName }}'s links feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-books" title="{{ meta.siteName }}'s books feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-artist-charts" title="{{ meta.siteName }}'s artist charts feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-all" title="{{ meta.siteName }}'s activity feed" type="application/rss+xml">
<link type="text/plain" rel="author" href="/humans.txt" />
{% if schema == 'blog' %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage"
},
"isPartOf": {
"@id": "{{ meta.url }}#website"
},
"@id": "{{ fullUrl }}",
"headline": "{{ pageTitle }}",
"description": "{% if description %}{{ description }}{% else %}{{ meta.siteDescription }}{% endif %}",
"image": "{% if image %}{{ image }}{% else %}{{ meta.meta_data.opengraph_default }}{% endif %}",
"inLanguage": "{{ meta.locale }}",
"publisher": {
"@type": "{{ meta.siteType }}",
"name": "{{ meta.author }}",
"url": "{{ meta.url }}"
},
"author": {
"@type": "Person",
"name": "{{ meta.author }}"
},
"datePublished": "{{ page.date | isoDateOnly: '.' }}"
}
</script>
{% else %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ meta.url }}#website",
"url": "{{ meta.url }}",
"name": "{{ pageTitle }}",
"description": "{% if description %}{{ description }}{% else %}{{ meta.siteDescription }}{% endif %}",
"inLanguage": "{{ meta.locale }}"
}
]
}
</script>
{% endif %}
<noscript>
<style>.client-side {display:none}</style>
<p><img width="1" height="1" src="/7afb285ad050d" /></p>
</noscript>
</head>
<body>
<script>
(() => {
const currentTheme = sessionStorage?.getItem('theme');
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
const root = document.getElementsByTagName('html')[0];
if (!currentTheme) sessionStorage?.setItem('theme', (prefersDarkScheme ? 'dark' : 'light'))
if (currentTheme === 'dark') {
root.classList.add('theme__dark')
} else if (currentTheme === 'light') {
root.classList.add('theme__light')
} else if (prefersDarkScheme) {
root.classList.add('theme__dark')
} else if (!prefersDarkScheme) {
root.classList.add('theme__light')
}
})();
</script>
{{ content }}
</body>
</html>