danielmoch.com

Static site for www.danielmoch.com
git clone git://git.danielmoch.com/danielmoch.com.git
Log | Files | Refs | LICENSE

commit cb2542e91607dd0ea31384f929dbb8b31525d4a4
parent 872520935d1a13fb0265a0389cf1fa9a34c20c0b
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri,  1 Jan 2021 15:09:49 -0500

Use dag

Diffstat:
ADagfile | 22++++++++++++++++++++++
MMakefile | 31+++----------------------------
Dconfig.mk | 10----------
Dfiles.mk | 190-------------------------------------------------------------------------------
Mtemplates/header.html | 4++--
5 files changed, 27 insertions(+), 230 deletions(-)

diff --git a/Dagfile b/Dagfile @@ -0,0 +1,22 @@ +target "target" { + source "src" { + extension .md { + suffix /index.html { + require "templates/header.html" + require "templates/footer.html" + filter 'm4 -DDESCRIPTION="$(lowdown -Xdescription -Tterm $<)" -DPAGE_TITLE="$(lowdown -Xtitle -Tterm $<)" -DSLUG=https://www.danielmoch.com/$(echo $< | sed "s/^src\///;s/\.md//")/ $1 >$>' + filter "lowdown -Thtml $< >>$>" + filter "cat <$2 >>$>" + } + suffix .pdf { + filter "lowdown -Tms $< | /usr/local/bin/groff -ms -t -Tpdf >$>" + } + } + extension .scss { + suffix .css { + filter "sassc -t compressed $< $>" + } + } + } + source files +} diff --git a/Makefile b/Makefile @@ -1,33 +1,8 @@ # See LICENSE file for copyright and license details .POSIX: -include config.mk -include files.mk - -all: dirs ${TARGETFILES} ${CSS} ${HTMLPOSTS} ${HTMLPAGES} ${PDF} - -dirs: - for dir in $$(echo ${DIRS} | sort | uniq); do [ -d $${dir} ] || \ - mkdir -p $${dir}; done - -${PDF}: ${@:.pdf=.md:S/target/src/} - ${LOWDOWN} -s -Tms ${@:.pdf=.md:S/target/src/} | ${TBL} | \ - ${TROFF} -ms -Tpdf > $@ - -${HTMLPOSTS} ${HTMLPAGES}: ${@:.html=.md:S/target/src/} templates/header.html templates/footer.html - ${M4} -DDESCRIPTION="$$(lowdown -Xdescription -Tterm \ - ${@:.html=.md:S/target/src/})" \ - -DPAGE_TITLE="$$(lowdown -Xtitle -Tterm \ - ${@:.html=.md:S/target/src/})" \ - -DSLUG=${@:S/target//} $@ templates/header.html >$@ - ${LOWDOWN} -Thtml ${@:.html=.md:S/target/src/} >>$@ - cat < templates/footer.html >>$@ - -${CSS}: ${@:.css=.scss:S/target/src/} - ${SASSC} -tcompact ${@:.css=.scss:S/target/src/} $@ - -${TARGETFILES}: ${@:S/target/files/} - cp ${@:S/target/files/} $@ +all: + dag serve: python -m http.server -d target -b 127.0.0.1 8000 @@ -35,4 +10,4 @@ serve: clean: rm -rf target -.PHONY: all clean dirs files serve +.PHONY: all clean serve diff --git a/config.mk b/config.mk @@ -1,10 +0,0 @@ -# See LICENSE file for copyright and license details - -SITE_NAME = Daniel Moch's Weblog -TMPL = ${BASE_DIR}/templates - -LOWDOWN = /usr/local/bin/lowdown -SASSC = /usr/local/bin/sassc -TROFF = /usr/local/bin/groff -M4 = /usr/bin/m4 -TBL = /usr/local/bin/tbl diff --git a/files.mk b/files.mk @@ -1,190 +0,0 @@ -POSTS = src/2020/07/announcing-xhotplug.md \ - src/2020/09/how-to-survive-in-a-crisis.md \ - src/2017/02/how-sadness-could-save-the-world.md \ - src/2018/04/facebook-defends-universal-data-collection.md \ - src/2018/04/the-mozilla-foundation-on-a-healthy-internet.md \ - src/2018/11/zsh-compinit-rtfm.md \ - src/2018/06/a-letter-to-senator-rubio.md \ - src/2018/12/you-should-be-using-tags-in-vim.md \ - src/2018/10/getting-started-on-mastodon.md \ - src/2018/10/new-website-backend.md \ - src/2018/10/hardening-services-with-systemd.md \ - src/2018/03/structural-problems-with-for-profit-social-media.md \ - src/2018/03/a-eulogy-for-my-grandmother.md \ - src/2018/03/traveling-with-the-good-and-the-bad.md \ - src/2019/07/using-qemu-without-pulling-your-hair-out.md - -PAGES = src/403.md \ - src/400.md \ - src/404.md \ - src/500.md \ - src/projects.md - -FILES = files/assets/avatar.jpg \ - files/assets/banner-white-transparent.png \ - files/assets/bootstrap.min.css \ - files/assets/bootstrap.min.css.map \ - files/assets/css \ - files/assets/fontawesome.css \ - files/assets/fonts \ - files/assets/initials-blue.jpg \ - files/assets/initials-blue.png \ - files/assets/initials-plus-blue.png \ - files/assets/initials-plus-white-bg.png \ - files/assets/js \ - files/assets/normalize.css \ - files/assets/open-sans.css \ - files/assets/playfair-display.css \ - files/assets/xml \ - files/favicon.ico \ - files/static/cbr.pdf \ - files/static/djmoch-signify.pub \ - files/static/gpg.asc \ - files/assets/avatar.jpg \ - files/assets/banner-white-transparent.png \ - files/assets/bootstrap.min.css \ - files/assets/bootstrap.min.css.map \ - files/assets/css/all-nocdn.css \ - files/assets/css/all.css \ - files/assets/css/baguetteBox.min.css \ - files/assets/css/code.css \ - files/assets/css/html4css1.css \ - files/assets/css/ipython.min.css \ - files/assets/css/nikola_ipython.css \ - files/assets/css/nikola_rst.css \ - files/assets/css/rst.css \ - files/assets/css/rst_base.css \ - files/assets/css/site.css \ - files/assets/css/theme.css \ - files/assets/fontawesome.css \ - files/assets/fonts/fa-brands-400.eot \ - files/assets/fonts/fa-brands-400.svg \ - files/assets/fonts/fa-brands-400.ttf \ - files/assets/fonts/fa-brands-400.woff \ - files/assets/fonts/fa-brands-400.woff2 \ - files/assets/fonts/fa-regular-400.eot \ - files/assets/fonts/fa-regular-400.svg \ - files/assets/fonts/fa-regular-400.ttf \ - files/assets/fonts/fa-regular-400.woff \ - files/assets/fonts/fa-regular-400.woff2 \ - files/assets/fonts/fa-solid-900.eot \ - files/assets/fonts/fa-solid-900.svg \ - files/assets/fonts/fa-solid-900.ttf \ - files/assets/fonts/fa-solid-900.woff \ - files/assets/fonts/fa-solid-900.woff2 \ - files/assets/fonts/opensans-cyrillic-700.woff2 \ - files/assets/fonts/opensans-cyrillic-ext-700.woff2 \ - files/assets/fonts/opensans-cyrillic-ext.woff2 \ - files/assets/fonts/opensans-cyrillic.woff2 \ - files/assets/fonts/opensans-greek-700.woff2 \ - files/assets/fonts/opensans-greek-ext-700.woff2 \ - files/assets/fonts/opensans-greek-ext.woff2 \ - files/assets/fonts/opensans-greek.woff2 \ - files/assets/fonts/opensans-latin-700.woff2 \ - files/assets/fonts/opensans-latin-ext-700.woff2 \ - files/assets/fonts/opensans-latin-ext.woff2 \ - files/assets/fonts/opensans-latin.woff2 \ - files/assets/fonts/opensans-vietnamese-700.woff2 \ - files/assets/fonts/opensans-vietnamese.woff2 \ - files/assets/fonts/playfair-display-cyrillic.woff2 \ - files/assets/fonts/playfair-display-latin-ext.woff2 \ - files/assets/fonts/playfair-display-latin.woff2 \ - files/assets/fonts/playfair-display-vietnamese.woff2 \ - files/assets/initials-blue.jpg \ - files/assets/initials-blue.png \ - files/assets/initials-plus-blue.png \ - files/assets/initials-plus-white-bg.png \ - files/assets/js/all-nocdn.js \ - files/assets/js/all.js \ - files/assets/js/baguetteBox.min.js \ - files/assets/js/fancydates.js \ - files/assets/js/fancydates.min.js \ - files/assets/js/gallery.js \ - files/assets/js/gallery.min.js \ - files/assets/js/html5.js \ - files/assets/js/html5shiv-printshiv.min.js \ - files/assets/js/justified-layout.min.js \ - files/assets/js/luxon.min.js \ - files/assets/js/moment-with-locales.min.js \ - files/assets/normalize.css \ - files/assets/open-sans.css \ - files/assets/playfair-display.css \ - files/assets/xml/atom.xsl \ - files/assets/xml/rss.xsl \ - files/assets/css/all-nocdn.css \ - files/assets/css/all.css \ - files/assets/css/baguetteBox.min.css \ - files/assets/css/code.css \ - files/assets/css/html4css1.css \ - files/assets/css/ipython.min.css \ - files/assets/css/nikola_ipython.css \ - files/assets/css/nikola_rst.css \ - files/assets/css/rst.css \ - files/assets/css/rst_base.css \ - files/assets/css/site.css \ - files/assets/css/theme.css \ - files/assets/fonts/fa-brands-400.eot \ - files/assets/fonts/fa-brands-400.svg \ - files/assets/fonts/fa-brands-400.ttf \ - files/assets/fonts/fa-brands-400.woff \ - files/assets/fonts/fa-brands-400.woff2 \ - files/assets/fonts/fa-regular-400.eot \ - files/assets/fonts/fa-regular-400.svg \ - files/assets/fonts/fa-regular-400.ttf \ - files/assets/fonts/fa-regular-400.woff \ - files/assets/fonts/fa-regular-400.woff2 \ - files/assets/fonts/fa-solid-900.eot \ - files/assets/fonts/fa-solid-900.svg \ - files/assets/fonts/fa-solid-900.ttf \ - files/assets/fonts/fa-solid-900.woff \ - files/assets/fonts/fa-solid-900.woff2 \ - files/assets/fonts/opensans-cyrillic-700.woff2 \ - files/assets/fonts/opensans-cyrillic-ext-700.woff2 \ - files/assets/fonts/opensans-cyrillic-ext.woff2 \ - files/assets/fonts/opensans-cyrillic.woff2 \ - files/assets/fonts/opensans-greek-700.woff2 \ - files/assets/fonts/opensans-greek-ext-700.woff2 \ - files/assets/fonts/opensans-greek-ext.woff2 \ - files/assets/fonts/opensans-greek.woff2 \ - files/assets/fonts/opensans-latin-700.woff2 \ - files/assets/fonts/opensans-latin-ext-700.woff2 \ - files/assets/fonts/opensans-latin-ext.woff2 \ - files/assets/fonts/opensans-latin.woff2 \ - files/assets/fonts/opensans-vietnamese-700.woff2 \ - files/assets/fonts/opensans-vietnamese.woff2 \ - files/assets/fonts/playfair-display-cyrillic.woff2 \ - files/assets/fonts/playfair-display-latin-ext.woff2 \ - files/assets/fonts/playfair-display-latin.woff2 \ - files/assets/fonts/playfair-display-vietnamese.woff2 \ - files/assets/js/all-nocdn.js \ - files/assets/js/all.js \ - files/assets/js/baguetteBox.min.js \ - files/assets/js/fancydates.js \ - files/assets/js/fancydates.min.js \ - files/assets/js/gallery.js \ - files/assets/js/gallery.min.js \ - files/assets/js/html5.js \ - files/assets/js/html5shiv-printshiv.min.js \ - files/assets/js/justified-layout.min.js \ - files/assets/js/luxon.min.js \ - files/assets/js/moment-with-locales.min.js \ - files/assets/xml/atom.xsl \ - files/assets/xml/rss.xsl \ - files/static/cbr.pdf \ - files/static/djmoch-signify.pub \ - files/static/gpg.asc - - -SCSS = src/assets/css/site.scss - -DIRS = ${POSTS:H:S/src/target/} ${PAGES:H:S/src/target/} ${SCSS:H:S/src/target/} ${FILES:H:S/files/target/} - -CSS = ${SCSS:.scss=.css:S/src/target/} - -HTMLPAGES = ${PAGES:.md=.html:S/src/target/} - -HTMLPOSTS = ${POSTS:.md=.html:S/src/target/} - -TARGETFILES = ${FILES:S/files/target/} - -PDF = ${POSTS:.md=.pdf:S/src/target/} diff --git a/templates/header.html b/templates/header.html @@ -5,14 +5,14 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content="DESCRIPTION"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Daniel Moch's Weblog</title> + <title>PAGE_TITLE | Daniel Moch's Weblog</title> <link href="/assets/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> <link href="/assets/css/site.css" rel="stylesheet" type="text/css"> <meta name="theme-color" content="#155799"> <meta name="generator" content="dag (git.danielmoch.com/dag)"> <link rel="alternate" type="application/rss+xml" title="RSS" hreflang="en" href="/rss.xml"> - <link rel="canonical" href="https://www.danielmoch.comSLUG"> + <link rel="canonical" href="SLUG"> <link rel="icon" href="/favicon.ico" sizes="16x16"> <link rel="icon" href="/favicon.ico" sizes="32x32"> <link rel="icon" href="/favicon.ico" sizes="48x48">