Skip to content

Commit

Permalink
feat: switch to @11ty/eleventy-plugin-rss, bump `eleventy-plugin-ve…
Browse files Browse the repository at this point in the history
…nto` and `@11ty/eleventy` (#260)
  • Loading branch information
uncenter authored Jan 29, 2025
1 parent 9a48b38 commit 6c9c95e
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 183 deletions.
4 changes: 2 additions & 2 deletions config/11ty/filters.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DateTime } from 'luxon';
import stringify from '../json-pretty-stringify.js';
import urlize from '../urlize.js';
import { toAbsoluteUrl } from '../url.js';

const toShortDate = (dateObject) => {
// 10/14/1983
Expand Down Expand Up @@ -53,5 +53,5 @@ export const filters = (eleventyConfig) => {
eleventyConfig.addFilter('stringify', (value) => {
return stringify(value, '\t');
});
eleventyConfig.addFilter('url', urlize);
eleventyConfig.addFilter('toAbsoluteUrl', toAbsoluteUrl);
};
4 changes: 2 additions & 2 deletions config/urlize.js → config/url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import site from '../site.config.js';

export default (path, base) => {
export function toAbsoluteUrl(path, base) {
if (!base) base = new URL(site.url);
return new URL(path, base).href;
};
}
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { collections, filters, shortcodes } from './config/11ty/index.js';

import pluginRSS from '@11ty/eleventy-plugin-rss';
import pluginExternalLinks from '@aloskutov/eleventy-plugin-external-links';
import pluginRSS from '@ryanccn/eleventy-plugin-rss';
import pluginTOC from '@uncenter/eleventy-plugin-toc';
import pluginAutoCacheBuster from 'eleventy-auto-cache-buster';
import pluginIcons from 'eleventy-plugin-icons';
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
},
"dependencies": {
"11ty.ts": "^0.0.5",
"@11ty/eleventy": "3.0.0",
"@11ty/eleventy": "3.0.1-alpha.3",
"@11ty/eleventy-fetch": "^5.0.2",
"@11ty/eleventy-img": "^6.0.1",
"@11ty/eleventy-plugin-rss": "^2.0.3",
"@aloskutov/eleventy-plugin-external-links": "^2.1.1",
"@catppuccin/palette": "^1.7.1",
"@ryanccn/eleventy-plugin-rss": "github:uncenter/ryanccn-eleventy-plugin-rss",
"@shikijs/markdown-it": "1.29.1",
"@shikijs/transformers": "1.29.1",
"@uncenter/eleventy-plugin-toc": "^1.0.3",
Expand All @@ -27,7 +27,7 @@
"eleventy-auto-cache-buster": "^0.7.0",
"eleventy-plugin-icons": "^4.5.1",
"eleventy-plugin-validate": "^0.1.3",
"eleventy-plugin-vento": "^4.0.1",
"eleventy-plugin-vento": "^4.1.1",
"html-minifier": "^4.0.0",
"lightningcss": "^1.29.1",
"linkedom": "^0.18.7",
Expand All @@ -51,6 +51,11 @@
"terser": "^5.37.0",
"zod": "^3.24.1"
},
"pnpm": {
"patchedDependencies": {
"ventojs": "patches/ventojs.patch"
}
},
"devDependencies": {
"@biomejs/biome": "1.9.4"
},
Expand Down
14 changes: 14 additions & 0 deletions patches/ventojs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/esm/src/errors.js b/esm/src/errors.js
index 15ebe973ec2f98600798968cb4f782fa9d7aae02..34610c230a9011c5217b067e1c499f1eec1574a8 100644
--- a/esm/src/errors.js
+++ b/esm/src/errors.js
@@ -11,6 +11,9 @@ export class TemplateError extends VentoBaseError {
this.path = path;
this.source = source;
this.position = position;
+ if (cause) {
+ this.message += `(via ${cause.name})\n`;
+ }
}
}
export class TransformError extends VentoBaseError {
Loading

0 comments on commit 6c9c95e

Please sign in to comment.