diff --git a/.eleventy.js b/.eleventy.js index 7290a48a..9abf27fc 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,7 +1,6 @@ const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight') const heroIcons = require('eleventy-plugin-heroicons') const pluginUnfurl = require('eleventy-plugin-unfurl') -const pluginCleanUrls = require('@inframanufaktur/eleventy-plugin-clean-urls') const markdownIt = require('markdown-it') const markdownItAnchor = require('markdown-it-anchor') const markdownItFootnote = require('markdown-it-footnote') @@ -14,21 +13,20 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(syntaxHighlight) eleventyConfig.addPlugin(heroIcons) eleventyConfig.addPlugin(pluginUnfurl) - eleventyConfig.addPlugin(pluginCleanUrls) // filters Object.keys(filters).forEach((filterName) => { - eleventyConfig.addFilter(filterName, filters[filterName]) + eleventyConfig.addLiquidFilter(filterName, filters[filterName]) }) // date filters Object.keys(dateFilters).forEach((filterName) => { - eleventyConfig.addFilter(filterName, dateFilters[filterName]) + eleventyConfig.addLiquidFilter(filterName, dateFilters[filterName]) }) // media filters Object.keys(mediaFilters).forEach((filterName) => { - eleventyConfig.addFilter(filterName, mediaFilters[filterName]) + eleventyConfig.addLiquidFilter(filterName, mediaFilters[filterName]) }) // enable merging of tags @@ -37,7 +35,6 @@ module.exports = function (eleventyConfig) { // copy these static files to _site folder eleventyConfig.addPassthroughCopy('src/assets') eleventyConfig.addPassthroughCopy('src/manifest.json') - eleventyConfig.addPassthroughCopy('src/.well-known') // create excerpts eleventyConfig.setFrontMatterParsingOptions({ diff --git a/.gitignore b/.gitignore index b5b6b5ef..64dcdeb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +# build output _site node_modules -.DS_Store +.env.local .cache + +# system files +.DS_Store diff --git a/config/dateFilters.js b/config/dateFilters.js index 4b29c3d7..83ddcf88 100644 --- a/config/dateFilters.js +++ b/config/dateFilters.js @@ -35,6 +35,6 @@ module.exports = { if (month.length < 2) month = '0' + month if (day.length < 2) day = '0' + day - return [year, month, day].join('-') + return [month, day, year].join('.') }, } diff --git a/package.json b/package.json index 17cdc471..5f19226c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "dependencies": { "@11ty/eleventy-fetch": "^3.0.0", "@11ty/eleventy-img": "^3.0.0", - "@inframanufaktur/eleventy-plugin-clean-urls": "^1.0.2", "@remy/webmention": "^1.4.5", "@tailwindcss/typography": "^0.5.1", "autoprefixer": "^10.4.2", diff --git a/src/_data/now.js b/src/_data/now.js index f1a427c9..1d884822 100644 --- a/src/_data/now.js +++ b/src/_data/now.js @@ -1,7 +1,7 @@ const EleventyFetch = require('@11ty/eleventy-fetch') module.exports = async function () { - const url = 'https://coryd.dev/api/now?endpoints=artists,albums,books,movies,tv' + const url = 'https://utils.coryd.dev/api/now?endpoints=artists,albums,books,movies,tv' const res = EleventyFetch(url, { duration: '3h', type: 'json', diff --git a/src/_data/nowplaying.js b/src/_data/nowplaying.js index b7654b1f..1f174637 100644 --- a/src/_data/nowplaying.js +++ b/src/_data/nowplaying.js @@ -1,7 +1,7 @@ const EleventyFetch = require('@11ty/eleventy-fetch') module.exports = async function () { - const url = 'https://coryd.dev/api/music?limit=1&period=7day' + const url = 'https://utils.coryd.dev/api/music?limit=1&period=7day' const res = EleventyFetch(url, { duration: '10m', type: 'json', diff --git a/src/_data/webmentions.js b/src/_data/webmentions.js new file mode 100644 index 00000000..a5d459d6 --- /dev/null +++ b/src/_data/webmentions.js @@ -0,0 +1,13 @@ +const EleventyFetch = require('@11ty/eleventy-fetch') + +module.exports = async function () { + const url = 'https://utils.coryd.dev/api/webmentions' + const res = EleventyFetch(url, { + duration: '1d', + type: 'json', + }) + const webmentions = await res + return { + mentions: webmentions.children, + } +} diff --git a/src/_includes/author.liquid b/src/_includes/author.liquid index 66d3144e..c4c1dbf3 100644 --- a/src/_includes/author.liquid +++ b/src/_includes/author.liquid @@ -1,4 +1,4 @@ -<div class="mt-16 py-8 border-t-2 flex justify-between items-center"> +<div class="mt-12 py-8 border-t-2 flex justify-between items-center"> <div class="flex items-center flex-1"> <img class="inline-block h-20 mr-2" src="/assets/img/avatar.webp" alt={{ site.name }} /> <span class="text-lg font-medium">{{ site.name }}</span> diff --git a/src/_includes/now.liquid b/src/_includes/now.liquid index 3b430e50..03b355bb 100644 --- a/src/_includes/now.liquid +++ b/src/_includes/now.liquid @@ -16,7 +16,7 @@ layout: main <p class="my-2"><span class="icon-inline">{% heroicon "solid" "code" "Code" "width=20 height=20" %}</span> Working at <a href="https://hashicorp.com">HashiCorp</a></p> <p class="my-2"> <span class="icon-inline"> - <svg class="fill-white w-5" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>NBA</title><path d="M9.19 0a2.486 2.486 0 0 0-2.485 2.484v19.029A2.488 2.488 0 0 0 9.19 24h5.615a2.493 2.493 0 0 0 2.49-2.487V2.484A2.488 2.488 0 0 0 14.81 0zm0 .584h3.21c-.62.237-.707.508-.73 1.366-.105.01-.325-.087-.25.434 0 0 .043.346.18.286-.133.918.023.99-.93 1.031l-.047.067c-.95.093-1.25-.027-2.05 1.603 0 0-.207.505-.268.714-.197.415-.674 1.328-.819 1.919-.046.2-.14.264-.01.553.185.417-.124.527.95.496V9.3s-.286.247-.346.398c-.061.147-.226.89-.22 1.237.019.917.767 1.683.992 2.597l.492.07c.282.634 1.495 2.355 1.743 2.582.057.159.365.355.545.551.149.141 1.025 1.1 2.054 1.692-.007-.001.164.344.249.618-.342.275.32.777.52 1.609.012.107-.19.222.114.495-.022 1.256-.402 1.918.241 2.266H9.191a1.9 1.9 0 0 1-1.9-1.901V2.486a1.9 1.9 0 0 1 1.9-1.902zm3.804.002h1.815a1.9 1.9 0 0 1 1.897 1.898v9.193a1.653 1.653 0 0 0-.22-.397c0-.255-.272-.249-.346-.344-.07-.081.067-.128-.407-.235-.09-.05-.158-.747-.158-.747-.07-.447-.229-.754-.467-1.227-.12-.243-.177-1.001-.305-1.386.071-1.767-.493-2.28-.95-2.569-.174-.11-.262-.191-.433-.29l-.005-.082c-.133-.126-.402-.264-.623-.362-.068-.07-.037-.22.01-.276.15-.02.348-.356.513-.703.129.009.174-.118.214-.19.138-.222.288-.413.096-.542.435-.777.154-1.301-.08-1.321-.095-.195-.26-.316-.551-.42zm.551 6.338c.06.319.34 1.929.456 2.187.123.259.535 1.05.73 1.54a1.69 1.69 0 0 0-1.294 1.646 1.692 1.692 0 0 0 1.693 1.691 1.692 1.692 0 0 0 1.576-1.066v8.59a1.887 1.887 0 0 1-1.598 1.877h-.017c.833-.502.319-1.46.16-2.022-.012-.033.014-.074.026-.1.045-.08-.045-.257-.045-.257-.098-.09-.127-.561-.182-.772-.089-.358.157-.971.157-1.18 0-.206-.156-.491-.445-.858-.069-.078-.276-1.86-.462-2.313-.258-.623-.339-.526-.64-1.266-.24-.525-.055-1.295-.59-3.085.005.006.12-.113.12-.113s-.422-1.55-.561-1.975c-.14-.426-.385-.456-.385-.456s.002-.172.012-.216c.02-.07.516-1.367.558-1.407.001-.03.717-.514.731-.445Z"/></svg> + <svg class="fill-gray-800 dark:fill-white w-5" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>NBA</title><path d="M9.19 0a2.486 2.486 0 0 0-2.485 2.484v19.029A2.488 2.488 0 0 0 9.19 24h5.615a2.493 2.493 0 0 0 2.49-2.487V2.484A2.488 2.488 0 0 0 14.81 0zm0 .584h3.21c-.62.237-.707.508-.73 1.366-.105.01-.325-.087-.25.434 0 0 .043.346.18.286-.133.918.023.99-.93 1.031l-.047.067c-.95.093-1.25-.027-2.05 1.603 0 0-.207.505-.268.714-.197.415-.674 1.328-.819 1.919-.046.2-.14.264-.01.553.185.417-.124.527.95.496V9.3s-.286.247-.346.398c-.061.147-.226.89-.22 1.237.019.917.767 1.683.992 2.597l.492.07c.282.634 1.495 2.355 1.743 2.582.057.159.365.355.545.551.149.141 1.025 1.1 2.054 1.692-.007-.001.164.344.249.618-.342.275.32.777.52 1.609.012.107-.19.222.114.495-.022 1.256-.402 1.918.241 2.266H9.191a1.9 1.9 0 0 1-1.9-1.901V2.486a1.9 1.9 0 0 1 1.9-1.902zm3.804.002h1.815a1.9 1.9 0 0 1 1.897 1.898v9.193a1.653 1.653 0 0 0-.22-.397c0-.255-.272-.249-.346-.344-.07-.081.067-.128-.407-.235-.09-.05-.158-.747-.158-.747-.07-.447-.229-.754-.467-1.227-.12-.243-.177-1.001-.305-1.386.071-1.767-.493-2.28-.95-2.569-.174-.11-.262-.191-.433-.29l-.005-.082c-.133-.126-.402-.264-.623-.362-.068-.07-.037-.22.01-.276.15-.02.348-.356.513-.703.129.009.174-.118.214-.19.138-.222.288-.413.096-.542.435-.777.154-1.301-.08-1.321-.095-.195-.26-.316-.551-.42zm.551 6.338c.06.319.34 1.929.456 2.187.123.259.535 1.05.73 1.54a1.69 1.69 0 0 0-1.294 1.646 1.692 1.692 0 0 0 1.693 1.691 1.692 1.692 0 0 0 1.576-1.066v8.59a1.887 1.887 0 0 1-1.598 1.877h-.017c.833-.502.319-1.46.16-2.022-.012-.033.014-.074.026-.1.045-.08-.045-.257-.045-.257-.098-.09-.127-.561-.182-.772-.089-.358.157-.971.157-1.18 0-.206-.156-.491-.445-.858-.069-.078-.276-1.86-.462-2.313-.258-.623-.339-.526-.64-1.266-.24-.525-.055-1.295-.59-3.085.005.006.12-.113.12-.113s-.422-1.55-.561-1.975c-.14-.426-.385-.456-.385-.456s.002-.172.012-.216c.02-.07.516-1.367.558-1.407.001-.03.717-.514.731-.445Z"/></svg> </span> Rooting for the <a href="https://lakers.com">Lakers</a>, for better or worse.</p> {{ content }} diff --git a/src/_includes/post.liquid b/src/_includes/post.liquid index 54537322..5423f74f 100644 --- a/src/_includes/post.liquid +++ b/src/_includes/post.liquid @@ -20,5 +20,5 @@ layout: main <div class="prose dark:prose-invert hover:prose-a:text-blue-500 max-w-full text-gray-800 dark:text-white"> {{ content }} </div> - +{% include "webmentions.liquid" %} {% include "author.liquid" %} diff --git a/src/_includes/webmentions.liquid b/src/_includes/webmentions.liquid new file mode 100644 index 00000000..b517069a --- /dev/null +++ b/src/_includes/webmentions.liquid @@ -0,0 +1,61 @@ +{% if webmentions %} + <div class="border-t border-gray-200 mt-12 pt-14 dark:border-gray-700"> + {% assign mentions = webmentions.mentions | webmentionsByUrl: page.url %} + {% if mentions['repost-of'].size > 0 %} + <h2 class="text-lg md:text-xl font-black leading-tight dark:text-gray-200">Reposts</h2> + <div class="flex flex-row items-center mt-4 mb-6"> + <ul class="ml-3 flex flex-row"> + {% for mention in mentions['repost-of'] %} + <li class="-ml-3 inline"> + <a href={{mention.url}}> + <img + src={{mention.author.photo}} + alt={{mention.author.name}} + class="h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all hover:border-primary-500 dark:hover:border-primary-300" + /> + </a> + </li> + {% endfor %} + </ul> + </div> + {% endif %} + {% if mentions['like-of'].size > 0 %} + <h2 class="text-lg md:text-xl font-black leading-tight dark:text-gray-200">Likes</h2> + <div class="flex flex-row items-center mt-4 mb-6"> + <ul class="ml-3 flex flex-row"> + {% for mention in mentions['like-of'] %} + <li class="-ml-3 inline"> + <a href={{mention.url}}> + <img + src={{mention.author.photo}} + alt={{mention.author.name}} + class="h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all hover:border-primary-500 dark:hover:border-primary-300" + /> + </a> + </li> + {% endfor %} + </ul> + </div> + {% endif %} + {% if mentions['in-reply-to'].size > 0 %} + <h2 class="text-lg md:text-xl font-black leading-tight dark:text-gray-200">Comments</h2> + <div class="mt-4 flex flex-col items-center not-prose"> + {% for mention in mentions['in-reply-to'] %} + <div class="border-bottom flex flex-row items-center border-gray-100 pb-4 w-full"> + <a class="group flex flex-row space-between items-center" href={{mention.url}}> + <img + src={{mention.author.photo}} + alt={{mention.author.name}} + class="h-14 w-14 rounded-full border-4 border-white dark:border-gray-900 transition-all group-hover:border-primary-500 dark:group-hover:border-primary-300" + /> + <div class="ml-3"> + <p class="text-sm group-hover:text-primary-500 dark:group-hover:text-primary-300">{{mention.content.text}}</p> + <p class="mt-1 text-xs group-hover:text-primary-500 dark:group-hover:text-primary-300">{{mention.published | isoDateOnly}}</p> + </div> + </a> + </div> + {% endfor %} + </div> + {% endif %} + </div> +{% endif %} diff --git a/src/feeds/webfinger.liquid b/src/feeds/webfinger.liquid new file mode 100644 index 00000000..ca4999c4 --- /dev/null +++ b/src/feeds/webfinger.liquid @@ -0,0 +1,33 @@ +--- +permalink: '.well-known/webfinger' +--- +{ + "subject": "acct:coryd@social.lol", + "aliases": ["https://coryd.dev", "https://social.lol/@coryd", "https://social.lol/users/coryd"], + "links": [ + { + "rel": "http://webfinger.net/rel/avatar", + "type": "image/webp", + "href": "https://coryd.dev/static/images/avatar.webp" + }, + { + "rel": "http://webfinger.net/rel/profile-page", + "type": "text/html", + "href": "https://coryd.dev" + }, + { + "rel": "http://webfinger.net/rel/profile-page", + "type": "text/html", + "href": "https://social.lol/users/coryd" + }, + { + "rel": "self", + "type": "application/activity+json", + "href": "https://social.lol/users/coryd" + }, + { + "rel": "http://ostatus.org/schema/1.0/subscribe", + "template": "social.lol/authorize_interaction?uri={uri}" + } + ] +} diff --git a/yarn.lock b/yarn.lock index cc173e50..b3fd3bfe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -232,19 +232,6 @@ resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg== -"@inframanufaktur/clean-urls@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@inframanufaktur/clean-urls/-/clean-urls-1.0.1.tgz#61c0957b3670f226de3fb5648c1f655e8b9b1e07" - integrity sha512-WCYk+lp0Cu+jts6C3myAuzEwZov7ZjYMNkXjk3RhIU3I5wXrrZQNAn7Si7376MEpTGWEBsVU4rlwW4UU6SKTWA== - -"@inframanufaktur/eleventy-plugin-clean-urls@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@inframanufaktur/eleventy-plugin-clean-urls/-/eleventy-plugin-clean-urls-1.0.2.tgz#75589709ae99dca0781687d1fd5376137b270a4b" - integrity sha512-pdSXyzShC7x0rO0ujjqA7Zeq9n6lLXVYFCAf+Wm9lpAJ0gY0eDMbYqkrqs8GaWwkNAhhpXu/yJUFxiTWdET3Xg== - dependencies: - "@inframanufaktur/clean-urls" "^1.0.1" - linkedom "^0.14.4" - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2364,7 +2351,7 @@ limiter@^1.0.5: resolved "https://registry.yarnpkg.com/limiter/-/limiter-1.1.5.tgz#8f92a25b3b16c6131293a0cc834b4a838a2aa7c2" integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA== -linkedom@^0.14.19, linkedom@^0.14.4: +linkedom@^0.14.19: version "0.14.24" resolved "https://registry.yarnpkg.com/linkedom/-/linkedom-0.14.24.tgz#981610ccd512376739f9fd5e76f48b4033fa5491" integrity sha512-z9DlnDqvTyV0JJQlUqTCRzkElY6Ref4O4w8GXzGuV5vR5M85xnXvo0Dg33DehbhY7lhmDCyZYpecAGApz6zvxA==