mirror of
https://github.com/len0rd/personal-website.git
synced 2025-03-01 03:51:57 -05:00
clear out old project generation script
This commit is contained in:
parent
3e7802908a
commit
6a3164fd33
11
package-lock.json
generated
11
package-lock.json
generated
|
@ -9,14 +9,11 @@
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dynamic-scrollspy": "^0.2.0",
|
|
||||||
"ejs": "^3.1.8",
|
"ejs": "^3.1.8",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
"markdown-it-hashtag": "^0.4.0",
|
"markdown-it-hashtag": "^0.4.0",
|
||||||
"mkdirp": "^1.0.4",
|
"mkdirp": "^1.0.4"
|
||||||
"showdown": "^2.1.0",
|
|
||||||
"showdown-highlight": "^3.0.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/accepts": {
|
"node_modules/accepts": {
|
||||||
|
@ -936,8 +933,7 @@
|
||||||
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
||||||
},
|
},
|
||||||
"dynamic-scrollspy": {
|
"dynamic-scrollspy": {
|
||||||
"version": "0.2.0",
|
"version": "https://registry.npmjs.org/dynamic-scrollspy/-/dynamic-scrollspy-0.2.0.tgz",
|
||||||
"resolved": "https://registry.npmjs.org/dynamic-scrollspy/-/dynamic-scrollspy-0.2.0.tgz",
|
|
||||||
"integrity": "sha512-MpzvxeGr8AjpbAF52Dfob926pImY7hwEA7HO5lfNsydZyGB5uS2oLGn/1NKoKkkxQ5VcLfua65RgNZYaFqIRgg=="
|
"integrity": "sha512-MpzvxeGr8AjpbAF52Dfob926pImY7hwEA7HO5lfNsydZyGB5uS2oLGn/1NKoKkkxQ5VcLfua65RgNZYaFqIRgg=="
|
||||||
},
|
},
|
||||||
"ee-first": {
|
"ee-first": {
|
||||||
|
@ -1332,8 +1328,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"showdown-highlight": {
|
"showdown-highlight": {
|
||||||
"version": "3.0.0",
|
"version": "https://registry.npmjs.org/showdown-highlight/-/showdown-highlight-3.0.0.tgz",
|
||||||
"resolved": "https://registry.npmjs.org/showdown-highlight/-/showdown-highlight-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-xrMPNGaECoFMueD3uortV5r69NFY4oZp50QTrHf21T6aYgBO6FBdv5ibBvGd2atd/FeSsPjUhJOipLL6pwELhg==",
|
"integrity": "sha512-xrMPNGaECoFMueD3uortV5r69NFY4oZp50QTrHf21T6aYgBO6FBdv5ibBvGd2atd/FeSsPjUhJOipLL6pwELhg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"highlight.js": "^11.5.0",
|
"highlight.js": "^11.5.0",
|
||||||
|
|
|
@ -18,13 +18,10 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/len0rd/personal-website",
|
"homepage": "https://github.com/len0rd/personal-website",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dynamic-scrollspy": "^0.2.0",
|
|
||||||
"ejs": "^3.1.8",
|
"ejs": "^3.1.8",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
"markdown-it-hashtag": "^0.4.0",
|
"markdown-it-hashtag": "^0.4.0",
|
||||||
"mkdirp": "^1.0.4",
|
"mkdirp": "^1.0.4"
|
||||||
"showdown": "^2.1.0",
|
|
||||||
"showdown-highlight": "^3.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
34
prestart.js
34
prestart.js
|
@ -9,8 +9,6 @@ const showdown = require('showdown'),
|
||||||
showdownHighlight = require("showdown-highlight"),
|
showdownHighlight = require("showdown-highlight"),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
mkdirp = require('mkdirp'),
|
mkdirp = require('mkdirp'),
|
||||||
projectInputDir = './project_writeups/',
|
|
||||||
projectOutputDir = './views/partials/md/projects/',
|
|
||||||
recipeInputDir = './recipes/',
|
recipeInputDir = './recipes/',
|
||||||
recipeOutputDir = './views/partials/md/recipes/',
|
recipeOutputDir = './views/partials/md/recipes/',
|
||||||
recipeListGeneratedOutputDir = './views/partials/generated/',
|
recipeListGeneratedOutputDir = './views/partials/generated/',
|
||||||
|
@ -47,37 +45,6 @@ const projectsAddHeaderClass = {
|
||||||
filter: text => { return addClassToTag(text, projectClassMap); }
|
filter: text => { return addClassToTag(text, projectClassMap); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// create Showdown converters
|
|
||||||
const projectsConverter = new showdown.Converter({
|
|
||||||
extensions: [projectsAddHeaderClass, showdownHighlight],
|
|
||||||
tables: true
|
|
||||||
});
|
|
||||||
|
|
||||||
function convertMarkdownInDirWithShowdown(inputDir, outputDir, converter) {
|
|
||||||
// make the directory for the html output if necessary
|
|
||||||
mkdirp.sync(outputDir);
|
|
||||||
fs.readdir(inputDir, (err, files) => {
|
|
||||||
files.forEach(file => {
|
|
||||||
if (file.endsWith('.md')) {
|
|
||||||
let fileNameNoExtension = file.slice(0, -3);
|
|
||||||
console.log('converting: ' + fileNameNoExtension);
|
|
||||||
fs.readFile(inputDir + file, 'utf8', (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
} else {
|
|
||||||
let html = converter.makeHtml(data); // where the magic happens
|
|
||||||
fs.writeFile(outputDir + fileNameNoExtension + '.ejs', html, 'utf8', (err) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function convertRecipeMarkdown(inputDir, outputDir) {
|
function convertRecipeMarkdown(inputDir, outputDir) {
|
||||||
var md = require('markdown-it')()
|
var md = require('markdown-it')()
|
||||||
.use(require('markdown-it-hashtag'));
|
.use(require('markdown-it-hashtag'));
|
||||||
|
@ -257,6 +224,5 @@ function generateRecipeNavigatorList(recipeSrcDir, generatedOutputDir) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
convertMarkdownInDirWithShowdown(projectInputDir, projectOutputDir, projectsConverter);
|
|
||||||
convertRecipeMarkdown(recipeInputDir, recipeOutputDir);
|
convertRecipeMarkdown(recipeInputDir, recipeOutputDir);
|
||||||
generateRecipeNavigatorList(recipeInputDir, recipeListGeneratedOutputDir);
|
generateRecipeNavigatorList(recipeInputDir, recipeListGeneratedOutputDir);
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
lenordsNet project documentation
|
lenordsNet project documentation
|
||||||
================================
|
================================
|
||||||
|
|
||||||
|
`Home <../../>`_
|
||||||
|
----------------
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
:caption: Contents:
|
:caption: Contents:
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
<% var rootPath = '../../'; %>
|
|
||||||
<% var navExt = '-nav' %>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<%- include(rootPath + 'partials/include') %>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/css/projects.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<%- include(rootPath + 'partials/nav') %>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="container mt-5">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-3 mt-5" id="scrollBar">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div data-spy="scroll" data-target="#scrollBar" data-offset="0" class="col-9 mt-5 pt-5 pb-5">
|
|
||||||
<%- include(rootPath + page) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%- include(rootPath + 'partials/footer') %>
|
|
||||||
<%- include(rootPath + 'partials/post_html_include') %>
|
|
||||||
<script type="text/javascript" src="/script/dynamicscrollspy.min.js"></script>
|
|
||||||
<script>
|
|
||||||
$('#scrollBar').DynamicScrollspy({
|
|
||||||
ulClassNames: 'navbar navbar-light bg-light sticky-top sticky-offset'
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in a new issue