From f0e9a91b55b6f90d9ddbe7347293be27bf58a5ed Mon Sep 17 00:00:00 2001 From: Menix Date: Thu, 21 Jul 2022 18:54:02 +0000 Subject: Added microblog and classless themes --- public_md/build.js | 13 ++++++++++++- public_md/mb.sh | 6 ++++++ public_md/src/index.md | 2 ++ public_md/src/microblog.md | 5 +++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 public_md/mb.sh create mode 100644 public_md/src/microblog.md (limited to 'public_md') diff --git a/public_md/build.js b/public_md/build.js index 2dddfc0..abc0320 100644 --- a/public_md/build.js +++ b/public_md/build.js @@ -3,6 +3,17 @@ const fs = require("fs"); const path = require("path"); md = new MarkdownIt(); +const html_header = ` + + + + + + ` +const html_footer = ` + + ` + const walkSync = (inputdir, outputdir, callback) => { const files = fs.readdirSync(inputdir); @@ -26,7 +37,7 @@ function fileHandler (filepath, outputdir, stats) { }); outputpath = outputpath.replace(/\.md$/i, '.html'); - const html = md.render(buf.toString()); + const html = html_header + md.render(buf.toString()) + html_footer; fs.writeFile(outputpath, html, (err) => { if (err) console.log(err); console.log("Successfully Written to: " + outputpath); diff --git a/public_md/mb.sh b/public_md/mb.sh new file mode 100755 index 0000000..c97935a --- /dev/null +++ b/public_md/mb.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo -e "*" `date` '\t' "$@" >>~/tilde-notes/public_md/src/microblog.md +cd ~/tilde-notes/public_md/ && node build.js + + diff --git a/public_md/src/index.md b/public_md/src/index.md index 168c907..a06cf46 100644 --- a/public_md/src/index.md +++ b/public_md/src/index.md @@ -6,3 +6,5 @@ I think I might want to add some sort of simple microblog to this, perhaps similar to [twtxt](https://twtxt.readthedocs.io/en/latest/). Maybe watch for file changes as well. +[log](microblog.html) + diff --git a/public_md/src/microblog.md b/public_md/src/microblog.md new file mode 100644 index 0000000..63281ce --- /dev/null +++ b/public_md/src/microblog.md @@ -0,0 +1,5 @@ +# Log + + +* Thu Jul 21 18:22:31 UTC 2022 First attempt at a very simple micro web log +* Thu Jul 21 18:49:25 UTC 2022 Added a [classless](https://github.com/dbohdan/classless-css) theme -- cgit 1.4.1-2-gfad0