From e327e44f1dc52e810b30079be51cb8c2568f4751 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Fri, 25 Oct 2024 12:52:20 -0700 Subject: [PATCH] chore: cleanup --- .eleventy.js | 4 - package-lock.json | 4 +- package.json | 2 +- src/{pages => }/feeds/json/all.liquid | 0 src/{pages => }/feeds/json/books.liquid | 0 src/{pages => }/feeds/json/links.liquid | 0 src/{pages => }/feeds/json/movies.liquid | 0 src/{pages => }/feeds/json/posts.liquid | 0 src/{pages/data => feeds}/opml.liquid | 0 src/{pages => }/feeds/releases.liquid | 0 src/{pages => }/feeds/rss/all.liquid | 0 src/{pages => }/feeds/rss/books.liquid | 0 src/{pages => }/feeds/rss/links.liquid | 0 src/{pages => }/feeds/rss/movies.liquid | 0 src/{pages => }/feeds/rss/posts.liquid | 0 src/{pages => }/feeds/rss/syndication.liquid | 0 src/includes/base.liquid | 85 +++++++------------ src/includes/default.liquid | 7 -- src/includes/main.liquid | 14 --- src/includes/page.liquid | 4 - src/includes/partials/metadata.liquid | 53 ++++++++++++ src/{pages => }/meta/robots.liquid | 0 src/{pages => }/meta/webfinger.json.liquid | 0 src/pages/{dynamic => }/blogroll.html | 1 - src/pages/{dynamic => }/books/index.html | 3 +- src/pages/{dynamic => }/books/year.html | 1 - src/pages/{dynamic => }/index.html | 1 - src/pages/{dynamic => }/links.html | 1 - src/pages/{dynamic => }/music/concerts.html | 1 - src/pages/{dynamic => }/music/index.html | 1 - src/pages/{dynamic => }/music/this-month.html | 1 - src/pages/{dynamic => }/page.html | 6 +- src/pages/pages.json | 3 + src/pages/{dynamic => }/posts/index.html | 1 - src/pages/{dynamic => }/posts/post.html | 1 - .../watching/favorites/movies.html | 1 - .../watching/favorites/shows.html | 1 - src/pages/{dynamic => }/watching/index.html | 3 +- 38 files changed, 93 insertions(+), 106 deletions(-) rename src/{pages => }/feeds/json/all.liquid (100%) rename src/{pages => }/feeds/json/books.liquid (100%) rename src/{pages => }/feeds/json/links.liquid (100%) rename src/{pages => }/feeds/json/movies.liquid (100%) rename src/{pages => }/feeds/json/posts.liquid (100%) rename src/{pages/data => feeds}/opml.liquid (100%) rename src/{pages => }/feeds/releases.liquid (100%) rename src/{pages => }/feeds/rss/all.liquid (100%) rename src/{pages => }/feeds/rss/books.liquid (100%) rename src/{pages => }/feeds/rss/links.liquid (100%) rename src/{pages => }/feeds/rss/movies.liquid (100%) rename src/{pages => }/feeds/rss/posts.liquid (100%) rename src/{pages => }/feeds/rss/syndication.liquid (100%) delete mode 100644 src/includes/default.liquid delete mode 100644 src/includes/main.liquid delete mode 100644 src/includes/page.liquid create mode 100644 src/includes/partials/metadata.liquid rename src/{pages => }/meta/robots.liquid (100%) rename src/{pages => }/meta/webfinger.json.liquid (100%) rename src/pages/{dynamic => }/blogroll.html (99%) rename src/pages/{dynamic => }/books/index.html (97%) rename src/pages/{dynamic => }/books/year.html (98%) rename src/pages/{dynamic => }/index.html (94%) rename src/pages/{dynamic => }/links.html (98%) rename src/pages/{dynamic => }/music/concerts.html (99%) rename src/pages/{dynamic => }/music/index.html (99%) rename src/pages/{dynamic => }/music/this-month.html (98%) rename src/pages/{dynamic => }/page.html (74%) create mode 100644 src/pages/pages.json rename src/pages/{dynamic => }/posts/index.html (97%) rename src/pages/{dynamic => }/posts/post.html (99%) rename src/pages/{dynamic => }/watching/favorites/movies.html (97%) rename src/pages/{dynamic => }/watching/favorites/shows.html (97%) rename src/pages/{dynamic => }/watching/index.html (98%) diff --git a/.eleventy.js b/.eleventy.js index 381ad0e6..8d3263b4 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -22,11 +22,8 @@ const appVersion = require("./package.json").version; export default async function (eleventyConfig) { eleventyConfig.addPlugin(syntaxHighlight); eleventyConfig.addPlugin(tablerIcons); - if (process.env.ELEVENTY_PRODUCTION) eleventyConfig.addPlugin(cssConfig); - eleventyConfig.setServerOptions({ domdiff: false }); - eleventyConfig.setWatchThrottleWaitTime(200); eleventyConfig.setQuietMode(true); eleventyConfig.configureErrorReporting({ allowMissingExtensions: true }); eleventyConfig.setLiquidOptions({ @@ -105,7 +102,6 @@ export default async function (eleventyConfig) { }); return { - passthroughFileCopy: true, dir: { input: "src", includes: "includes", diff --git a/package-lock.json b/package-lock.json index 3bac0353..7a36775a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "1.8.0", + "version": "1.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "1.8.0", + "version": "1.8.1", "license": "MIT", "dependencies": { "@cdransf/api-text": "^1.5.0", diff --git a/package.json b/package.json index 49f0c1ca..143b77f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "1.8.0", + "version": "1.8.1", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "engines": { diff --git a/src/pages/feeds/json/all.liquid b/src/feeds/json/all.liquid similarity index 100% rename from src/pages/feeds/json/all.liquid rename to src/feeds/json/all.liquid diff --git a/src/pages/feeds/json/books.liquid b/src/feeds/json/books.liquid similarity index 100% rename from src/pages/feeds/json/books.liquid rename to src/feeds/json/books.liquid diff --git a/src/pages/feeds/json/links.liquid b/src/feeds/json/links.liquid similarity index 100% rename from src/pages/feeds/json/links.liquid rename to src/feeds/json/links.liquid diff --git a/src/pages/feeds/json/movies.liquid b/src/feeds/json/movies.liquid similarity index 100% rename from src/pages/feeds/json/movies.liquid rename to src/feeds/json/movies.liquid diff --git a/src/pages/feeds/json/posts.liquid b/src/feeds/json/posts.liquid similarity index 100% rename from src/pages/feeds/json/posts.liquid rename to src/feeds/json/posts.liquid diff --git a/src/pages/data/opml.liquid b/src/feeds/opml.liquid similarity index 100% rename from src/pages/data/opml.liquid rename to src/feeds/opml.liquid diff --git a/src/pages/feeds/releases.liquid b/src/feeds/releases.liquid similarity index 100% rename from src/pages/feeds/releases.liquid rename to src/feeds/releases.liquid diff --git a/src/pages/feeds/rss/all.liquid b/src/feeds/rss/all.liquid similarity index 100% rename from src/pages/feeds/rss/all.liquid rename to src/feeds/rss/all.liquid diff --git a/src/pages/feeds/rss/books.liquid b/src/feeds/rss/books.liquid similarity index 100% rename from src/pages/feeds/rss/books.liquid rename to src/feeds/rss/books.liquid diff --git a/src/pages/feeds/rss/links.liquid b/src/feeds/rss/links.liquid similarity index 100% rename from src/pages/feeds/rss/links.liquid rename to src/feeds/rss/links.liquid diff --git a/src/pages/feeds/rss/movies.liquid b/src/feeds/rss/movies.liquid similarity index 100% rename from src/pages/feeds/rss/movies.liquid rename to src/feeds/rss/movies.liquid diff --git a/src/pages/feeds/rss/posts.liquid b/src/feeds/rss/posts.liquid similarity index 100% rename from src/pages/feeds/rss/posts.liquid rename to src/feeds/rss/posts.liquid diff --git a/src/pages/feeds/rss/syndication.liquid b/src/feeds/rss/syndication.liquid similarity index 100% rename from src/pages/feeds/rss/syndication.liquid rename to src/feeds/rss/syndication.liquid diff --git a/src/includes/base.liquid b/src/includes/base.liquid index d5f2a3f0..8f69ca9e 100644 --- a/src/includes/base.liquid +++ b/src/includes/base.liquid @@ -1,66 +1,33 @@ -{%- assign fullUrl = globals.url | append: page.url -%} -{%- assign pageTitle = globals.site_name -%} -{%- assign pageDescription = globals.site_description -%} - -{%- 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 '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 page.description -%} - {%- assign pageDescription = page.description -%} -{%- elsif description -%} - {%- assign pageDescription = description -%} -{%- endif -%} - -{%- assign ogImage = globals.cdn_url | append: globals.avatar -%} - -{%- case schema -%} - {%- 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 -%} -{%- endcase -%} - -{%- assign escapedPageDescription = pageDescription | escape -%} +{%- capture updateTime -%} + {%- if updated == "now" -%} + {{ 'now' | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }} + {%- elsif page.updated -%} + {{ page.updated | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }} + {%- endif -%} +{%- endcapture -%} - {{ pageTitle }} + - - - - - - - - + {% render "partials/metadata.liquid", + globals:globals, + schema:schema, + title:title, + page:page, + post:post, + year:year, + music:music, + books:books, + featuredMovie:featuredMovie, + featuredShow:featuredShow, + featuredBook:featuredBook, + %} @@ -92,6 +59,14 @@ metaColorScheme.setAttribute('content', themeToSet); })(); - {{ content }} +
+
+ {% render "partials/header.liquid", globals:globals, page:page, nav:nav %} +
+ {{ content }} +
+
+ {% render "partials/footer.liquid", page:page, nav:nav, updated:updateTime %} +
\ No newline at end of file diff --git a/src/includes/default.liquid b/src/includes/default.liquid deleted file mode 100644 index 1426c149..00000000 --- a/src/includes/default.liquid +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: main ---- -{% render "partials/header.liquid", globals: globals, page: page, nav: nav %} -
- {{ content }} -
\ No newline at end of file diff --git a/src/includes/main.liquid b/src/includes/main.liquid deleted file mode 100644 index ae4f62be..00000000 --- a/src/includes/main.liquid +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: base ---- -{%- capture updateTime -%} - {%- if updated == "now" -%} - {{ 'now' | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }} - {%- elsif page.updated -%} - {{ page.updated | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }} - {%- endif -%} -{%- endcapture -%} -
-
{{ content }}
- {% render "partials/footer.liquid", page:page, nav:nav, updated:updateTime %} -
\ No newline at end of file diff --git a/src/includes/page.liquid b/src/includes/page.liquid deleted file mode 100644 index f12b478c..00000000 --- a/src/includes/page.liquid +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: default ---- -{{ content | markdown }} \ No newline at end of file diff --git a/src/includes/partials/metadata.liquid b/src/includes/partials/metadata.liquid new file mode 100644 index 00000000..995e8471 --- /dev/null +++ b/src/includes/partials/metadata.liquid @@ -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 -%} + +{{ pageTitle }} + + + + + + + \ No newline at end of file diff --git a/src/pages/meta/robots.liquid b/src/meta/robots.liquid similarity index 100% rename from src/pages/meta/robots.liquid rename to src/meta/robots.liquid diff --git a/src/pages/meta/webfinger.json.liquid b/src/meta/webfinger.json.liquid similarity index 100% rename from src/pages/meta/webfinger.json.liquid rename to src/meta/webfinger.json.liquid diff --git a/src/pages/dynamic/blogroll.html b/src/pages/blogroll.html similarity index 99% rename from src/pages/dynamic/blogroll.html rename to src/pages/blogroll.html index 2fa26169..26f390db 100644 --- a/src/pages/dynamic/blogroll.html +++ b/src/pages/blogroll.html @@ -1,6 +1,5 @@ --- title: Blogroll -layout: page permalink: /blogroll.html description: These are awesome blogs that I enjoy and you may enjoy too. --- diff --git a/src/pages/dynamic/books/index.html b/src/pages/books/index.html similarity index 97% rename from src/pages/dynamic/books/index.html rename to src/pages/books/index.html index 2580e4f4..e7ba203a 100644 --- a/src/pages/dynamic/books/index.html +++ b/src/pages/books/index.html @@ -1,7 +1,6 @@ --- -title: Currently reading / Books +title: Currently reading description: Here's what I'm reading at the moment. -layout: default permalink: "/books/index.html" updated: "now" schema: books diff --git a/src/pages/dynamic/books/year.html b/src/pages/books/year.html similarity index 98% rename from src/pages/dynamic/books/year.html rename to src/pages/books/year.html index 6daf01e1..12952f1c 100644 --- a/src/pages/dynamic/books/year.html +++ b/src/pages/books/year.html @@ -1,5 +1,4 @@ --- -layout: default pagination: data: books.years size: 1 diff --git a/src/pages/dynamic/index.html b/src/pages/index.html similarity index 94% rename from src/pages/dynamic/index.html rename to src/pages/index.html index b5ae6315..78ca1566 100644 --- a/src/pages/dynamic/index.html +++ b/src/pages/index.html @@ -1,5 +1,4 @@ --- -layout: default permalink: / --- {% render "partials/home/intro.liquid" intro:globals.intro, nowPlaying:nowPlaying.content %} diff --git a/src/pages/dynamic/links.html b/src/pages/links.html similarity index 98% rename from src/pages/dynamic/links.html rename to src/pages/links.html index 1622b0a6..94023ca7 100644 --- a/src/pages/dynamic/links.html +++ b/src/pages/links.html @@ -1,7 +1,6 @@ --- title: Links description: These are links I've liked or otherwise found interesting. They're all added manually, after having been read and, I suppose, properly considered. -layout: default pagination: data: links size: 30 diff --git a/src/pages/dynamic/music/concerts.html b/src/pages/music/concerts.html similarity index 99% rename from src/pages/dynamic/music/concerts.html rename to src/pages/music/concerts.html index 6d3bfb4c..d0dec03d 100644 --- a/src/pages/dynamic/music/concerts.html +++ b/src/pages/music/concerts.html @@ -1,7 +1,6 @@ --- title: Concerts description: These are concerts I've attended (not all of them — just the ones I could remember or glean from emails, photo metadata et al). -layout: default pagination: data: concerts size: 30 diff --git a/src/pages/dynamic/music/index.html b/src/pages/music/index.html similarity index 99% rename from src/pages/dynamic/music/index.html rename to src/pages/music/index.html index 4bb709fc..9aa3bd3a 100644 --- a/src/pages/dynamic/music/index.html +++ b/src/pages/music/index.html @@ -1,7 +1,6 @@ --- title: Music description: This is everything I've been listening to recently — it's collected in a database as I listen to it and displayed here. -layout: default permalink: "/music/index.html" updated: "now" schema: music-index diff --git a/src/pages/dynamic/music/this-month.html b/src/pages/music/this-month.html similarity index 98% rename from src/pages/dynamic/music/this-month.html rename to src/pages/music/this-month.html index b5285aa8..f7e9e0a1 100644 --- a/src/pages/dynamic/music/this-month.html +++ b/src/pages/music/this-month.html @@ -1,7 +1,6 @@ --- title: This month description: This is everything I've been listening to this month — it's collected in a database as I listen to it and displayed here. -layout: default permalink: "/music/this-month/index.html" updated: "now" image: music.month.artists[0].image diff --git a/src/pages/dynamic/page.html b/src/pages/page.html similarity index 74% rename from src/pages/dynamic/page.html rename to src/pages/page.html index b82dcdea..779e8b12 100644 --- a/src/pages/dynamic/page.html +++ b/src/pages/page.html @@ -1,14 +1,12 @@ --- -layout: default pagination: data: pages size: 1 alias: page -title: "{{ page.title }}" description: "{{ page.description }}" permalink: "{{ page.permalink }}/index.html" image: "{{ page.open_graph_image | prepend: globals.cdn_url | default: globals.avatar }}" -updated: {{ page.updated | default: null }} +updated: "{{ page.updated | default: null }}" schema: page --- -{% render "partials/blocks/index.liquid", blocks:page.blocks, globals:globals %} +{% render "partials/blocks/index.liquid", blocks:page.blocks, globals:globals %} \ No newline at end of file diff --git a/src/pages/pages.json b/src/pages/pages.json new file mode 100644 index 00000000..9988fb1e --- /dev/null +++ b/src/pages/pages.json @@ -0,0 +1,3 @@ +{ + "layout": "base.liquid" +} \ No newline at end of file diff --git a/src/pages/dynamic/posts/index.html b/src/pages/posts/index.html similarity index 97% rename from src/pages/dynamic/posts/index.html rename to src/pages/posts/index.html index e5fda011..24d497cf 100644 --- a/src/pages/dynamic/posts/index.html +++ b/src/pages/posts/index.html @@ -1,6 +1,5 @@ --- title: All posts -layout: default pagination: data: posts size: 8 diff --git a/src/pages/dynamic/posts/post.html b/src/pages/posts/post.html similarity index 99% rename from src/pages/dynamic/posts/post.html rename to src/pages/posts/post.html index 76c0eec0..c1ec50c2 100644 --- a/src/pages/dynamic/posts/post.html +++ b/src/pages/posts/post.html @@ -1,5 +1,4 @@ --- -layout: default pagination: data: posts size: 1 diff --git a/src/pages/dynamic/watching/favorites/movies.html b/src/pages/watching/favorites/movies.html similarity index 97% rename from src/pages/dynamic/watching/favorites/movies.html rename to src/pages/watching/favorites/movies.html index 3366e0e9..676e4f55 100644 --- a/src/pages/dynamic/watching/favorites/movies.html +++ b/src/pages/watching/favorites/movies.html @@ -1,7 +1,6 @@ --- title: Favorite movies description: These are my favorite movies. There are many like them, but these are mine. -layout: default pagination: data: movies.favorites size: 24 diff --git a/src/pages/dynamic/watching/favorites/shows.html b/src/pages/watching/favorites/shows.html similarity index 97% rename from src/pages/dynamic/watching/favorites/shows.html rename to src/pages/watching/favorites/shows.html index 56ccc337..5cd10d14 100644 --- a/src/pages/dynamic/watching/favorites/shows.html +++ b/src/pages/watching/favorites/shows.html @@ -1,7 +1,6 @@ --- title: Favorite shows description: These are my favorite shows. There are many like them, but these are mine. -layout: default pagination: data: tv.favorites size: 24 diff --git a/src/pages/dynamic/watching/index.html b/src/pages/watching/index.html similarity index 98% rename from src/pages/dynamic/watching/index.html rename to src/pages/watching/index.html index 597160a1..8bc09216 100644 --- a/src/pages/dynamic/watching/index.html +++ b/src/pages/watching/index.html @@ -1,7 +1,6 @@ --- -title: Watching +title: Currently watching description: Here's all of the TV and movies I've been watching presented in what is (hopefully) an organized fashion. -layout: default permalink: "/watching/index.html" updated: "now" schema: watching