Skip to content

Commit

Permalink
[WIP] Upgrade to Eleventy 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Dec 26, 2024
1 parent e9a6d31 commit 948b13a
Show file tree
Hide file tree
Showing 25 changed files with 2,341 additions and 1,573 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@
"sort-imports": ["error", {"ignoreDeclarationSort": true}],
"etc/prefer-interface": ["error"],
},
"overrides": [
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
},
},
],
}
File renamed without changes.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
presets: ['@babel/preset-typescript'],
};
40 changes: 21 additions & 19 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
'use strict';

const {EleventyRenderPlugin} = require('@11ty/eleventy');
const {
import {EleventyRenderPlugin} from '@11ty/eleventy';
import {
absoluteUrl,
convertHtmlToAbsoluteUrls,
dateToRfc3339,
getNewestCollectionItemDate,
} = require('@11ty/eleventy-plugin-rss');
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const yaml = require('js-yaml');
} from '@11ty/eleventy-plugin-rss';
import syntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight';
import * as yaml from 'js-yaml';

const componentsPlugin =
require('./source/helpers/components/index.ts').default;
const datesPlugin = require('./source/helpers/dates.ts').default;
const {liquidEngine, markdownEngine} = require('./source/helpers/engines.ts');
const pagesPlugin = require('./source/helpers/pages.ts').default;
const typePlugin = require('./source/helpers/type.ts').default;
const functionPlugin = require('./source/helpers/function.ts').default;
import componentsPlugin from './source/helpers/components/index.ts';
import datesPlugin from './source/helpers/dates.ts';
import {liquidEngine, markdownEngine} from './source/helpers/engines.ts';
import pagesPlugin from './source/helpers/pages.ts';
import typePlugin from './source/helpers/type.ts';
import functionPlugin from './source/helpers/function.ts';

/** @param {import('@11ty/eleventy').UserConfig} eleventyConfig */
module.exports = eleventyConfig => {
/**
* @param {import('@11ty/eleventy').UserConfig} eleventyConfig
* @returns {void}
*/
export default function (eleventyConfig) {
eleventyConfig.addPassthroughCopy('source/assets/dist');
eleventyConfig.addPassthroughCopy('source/assets/img');
eleventyConfig.addPassthroughCopy('source/favicon.ico');
Expand All @@ -35,10 +37,10 @@ module.exports = eleventyConfig => {
eleventyConfig.setLibrary('liquid', liquidEngine);
eleventyConfig.setLibrary('md', markdownEngine);
eleventyConfig.addDataExtension('yml, yaml', contents => yaml.load(contents));
eleventyConfig.addDataExtension('ts', {
parser: filepath => require(filepath),
read: false,
});
// eleventyConfig.addDataExtension('ts', {
// parser: filepath => import(filepath),
// read: false,
// });

// register filters and shortcodes
eleventyConfig.addPlugin(componentsPlugin);
Expand Down Expand Up @@ -75,4 +77,4 @@ module.exports = eleventyConfig => {
layouts: '_layouts',
},
};
};
}
Loading

0 comments on commit 948b13a

Please sign in to comment.