bump bootstrap. add hastag rendering to recipes. dont do anything yet

This commit is contained in:
len0rd 2022-06-21 22:22:56 -04:00
parent bfcb2ef583
commit e8010aa1f2
8 changed files with 27 additions and 5 deletions

11
package-lock.json generated
View file

@ -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",

View file

@ -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"

View file

@ -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 '<a href="/tags/' + tagName + '"><span class="badge bg-secondary">';
}
md.renderer.rules.hashtag_close = function () { return '</span></a>'; }
// This is a hardcoded markdown header section number to html file name
//

View file

@ -1,5 +1,7 @@
# Chocolate Chip Cookies
#dessert #cookie
*yields: ~4 dozen*
![Cookies](/img/recipes/chocolateChipCookies.jpeg)

View file

@ -13,7 +13,7 @@
</header>
<div class="container mt-5 topMargin">
<div class="row g-0">
<div class="row">
<div class="col-md-8">
<%- include(rootPath + page + '-title') %>
</div>

View file

@ -1,7 +1,7 @@
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="/img/favicon.png">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.5.2/animate.min.css">
<link rel="stylesheet" type="text/css" href="/css/site.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">

View file

@ -7,7 +7,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<ul class="navbar-nav me-auto my-2 my-lg-0 navbar-nav-scroll" style="--bs-scroll-height: 100px;">
<li class="nav-item">
<a class="nav-link" href="https://home.lenord.me/lovelace-rooms">Home Assistant</a>
</li>

View file

@ -1,4 +1,4 @@
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script type="text/javascript" src="/script/app.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>