diff --git a/.eleventy.js b/.eleventy.js
index 3344e84..25b7adf 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -180,6 +180,9 @@ module.exports = function (eleventyConfig) {
if (frontMatter.data.permalink) {
permalink = frontMatter.data.permalink;
}
+ if (frontMatter.data.tags.indexOf("gardenEntry") != -1) {
+ permalink = "/";
+ }
if (frontMatter.data.noteIcon) {
noteIcon = frontMatter.data.noteIcon;
}
diff --git a/plugin-info.json b/plugin-info.json
index 43683ac..a568c9c 100644
--- a/plugin-info.json
+++ b/plugin-info.json
@@ -1,6 +1,8 @@
{
"filesToDelete": [
- "src/site/styles/style.css"
+ "src/site/styles/style.css",
+ "src/site/index.njk",
+ "src/site/index.11tydata.js"
],
"filesToAdd": [
"src/site/styles/custom-style.scss",
@@ -10,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/site/_includes/layouts/index.njk"
],
"filesToModify": [
".eleventy.js",
@@ -20,9 +23,7 @@
"package-lock.json",
"package.json",
"src/site/404.njk",
- "src/site/index.njk",
"src/site/sitemap.njk",
- "src/site/index.11tydata.js",
"src/site/versionednote.njk",
"src/site/styles/style.scss",
"src/site/styles/digital-garden-base.scss",
@@ -30,6 +31,7 @@
"src/site/notes/notes.json",
"src/site/notes/notes.11tydata.js",
"src/site/_includes/layouts/note.njk",
+ "src/site/_includes/layouts/index.njk",
"src/site/_includes/layouts/versionednote.njk",
"src/site/_includes/components/notegrowthhistory.njk",
"src/site/_includes/components/pageheader.njk",
diff --git a/src/site/_data/filetree.js b/src/site/_data/filetree.js
index 714d7cf..51b4f9c 100644
--- a/src/site/_data/filetree.js
+++ b/src/site/_data/filetree.js
@@ -52,6 +52,9 @@ function getPermalinkMeta(path, key) {
if (frontMatter.data.permalink) {
permalink = frontMatter.data.permalink;
}
+ if (frontMatter.data.tags.indexOf("gardenEntry") != -1) {
+ permalink = "/";
+ }
if (frontMatter.data.title) {
name = frontMatter.data.title;
}
diff --git a/src/site/index.njk b/src/site/_includes/layouts/index.njk
similarity index 92%
rename from src/site/index.njk
rename to src/site/_includes/layouts/index.njk
index b8442be..25eeacc 100644
--- a/src/site/index.njk
+++ b/src/site/_includes/layouts/index.njk
@@ -1,7 +1,7 @@
- {{ noteTitle }}
+ {% if title %}{{ title }}{% else %}{{ page.fileSlug }}{% endif %}
{%include "components/pageheader.njk"%}
{% for imp in dynamics.common.head %}
{% include imp %}
@@ -52,9 +52,7 @@
{% for imp in dynamics.index.beforeContent %}
{% include imp %}
{% endfor %}
- {%- for garden in collections.gardenEntry -%}
- {{garden.templateContent | hideDataview | link | taggify | safe }}
- {%- endfor -%}
+ {{ content | hideDataview | link | taggify | safe}}
{% for imp in dynamics.common.afterContent %}
{% include imp %}
{% endfor %}
diff --git a/src/site/index.11tydata.js b/src/site/index.11tydata.js
deleted file mode 100644
index b38ca19..0000000
--- a/src/site/index.11tydata.js
+++ /dev/null
@@ -1,59 +0,0 @@
-require("dotenv").config();
-const settings = require("../helpers/constants");
-
-const markdownIt = require("markdown-it");
-const md = markdownIt({
- html: true,
-}).use(require("../helpers/utils").namedHeadingsFilter);
-const allSettings = settings.ALL_NOTE_SETTINGS;
-
-module.exports = {
- eleventyComputed: {
- settings: (data) => {
- const currentnote =
- data.collections.gardenEntry && data.collections.gardenEntry[0];
- if (currentnote && currentnote.data) {
- const noteSettings = {};
- allSettings.forEach((setting) => {
- let noteSetting = currentnote.data[setting];
- let globalSetting = process.env[setting];
-
- let settingValue =
- noteSetting || (globalSetting === "true" && noteSetting !== false);
- noteSettings[setting] = settingValue;
- });
- return noteSettings;
- }
- return {};
- },
- noteTitle: (data) => {
- const currentnote =
- data.collections.gardenEntry && data.collections.gardenEntry[0];
- if (currentnote && currentnote.data) {
- return currentnote.data.title || currentnote.data.page.fileSlug;
- }
- return "";
- },
- tags: (data) => {
- const currentnote =
- data.collections.gardenEntry && data.collections.gardenEntry[0];
- if (currentnote && currentnote.data) {
- return currentnote.data.tags;
- }
- return [];
- },
- content: (data) => {
- const currentnote =
- data.collections.gardenEntry && data.collections.gardenEntry[0];
- if (
- currentnote &&
- currentnote.template &&
- currentnote.template.frontMatter &&
- currentnote.template.frontMatter.content
- ) {
- return md.render(currentnote.template.frontMatter.content);
- }
- return "";
- },
- },
-};
diff --git a/src/site/notes/notes.11tydata.js b/src/site/notes/notes.11tydata.js
index c036a74..4c8985f 100644
--- a/src/site/notes/notes.11tydata.js
+++ b/src/site/notes/notes.11tydata.js
@@ -5,6 +5,18 @@ const allSettings = settings.ALL_NOTE_SETTINGS;
module.exports = {
eleventyComputed: {
+ layout: (data) => {
+ if (data.tags.indexOf("gardenEntry") != -1) {
+ return "layouts/index.njk";
+ }
+ return "layouts/note.njk";
+ },
+ permalink: (data) => {
+ if (data.tags.indexOf("gardenEntry") != -1) {
+ return "/";
+ }
+ return data.permalink || undefined;
+ },
settings: (data) => {
const noteSettings = {};
allSettings.forEach((setting) => {
diff --git a/src/site/notes/notes.json b/src/site/notes/notes.json
index 781c64c..dd1976e 100644
--- a/src/site/notes/notes.json
+++ b/src/site/notes/notes.json
@@ -1,5 +1,4 @@
{
- "layout" : "layouts/note.njk",
- "tags" : "note",
+ "tags": "note",
"templateEngineOverride": "njk,md"
- }
\ No newline at end of file
+}
\ No newline at end of file