From e4500a634229fa99c6a1a4ce2df63e5b31e29c71 Mon Sep 17 00:00:00 2001 From: Ole Eskild Steensen Date: Mon, 18 Apr 2022 00:30:42 +0200 Subject: [PATCH 1/2] More visible inline code styling --- src/site/styles/style.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/site/styles/style.scss b/src/site/styles/style.scss index e22fb96..9859a4b 100644 --- a/src/site/styles/style.scss +++ b/src/site/styles/style.scss @@ -67,4 +67,10 @@ blockquote:before { blockquote p { display: inline; +} + +p>code { + //Inline code + color: #c7254e; + background-color: #1a1a1a; } \ No newline at end of file From b9f25858db8d2b25d57968fb191c84c2cb0e483f Mon Sep 17 00:00:00 2001 From: Ole Eskild Steensen Date: Mon, 18 Apr 2022 22:01:58 +0200 Subject: [PATCH 2/2] Use filters, as transforms has memory issues --- .eleventy.js | 6 +++--- src/site/_includes/layouts/note.njk | 2 +- src/site/index.njk | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index e112bfb..addca51 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -109,7 +109,7 @@ module.exports = function(eleventyConfig) { eleventyConfig.setLibrary("md", markdownLib); - eleventyConfig.addTransform('link', function(str) { + eleventyConfig.addFilter('link', function(str) { return str && str.replace(/\[\[(.*?\|.*?)\]\]/g, function(match, p1) { //Check if it is an embedded excalidraw drawing or mathjax javascript if (p1.indexOf("],[") > -1 || p1.indexOf('"$"') > -1) { @@ -143,7 +143,7 @@ module.exports = function(eleventyConfig) { }); }) - eleventyConfig.addTransform('highlight', function(str) { + eleventyConfig.addFilter('highlight', function(str) { return str && str.replace(/\=\=(.*?)\=\=/g, function(match, p1) { return `${p1}`; }); @@ -155,7 +155,7 @@ module.exports = function(eleventyConfig) { let titleDiv = ""; let calloutType = ""; const calloutMeta = /\[!(\w*)\](\s?.*)/g; - if(!content.match(calloutMeta)){ + if (!content.match(calloutMeta)) { return match; } diff --git a/src/site/_includes/layouts/note.njk b/src/site/_includes/layouts/note.njk index 078b70e..f900ede 100644 --- a/src/site/_includes/layouts/note.njk +++ b/src/site/_includes/layouts/note.njk @@ -15,7 +15,7 @@ permalink: "notes/{{ page.fileSlug | slugify }}/" {% if dgHomeLink !== false%} 🏡 Back Home {% endif %} - {{ content | safe}} + {{ content | link | highlight | safe}} diff --git a/src/site/index.njk b/src/site/index.njk index 9f582bb..547209d 100644 --- a/src/site/index.njk +++ b/src/site/index.njk @@ -8,7 +8,7 @@ {%include "components/notegrowthhistory.njk"%}
{%- for garden in collections.gardenEntry -%} - {{garden.templateContent | safe }} + {{garden.templateContent | link | highlight | safe }} {%- endfor -%}