yay website
This commit is contained in:
parent
623e26a808
commit
4d44fd94a2
585 changed files with 5066 additions and 0 deletions
51
eleventy.config.js
Normal file
51
eleventy.config.js
Normal file
|
@ -0,0 +1,51 @@
|
|||
import markdownIt from "markdown-it";
|
||||
import markdownItAnchor from "markdown-it-anchor";
|
||||
import { format } from "date-fns";
|
||||
import pluginInlineLinkFavicon from "eleventy-plugin-inline-link-favicon"
|
||||
|
||||
export default async function (eleventyConfig) {
|
||||
|
||||
const markdownItOptions = {
|
||||
html: true
|
||||
};
|
||||
|
||||
const markdownItAnchorOptions = {
|
||||
permalink: true, permalinkBefore: true, permalinkSymbol: '#'
|
||||
};
|
||||
|
||||
const markdownLib = markdownIt(markdownItOptions).use(
|
||||
markdownItAnchor,
|
||||
markdownItAnchorOptions
|
||||
);
|
||||
|
||||
eleventyConfig.setLibrary("md", markdownLib);
|
||||
|
||||
const assets = "./_src/assets/";
|
||||
eleventyConfig.addPassthroughCopy(assets);
|
||||
eleventyConfig.addWatchTarget(assets);
|
||||
|
||||
eleventyConfig.addPlugin(pluginInlineLinkFavicon);
|
||||
|
||||
eleventyConfig.addFilter("firstSegment", url => (typeof url === 'string' ? url.split('/')[1] || '' : ''));
|
||||
|
||||
eleventyConfig.addFilter("sortByFirstDate", items => items.sort((a, b) => new Date(b.data.images[0].date) - new Date(a.data.images[0].date)));
|
||||
|
||||
eleventyConfig.addFilter("ISO", (dateObj) => {
|
||||
return format(dateObj, ("yyyy-LL-dd"));
|
||||
});
|
||||
eleventyConfig.addFilter("readable", (dateObj) => {
|
||||
return format(dateObj, ("LLLL d, yyyy"));
|
||||
});
|
||||
|
||||
eleventyConfig.setBrowserSyncConfig({
|
||||
open: true,
|
||||
});
|
||||
};
|
||||
|
||||
export const config = {
|
||||
dir: {
|
||||
input: "_src",
|
||||
output: "_site"
|
||||
}
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue