diff --git a/.eleventy.js b/.eleventy.js
index 4e79e52..8ec34bc 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -11,6 +11,9 @@ const { headerToId, namedHeadingsFilter } = require("./src/helpers/utils");
const tagRegex = /(^|\s|\>)(#[^\s!@#$%^&*()=+\.,\[{\]};:'"?><]+)(?!([^<]*>))/g;
module.exports = function (eleventyConfig) {
+ eleventyConfig.setLiquidOptions({
+ dynamicPartials: true,
+ });
let markdownLib = markdownIt({
breaks: true,
html: true,
diff --git a/plugin-info.json b/plugin-info.json
index 405464c..9403ce4 100644
--- a/plugin-info.json
+++ b/plugin-info.json
@@ -45,6 +45,7 @@
"src/site/_data/versionednotes.js",
"src/site/_data/meta.js",
"src/site/_data/filetree.js",
+ "src/site/_data/dynamics.js",
"src/site/img/outgoing.svg",
"src/helpers/constants.js",
"src/helpers/utils.js",
@@ -56,4 +57,4 @@
"src/site/_data/eleventyComputed.js",
"src/site/graph.njk"
]
-}
\ No newline at end of file
+}
diff --git a/src/site/_data/dynamics.js b/src/site/_data/dynamics.js
new file mode 100644
index 0000000..d356a2c
--- /dev/null
+++ b/src/site/_data/dynamics.js
@@ -0,0 +1,44 @@
+const fsFileTree = require("fs-file-tree");
+
+const BASE_PATH = "src/site/_includes/components/user"
+const STYLE_PATH = "src/site/styles/user"
+const NAMESPACES = ["index", "notes", "common"];
+const SLOTS = ["header", "afterContent", "footer"]
+
+const generateComponentPaths = async (namespace) => {
+ const data = {};
+ for (let index = 0; index < SLOTS.length; index++) {
+ const slot = SLOTS[index];
+ try {
+ const tree = await fsFileTree(`${BASE_PATH}/${namespace}/${slot}`);
+ let comps = Object.keys(tree).filter((p) => p.indexOf(".njk") != -1).map((p) => `components/user/${namespace}/${slot}/${p}`);
+ comps.sort()
+ data[slot] = comps;
+ } catch {
+ data[slot] = [];
+ }
+ }
+ return data;
+}
+
+const generateStylesPaths = async () => {
+ try {
+ const tree = await fsFileTree(`${STYLE_PATH}`);
+ let comps = Object.keys(tree).map((p) => `/styles/user/${p}`.replace('.scss', '.css'));
+ comps.sort()
+ return comps
+ } catch {
+ return [];
+ }
+}
+
+
+module.exports = async () => {
+ const data = {};
+ for (let index = 0; index < NAMESPACES.length; index++) {
+ const ns = NAMESPACES[index];
+ data[ns] = await generateComponentPaths(ns);
+ }
+ data['styles'] = await generateStylesPaths()
+ return data;
+}
\ No newline at end of file
diff --git a/src/site/_includes/components/pageheader.njk b/src/site/_includes/components/pageheader.njk
index 4e3fe30..5895284 100644
--- a/src/site/_includes/components/pageheader.njk
+++ b/src/site/_includes/components/pageheader.njk
@@ -29,6 +29,9 @@
{%endif%}
+{%- for style in dynamics.styles -%}
+
+{%- endfor -%}
diff --git a/src/site/_includes/layouts/note.njk b/src/site/_includes/layouts/note.njk
index aa428e1..247bd27 100644
--- a/src/site/_includes/layouts/note.njk
+++ b/src/site/_includes/layouts/note.njk
@@ -38,8 +38,20 @@ permalink: "notes/{{ page.fileSlug | slugify }}/"
{% endif %}
+ {% for imp in dynamics.common.header %}
+ {% include imp %}
+ {% endfor %}
+ {% for imp in dynamics.notes.header %}
+ {% include imp %}
+ {% endfor %}
{{ content | hideDataview | link | taggify | highlight | safe}}
+ {% for imp in dynamics.common.afterContent %}
+ {% include imp %}
+ {% endfor %}
+ {% for imp in dynamics.notes.afterContent %}
+ {% include imp %}
+ {% endfor %}
{% if settings.dgShowBacklinks === true or settings.dgShowLocalGraph === true or settings.dgShowToc === true%}
@@ -50,5 +62,11 @@ permalink: "notes/{{ page.fileSlug | slugify }}/"
{%include "components/linkPreview.njk"%}
{% endif %}
{% include "components/references.njk" %}
+ {% for imp in dynamics.common.footer %}
+ {% include imp %}
+ {% endfor %}
+ {% for imp in dynamics.notes.footer %}
+ {% include imp %}
+ {% endfor %}