From e8010aa1f27110fc624492bc78c3b9eac187fcf9 Mon Sep 17 00:00:00 2001 From: len0rd Date: Tue, 21 Jun 2022 22:22:56 -0400 Subject: [PATCH] bump bootstrap. add hastag rendering to recipes. dont do anything yet --- package-lock.json | 11 +++++++++++ package.json | 1 + prestart.js | 10 +++++++++- recipes/chocolateChipCookies.md | 2 ++ views/pages/recipes/recipe_template.ejs | 2 +- views/partials/include.ejs | 2 +- views/partials/nav.ejs | 2 +- views/partials/post_html_include.ejs | 2 +- 8 files changed, 27 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 37f689b..cb0001d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "ejs": "^3.1.8", "express": "^4.17.1", "markdown-it": "^13.0.1", + "markdown-it-hashtag": "^0.4.0", "mkdirp": "^1.0.4", "showdown": "^2.1.0", "showdown-highlight": "^3.0.0" @@ -472,6 +473,11 @@ "markdown-it": "bin/markdown-it.js" } }, + "node_modules/markdown-it-hashtag": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-hashtag/-/markdown-it-hashtag-0.4.0.tgz", + "integrity": "sha512-+VCMH+f4/Ud5wPEtcAMrlLbUrrGViwR9JvjPy//X3Z7ZG1j5nQuHtDLTGZfMhkqYTMY+cTZgZkVNBsXMfU93Yg==" + }, "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -1145,6 +1151,11 @@ "uc.micro": "^1.0.5" } }, + "markdown-it-hashtag": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-hashtag/-/markdown-it-hashtag-0.4.0.tgz", + "integrity": "sha512-+VCMH+f4/Ud5wPEtcAMrlLbUrrGViwR9JvjPy//X3Z7ZG1j5nQuHtDLTGZfMhkqYTMY+cTZgZkVNBsXMfU93Yg==" + }, "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", diff --git a/package.json b/package.json index e3ae6c5..77b3813 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "ejs": "^3.1.8", "express": "^4.17.1", "markdown-it": "^13.0.1", + "markdown-it-hashtag": "^0.4.0", "mkdirp": "^1.0.4", "showdown": "^2.1.0", "showdown-highlight": "^3.0.0" diff --git a/prestart.js b/prestart.js index abbd692..6ad7d89 100644 --- a/prestart.js +++ b/prestart.js @@ -78,7 +78,15 @@ function convertMarkdownInDirWithShowdown(inputDir, outputDir, converter) { } function convertRecipeMarkdown(inputDir, outputDir) { - var md = require('markdown-it')(); + var md = require('markdown-it')() + .use(require('markdown-it-hashtag')); + + md.renderer.rules.hashtag_open = function (tokens, idx) { + var tagName = tokens[idx].content.toLowerCase(); + return ''; + } + + md.renderer.rules.hashtag_close = function () { return ''; } // This is a hardcoded markdown header section number to html file name // diff --git a/recipes/chocolateChipCookies.md b/recipes/chocolateChipCookies.md index dd8f900..8b87024 100644 --- a/recipes/chocolateChipCookies.md +++ b/recipes/chocolateChipCookies.md @@ -1,5 +1,7 @@ # Chocolate Chip Cookies +#dessert #cookie + *yields: ~4 dozen* ![Cookies](/img/recipes/chocolateChipCookies.jpeg) diff --git a/views/pages/recipes/recipe_template.ejs b/views/pages/recipes/recipe_template.ejs index d69b30b..632cfc6 100644 --- a/views/pages/recipes/recipe_template.ejs +++ b/views/pages/recipes/recipe_template.ejs @@ -13,7 +13,7 @@
-
+
<%- include(rootPath + page + '-title') %>
diff --git a/views/partials/include.ejs b/views/partials/include.ejs index 74ba87e..7bb30f8 100644 --- a/views/partials/include.ejs +++ b/views/partials/include.ejs @@ -1,7 +1,7 @@ - + diff --git a/views/partials/nav.ejs b/views/partials/nav.ejs index 18ac6e0..1cae67e 100644 --- a/views/partials/nav.ejs +++ b/views/partials/nav.ejs @@ -7,7 +7,7 @@