From f3faf8feabe4c2c22156ec6227aed95858d8fb81 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Mon, 14 Aug 2023 09:50:29 -0700 Subject: [PATCH] chore: dry up webmentions --- .eleventy.js | 39 ++++++++------- src/_includes/partials/footer.liquid | 2 +- .../partials/{ => nav}/linked-icon.liquid | 0 src/_includes/partials/nav/menu.liquid | 2 +- src/_includes/partials/webmentions.liquid | 49 ------------------- .../partials/webmentions/comments.liquid | 16 ++++++ .../partials/webmentions/container.liquid | 8 +++ .../partials/webmentions/interaction.liquid | 21 ++++++++ src/_includes/post.liquid | 2 +- src/resume.md | 2 +- 10 files changed, 70 insertions(+), 71 deletions(-) rename src/_includes/partials/{ => nav}/linked-icon.liquid (100%) delete mode 100644 src/_includes/partials/webmentions.liquid create mode 100644 src/_includes/partials/webmentions/comments.liquid create mode 100644 src/_includes/partials/webmentions/container.liquid create mode 100644 src/_includes/partials/webmentions/interaction.liquid diff --git a/.eleventy.js b/.eleventy.js index 6835dd78..2c787f5d 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -37,6 +37,9 @@ module.exports = function (eleventyConfig) { // quiet build output eleventyConfig.setQuietMode(true) + eleventyConfig.setLiquidOptions({ + jsTruthy: true, + }) // tailwind watches eleventyConfig.addWatchTarget('./tailwind.config.js') @@ -49,24 +52,6 @@ module.exports = function (eleventyConfig) { // shortcodes eleventyConfig.addShortcode('version', () => now) - // filters - Object.keys(filters).forEach((filterName) => { - eleventyConfig.addLiquidFilter(filterName, filters[filterName]) - }) - - // date filters - Object.keys(dateFilters).forEach((filterName) => { - eleventyConfig.addLiquidFilter(filterName, dateFilters[filterName]) - }) - - // media filters - Object.keys(mediaFilters).forEach((filterName) => { - eleventyConfig.addLiquidFilter(filterName, mediaFilters[filterName]) - }) - - // css filters - eleventyConfig.addFilter('cssmin', (code) => new CleanCSS({}).minify(code).styles) - // enable merging of tags eleventyConfig.setDataDeepMerge(true) @@ -107,6 +92,24 @@ module.exports = function (eleventyConfig) { return md.render(content) }) + // filters + Object.keys(filters).forEach((filterName) => { + eleventyConfig.addLiquidFilter(filterName, filters[filterName]) + }) + + // date filters + Object.keys(dateFilters).forEach((filterName) => { + eleventyConfig.addLiquidFilter(filterName, dateFilters[filterName]) + }) + + // media filters + Object.keys(mediaFilters).forEach((filterName) => { + eleventyConfig.addLiquidFilter(filterName, mediaFilters[filterName]) + }) + + // css filters + eleventyConfig.addFilter('cssmin', (code) => new CleanCSS({}).minify(code).styles) + // image shortcode eleventyConfig.addShortcode('image', async function (src, alt, css, sizes, loading) { let metadata = await Image(src, { diff --git a/src/_includes/partials/footer.liquid b/src/_includes/partials/footer.liquid index d36adc10..3a3eecab 100644 --- a/src/_includes/partials/footer.liquid +++ b/src/_includes/partials/footer.liquid @@ -1,7 +1,7 @@