Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Eleventy 3.0.0 #1239

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading