diff --git a/.gitignore b/.gitignore index 3c3629e..69fef78 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +testsite/dist/** \ No newline at end of file diff --git a/README.md b/README.md index 40552e4..160dd0b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ myblog |-> about.md |-> styles.css ``` -And blogtool generates a static site in dist/ with a list of articles for the home page, an about page with a profile picture and bio from profile.jpg and about.md, each page will include styless.css and all assets will be available at /static +with utf-8 encoded articles. Blogtool generates a static site in dist/ with a list of articles for the home page, an about page with a profile picture and bio from profile.jpg and about.md, each page will include styless.css and all assets will be available at /static. ``` dist | diff --git a/index.js b/index.js index 7e20cb0..5555cb2 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,21 @@ +const showdown = require("showdown"); +const converter = new showdown.Converter(); const nunjucks = require("nunjucks"); -const showdown = require("shohwdown"); +const fs = require("fs"); async function main (){ nunjucks.configure({ autoescape: true }); - //nunjucks.render() + try{ fs.mkdirSync('dist'); } + catch {} + var articles = fs.readdirSync('articles'); + for(var i=0;i