old website
This commit is contained in:
commit
218487dc22
557 changed files with 7054 additions and 0 deletions
56
eleventy.config.js
Normal file
56
eleventy.config.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
import markdownIt from "markdown-it";
|
||||
import markdownItAnchor from "markdown-it-anchor";
|
||||
import { formatISO9075 } from "date-fns";
|
||||
import { format } from "date-fns";
|
||||
|
||||
export default async function(eleventyConfig) {
|
||||
// Options for the `markdown-it` library
|
||||
const markdownItOptions = {
|
||||
html: true,
|
||||
}
|
||||
|
||||
// Options for the `markdown-it-anchor` library
|
||||
const markdownItAnchorOptions = {
|
||||
permalink: true, permalinkBefore: true, permalinkSymbol: '#'
|
||||
}
|
||||
|
||||
const markdownLib = markdownIt(markdownItOptions).use(
|
||||
markdownItAnchor,
|
||||
markdownItAnchorOptions
|
||||
);
|
||||
eleventyConfig.addFilter("firstUrlSegment", function(permalink) {
|
||||
if (typeof permalink === "string") {
|
||||
permalink = permalink.replace(/^\/+|\/+$/g, '');
|
||||
const segments = permalink.split('/');
|
||||
return segments.length > 0 ? segments[0] : '';
|
||||
}
|
||||
return '';
|
||||
});
|
||||
eleventyConfig.addFilter("ISO", (dateObj) => {
|
||||
return formatISO9075(dateObj);
|
||||
});
|
||||
eleventyConfig.addFilter("humanReadable", (dateObj) => {
|
||||
return format(dateObj, ("LLLL d, yyyy"));
|
||||
});
|
||||
eleventyConfig.setLibrary("md", markdownLib);
|
||||
|
||||
// Set directories to pass through to the _site folder
|
||||
eleventyConfig.addPassthroughCopy("./_src/assets/");
|
||||
|
||||
// Watch scss folder for changes
|
||||
eleventyConfig.addWatchTarget("./_src/assets/");
|
||||
|
||||
// Open a browser window on --watch
|
||||
eleventyConfig.setBrowserSyncConfig({
|
||||
open: true,
|
||||
});
|
||||
};
|
||||
|
||||
// This named export is optional
|
||||
export const config = {
|
||||
dir: {
|
||||
input: "_src",
|
||||
output: "_site"
|
||||
}
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue