Add image support and first blog image
This commit is contained in:
parent
602f1ee0d7
commit
d6cf9cbfe4
6 changed files with 1085 additions and 2 deletions
15
.eleventy.js
15
.eleventy.js
|
|
@ -1,8 +1,10 @@
|
|||
const path = require("path");
|
||||
const markdownIt = require("markdown-it");
|
||||
const slugify = require("@sindresorhus/slugify");
|
||||
const markdownItAnchor = require("markdown-it-anchor");
|
||||
const markdownItObsidian = require("markdown-it-obsidian");
|
||||
const markdownItAttrs = require("markdown-it-attrs");
|
||||
const markdownItEleventyImg = require("markdown-it-eleventy-img");
|
||||
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
|
|
@ -10,7 +12,7 @@ module.exports = function (eleventyConfig) {
|
|||
|
||||
eleventyConfig.addPassthroughCopy({ "assets/css": "css" });
|
||||
eleventyConfig.addPassthroughCopy({ "assets/fonts": "fonts" });
|
||||
eleventyConfig.addPassthroughCopy({ "assets/images": "images" });
|
||||
eleventyConfig.addPassthroughCopy({ "assets/images/*": "images" });
|
||||
eleventyConfig.addPassthroughCopy({ "assets/favicon": "/" });
|
||||
eleventyConfig.addPassthroughCopy({
|
||||
"node_modules/simpledotcss/simple.css": "css/simple.css",
|
||||
|
|
@ -42,7 +44,16 @@ module.exports = function (eleventyConfig) {
|
|||
slugifyOnPageLinks: slugify,
|
||||
})
|
||||
)
|
||||
.use(markdownItAttrs);
|
||||
.use(markdownItAttrs)
|
||||
.use(markdownItEleventyImg, {
|
||||
imgOptions: {
|
||||
outputDir: path.join("dist", "img"),
|
||||
},
|
||||
globalAttributes: {
|
||||
loading: "lazy",
|
||||
decoding: "async",
|
||||
},
|
||||
});
|
||||
eleventyConfig.setLibrary("md", markdownLibrary);
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue