chore: cleanup and refactor
This commit is contained in:
parent
b6fb54ab98
commit
5295a6eacc
37 changed files with 285 additions and 356 deletions
|
@ -1,5 +1,5 @@
|
|||
{%- capture fullUrl %}
|
||||
{{ site.url }}{{ page.url }}{% endcapture -%}
|
||||
{{ meta.url }}{{ page.url }}{% endcapture -%}
|
||||
<!doctype html>
|
||||
<html class="scrollbar-thin scrollbar-thumb-blue-600 dark:scrollbar-thumb-blue-400 scrollbar-track-blue-100" lang="en">
|
||||
<head>
|
||||
|
@ -7,17 +7,17 @@
|
|||
{% if title %}
|
||||
{{ title }} •
|
||||
{% endif %}
|
||||
{{ site.title }}</title>
|
||||
{{ meta.siteName }}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="canonical" href="{{ fullUrl }}" />
|
||||
<meta property="og:title" content="{% if title %}{{ title }} • {% endif %}{{site.title}}" />
|
||||
<meta name="description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ site.description }}{% endif %}" />
|
||||
<meta property="og:description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ site.description }}{% endif %}" />
|
||||
<meta property="og:title" content="{% if title %}{{ title }} • {% endif %}{{meta.title}}" />
|
||||
<meta name="description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ meta.siteDescription }}{% endif %}" />
|
||||
<meta property="og:description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ meta.siteDescription }}{% endif %}" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="{{ fullUrl }}" />
|
||||
<meta property="og:image" content="{{ image | getPostImage }}">
|
||||
<meta name="theme-color" content="#3b82f6" />
|
||||
<meta name="theme-color" content="{{ meta.themeColor }}" />
|
||||
<meta name="generator" content="{{ eleventy.generator }}">
|
||||
<meta name="robots" content="noai, noimageai">
|
||||
<link
|
||||
|
@ -55,9 +55,11 @@
|
|||
href="https://feedpress.me/coryd-follow"
|
||||
title="Cory Dransfeldt's activity feed"
|
||||
type="application/rss+xml">
|
||||
<script type="application/ld+json">
|
||||
{% jsonLd meta, type, tags %}
|
||||
</script>
|
||||
{% if schema == 'blog' %}
|
||||
{% render "schemas/blogpost-schema.liquid", meta: meta, page: page %}
|
||||
{% else %}
|
||||
{% render "schemas/base-schema.liquid", meta: meta, page: page %}
|
||||
{% endif %}
|
||||
<script defer data-domain="coryd.dev" src="/js/script.js"></script>
|
||||
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
|
||||
<noscript>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
layout: main
|
||||
---
|
||||
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
|
||||
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
|
||||
<div class="pt-8 prose dark:prose-invert hover:prose-a:text-blue-800 dark:hover:prose-a:text-blue-200 max-w-full">
|
||||
{{ content }}
|
||||
</div>
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
layout: main
|
||||
---
|
||||
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
|
||||
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
|
||||
{{ content }}
|
||||
{% render "partials/now/media-grid.liquid", data:artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8, loading: 'eager' %}
|
||||
{% render "partials/now/media-grid.liquid", data:albums, icon: "vinyl", title: "Albums", shape: "square", count: 8 %}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<div class="mt-12 py-8 border-t-2 flex flex-col md:flex-row justify-between items-center">
|
||||
<div class="flex flex-col mb-4 md:mb-0 md:flex-row items-center flex-1">
|
||||
<div class="border border-blue-600 dark:border-blue-400 bg-white rounded-full overflow-hidden mb-4 md:mb-0 md:mr-4 [&>*]:h-20 [&>*]:w-20 flex flex-col items-center">
|
||||
{% image './src/assets/img/avatar.webp', site.name, 'inline-block' %}
|
||||
{% image './src/assets/img/avatar.webp', meta.siteName, 'inline-block' %}
|
||||
</div>
|
||||
<span class="text-lg font-medium">{{ site.name }}</span>
|
||||
<span class="text-lg font-medium">{{ meta.siteName }}</span>
|
||||
</div>
|
||||
<p class="text-sm flex-1">{{ site.description }}</p>
|
||||
<p class="text-sm flex-1">{{ meta.siteDescription }}</p>
|
||||
</div>
|
|
@ -3,8 +3,8 @@
|
|||
"version": "https://jsonfeed.org/version/1",
|
||||
"title": "{{ title }}",
|
||||
"icon": "https://coryd.dev/static/images/avatar.webp",
|
||||
"home_page_url": "{{ site.url }}",
|
||||
"feed_url": "{{ site.url }}{{ permalink }}",
|
||||
"home_page_url": "{{ meta.url }}",
|
||||
"feed_url": "{{ meta.url }}{{ permalink }}",
|
||||
"items": [{% for entry in entries limit: 20 -%}
|
||||
{
|
||||
"id": "{{ entry.url | btoa }}",
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
{% assign entries = data | normalizeEntries -%}
|
||||
<title>{{ title }}</title>
|
||||
<description>{{ description }}</description>
|
||||
<link>{{ permalink | absoluteUrl: site.url }}</link>
|
||||
<link>{{ permalink | absoluteUrl: meta.url }}</link>
|
||||
<lastBuildDate>{{ updated }}</lastBuildDate>
|
||||
<image>
|
||||
<title>{{ title }}</title>
|
||||
<link>{{ permalink | absoluteUrl: site.url }}</link>
|
||||
<url>{{ site.url }}/assets/icons/feed-icon.png</url>
|
||||
<link>{{ permalink | absoluteUrl: meta.url }}</link>
|
||||
<url>{{ meta.url }}/assets/icons/feed-icon.png</url>
|
||||
<width>144</width>
|
||||
<height>144</height>
|
||||
</image>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="flex flex-col md:flex-row md:items-center md:justify-between pt-5 md:pt-10">
|
||||
<h1 class="text-2xl md:text-3xl font-black leading-tight pb-5 md:pb-0">
|
||||
<a class="text-gray-700 dark:text-gray-200" href="/">{{ site.title }}</a>
|
||||
<a class="text-gray-700 dark:text-gray-200" href="/">{{ meta.siteName }}</a>
|
||||
</h1>
|
||||
{% render "partials/nav/menu.liquid", page: page, nav: nav %}
|
||||
</div>
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
layout: main
|
||||
schema: blog
|
||||
---
|
||||
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
|
||||
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
|
||||
<article class="h-entry" data-pagefind-body>
|
||||
{% if link %}
|
||||
<a class="no-underline" href="{{ link }}">
|
||||
|
@ -13,7 +14,7 @@ layout: main
|
|||
{% else %}
|
||||
<h2 class="p-name text-xl md:text-2xl font-black leading-tight dark:text-gray-200 pt-8" data-pagefind-meta="title">{{ title }}</h2>
|
||||
{% endif %}
|
||||
<span class="p-author h-card hidden">{{ site.title }}</span>
|
||||
<span class="p-author h-card hidden">{{ meta.author }}</span>
|
||||
<time class="mt-2 mb-6 block text-sm dt-published" datetime="{{ date }}">{{ date | readableDate }}</time>
|
||||
<div class="p-summary hidden">{{ post_excerpt | markdown }}</div>
|
||||
<div class="e-content prose dark:prose-invert hover:prose-a:text-blue-800 dark:hover:prose-a:text-blue-200 max-w-full text-gray-800 dark:text-white">
|
||||
|
@ -22,5 +23,5 @@ layout: main
|
|||
</article>
|
||||
{% render "partials/post-tags.liquid", tags: tags %}
|
||||
{% render "partials/webmentions/container.liquid", webmentions: webmentions, page: page %}
|
||||
{% render "partials/author.liquid", site: site %}
|
||||
{% render "partials/author.liquid", meta: meta %}
|
||||
{% render "partials/popular-posts.liquid", posts: collections.posts, analytics: analytics %}
|
15
src/_includes/schemas/base-schema.liquid
Normal file
15
src/_includes/schemas/base-schema.liquid
Normal file
|
@ -0,0 +1,15 @@
|
|||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "WebSite",
|
||||
"@id": "{{ meta.url }}#website",
|
||||
"url": "{{ meta.url }}",
|
||||
"name": "{{ meta.siteName }}",
|
||||
"description": "{{ meta.siteDescription }}",
|
||||
"inLanguage": "{{ meta.locale }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
27
src/_includes/schemas/blogpost-schema.liquid
Normal file
27
src/_includes/schemas/blogpost-schema.liquid
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage"
|
||||
},
|
||||
"isPartOf": {
|
||||
"@id": "{{ meta.url }}#website"
|
||||
},
|
||||
"@id": "{{ page.url }}",
|
||||
"headline": "{{ page.title or meta.siteName }}",
|
||||
"description": "{% if page.description %}{{ page.description }}{% else %}{{ meta.siteDescription }}{% endif %}",
|
||||
"image": "{% if page.image %}{{ page.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>
|
Reference in a new issue