-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eleventy.js
85 lines (72 loc) · 2.07 KB
/
.eleventy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import fs from "fs";
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
import pluginSyntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
import markdownIt from "markdown-it";
const markdownOptions = {
html: true,
breaks: true,
linkify: true,
};
const markdownRenderer = markdownIt(markdownOptions);
import EleventyPluginOgImage from "eleventy-plugin-og-image";
export default async function (eleventyConfig) {
// Output directory: _site
// input directory: pages
// Copy `assets/` to `_site`
eleventyConfig.addPassthroughCopy({
"assets/img": "img",
"assets/css": "css",
"assets/js": "js",
"assets/favicon": "favicon",
"assets/manifest.json": "manifest.json",
});
eleventyConfig.setTemplateFormats([
// Templates:
"html",
"njk",
"md",
// Static Assets:
"png",
"jpg",
"svg",
]);
eleventyConfig.addPlugin(pluginSyntaxHighlight);
eleventyConfig.addPlugin(feedPlugin, {
type: "atom",
outputPath: "/feed.xml",
collection: {
name: "post",
limit: 0,
},
metadata: {
title: "Open Web Docs blog",
subtitle:
"Open Web Docs supports web platform documentation for the benefit of web developers & designers worldwide. We are a community of web developers, standards makers, and technology companies that rely on this documentation as critical digital infrastructure, and we work cooperatively to ensure its long-term success and maintenance.",
language: "en",
base: "https://openwebdocs.org/",
author: {
name: "OWD team",
email: "[email protected]",
},
},
});
eleventyConfig.setLibrary("md", markdownRenderer);
eleventyConfig.addPlugin(EleventyPluginOgImage, {
satoriOptions: {
fonts: [
{
name: "WorkSans",
data: fs.readFileSync("assets/fonts/WorkSans-Bold.ttf"),
weight: 700,
style: "bold",
},
],
},
});
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
return {
dir: {
input: "pages",
},
};
}