mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-04 12:00:02 +00:00
feat: User setup (#95)
* allow users to add plugins to setup markdown and eleventy * comments on function * added userSetup.js to plugin-info.json
This commit is contained in:
parent
1670b2e64b
commit
59c3cde9e0
@ -7,6 +7,10 @@ const tocPlugin = require("eleventy-plugin-nesting-toc");
|
||||
const { parse } = require("node-html-parser");
|
||||
|
||||
const { headerToId, namedHeadingsFilter } = require("./src/helpers/utils");
|
||||
const {
|
||||
userMarkdownSetup,
|
||||
userEleventySetup,
|
||||
} = require("./src/helpers/userSetup");
|
||||
|
||||
const tagRegex = /(^|\s|\>)(#[^\s!@#$%^&*()=+\.,\[{\]};:'"?><]+)(?!([^<]*>))/g;
|
||||
|
||||
@ -156,7 +160,8 @@ module.exports = function (eleventyConfig) {
|
||||
|
||||
return prefix + n;
|
||||
};
|
||||
});
|
||||
})
|
||||
.use(userMarkdownSetup);
|
||||
|
||||
eleventyConfig.setLibrary("md", markdownLib);
|
||||
|
||||
@ -320,6 +325,8 @@ module.exports = function (eleventyConfig) {
|
||||
return variable;
|
||||
});
|
||||
|
||||
userEleventySetup(eleventyConfig);
|
||||
|
||||
return {
|
||||
dir: {
|
||||
input: "src/site",
|
||||
|
@ -12,7 +12,8 @@
|
||||
"src/site/img/tree-1.svg",
|
||||
"src/site/img/tree-2.svg",
|
||||
"src/site/img/tree-3.svg",
|
||||
"src/helpers/userUtils.js"
|
||||
"src/helpers/userUtils.js",
|
||||
"src/helpers/userSetup.js"
|
||||
],
|
||||
"filesToModify": [
|
||||
".eleventy.js",
|
||||
|
10
src/helpers/userSetup.js
Normal file
10
src/helpers/userSetup.js
Normal file
@ -0,0 +1,10 @@
|
||||
function userMarkdownSetup(md) {
|
||||
// The md parameter stands for the markdown-it instance used throughout the site generator.
|
||||
// Feel free to add any plugin you want here instead of /.eleventy.js
|
||||
}
|
||||
function userEleventySetup(eleventyConfig) {
|
||||
// The eleventyConfig parameter stands for the the config instantiated in /.eleventy.js.
|
||||
// Feel free to add any plugin you want here instead of /.eleventy.js
|
||||
}
|
||||
exports.userMarkdownSetup = userMarkdownSetup;
|
||||
exports.userEleventySetup = userEleventySetup;
|
Loading…
x
Reference in New Issue
Block a user