Gopher Was Better. Minimal semi-static website gen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.1 KiB

#Figure out newest article
: |> cp src/news/`ls src/news -t | head -1` %o; |> obj/news.md
#Cmark all the .md
: foreach src/*.md obj/*.md |> cmark %f > %o |> obj/cmark/%B.html
#minify all html
: foreach src/theme/*.html |> minify %f > %o |> obj/theme/%B.html
: foreach obj/cmark/*.html |> minify %f > %o |> obj/min/%B.html
#Concat all webpages
: foreach obj/min/*.html | obj/theme/*.html |> cat obj/theme/header.html %f obj/theme/footer.html > %o |> web/%B.html
#Scour and output svg
#: foreach src/svg/* |> scour3 --shorten-ids --set-precision=1 --no-line-breaks --strip-xml-space --enable-viewboxing --enable-comment-stripping --remove-descriptive-elements --strip-xml-prolog --indent=none %f %o |> web/%b
#Hi! My name is svgcleaner. I eat SVGs. No idea why.
#: foreach src/svg/* |> svgcleaner %f %o |> web/%b
#Minify css
: src/theme/style.css |> minify %f > %o |> web/style.css
#Move all our unchanged stuff to the final output dir
: foreach src/img/svg/*.svg src/img/ico/*.ico src/vid/*.mp4 src/vid/*.webm src/*.php obj/theme/*.html |> cp %f %o |> web/%b
#Brotli compression
: foreach web/*.html web/*.svg web/*.css |> brotli %f -o %o |> web/%b.br