diff --git a/.gitignore b/.gitignore index 69fef78..b799427 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -node_modules -testsite/dist/** \ No newline at end of file +blogtool \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ff9e935 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +Everyone is permitted to copy and distribute verbatim or modified +copies of this license document, and changing it is allowed as long +as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1865586 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +ifeq ($(PREFIX),) + PREFIX := /usr/local +endif + +all: release + +.PHONY: clean +clean: + rm -f blogtool + +.PHONY: run +run: + crystal run src/blogtool.cr + +release: + crystal build --release --no-debug src/blogtool.cr + +test: + cd testsite && crystal run ../src/blogtool.cr + +install: + install swayfocus $(PREFIX)/bin/ diff --git a/base.html b/base.html new file mode 100644 index 0000000..b14a440 --- /dev/null +++ b/base.html @@ -0,0 +1,4 @@ + + + + diff --git a/blogtool b/blogtool index 48e6881..8e3416a 100644 Binary files a/blogtool and b/blogtool differ diff --git a/index.js b/index.js deleted file mode 100644 index 5555cb2..0000000 --- a/index.js +++ /dev/null @@ -1,21 +0,0 @@ -const showdown = require("showdown"); -const converter = new showdown.Converter(); -const nunjucks = require("nunjucks"); -const fs = require("fs"); - -async function main (){ - nunjucks.configure({ - autoescape: true - }); - try{ fs.mkdirSync('dist'); } - catch {} - var articles = fs.readdirSync('articles'); - for(var i=0;i + +description: | + A comically simple static site generator. + +dependencies: + markd: + github: icyleaf/markd + +license: WTFPL diff --git a/src/blogtool.cr b/src/blogtool.cr new file mode 100644 index 0000000..901f99d --- /dev/null +++ b/src/blogtool.cr @@ -0,0 +1,13 @@ +require "markd" +require "dir" + +begin + Dir.mkdir "dist" +rescue +end + +articles = Dir.entries "articles" +articles = articles.select { |i| i != "." && i != ".." } +puts articles + +#print Markd.to_html(text, Markd::Options.new(smart: true, safe: false)); \ No newline at end of file diff --git a/templates/index.njk b/templates/index.njk deleted file mode 100644 index e69de29..0000000 diff --git a/testsite/dist/test.html b/testsite/dist/test.html new file mode 100644 index 0000000..9f8667b --- /dev/null +++ b/testsite/dist/test.html @@ -0,0 +1,9 @@ + + + + +

yeet

+

this is a test

+

weeeooo

+ + \ No newline at end of file