-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.eleventy.js
More file actions
28 lines (25 loc) · 971 Bytes
/
Copy path.eleventy.js
File metadata and controls
28 lines (25 loc) · 971 Bytes
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
import { HtmlBasePlugin } from "@11ty/eleventy";
import QRCode from "qrcode";
export default function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({ "src/assets": "assets" });
eleventyConfig.addPassthroughCopy({ "images": "images" });
eleventyConfig.addPlugin(HtmlBasePlugin);
// Build-time QR code generated from any string, emitted as inline SVG (crisp in
// print, sharp on screen). Defaults to "M" error correction; callers encoding a
// large payload (e.g. a vCard) can pass "L" to keep the code less dense/scannable.
eleventyConfig.addAsyncShortcode("qrcode", (data, errorCorrectionLevel = "M") =>
QRCode.toString(data, { type: "svg", margin: 0, errorCorrectionLevel })
);
return {
dir: {
input: "src",
output: "dist",
includes: "_includes",
data: "_data",
},
pathPrefix: "/cv",
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk",
templateFormats: ["md", "njk", "html"],
};
}