diff options
author | Mike Gerwitz <mtg@gnu.org> | 2019-01-08 00:11:20 -0500 |
---|---|---|
committer | Mike Gerwitz <mtg@gnu.org> | 2019-01-11 23:46:13 -0500 |
commit | b182ea79b3a7ac07f673870edab1bd3d6074c618 (patch) | |
tree | 3ce02ad905ace0498829d52b4b223790b9d63266 /build-aux | |
parent | 643a9858f125e2fc2c4557a9c0d706b72c09259a (diff) | |
download | thoughts-b182ea79b3a7ac07f673870edab1bd3d6074c618.tar.gz thoughts-b182ea79b3a7ac07f673870edab1bd3d6074c618.tar.bz2 thoughts-b182ea79b3a7ac07f673870edab1bd3d6074c618.zip |
Majority of work on generation of new static site
I didn't originally intend for all of this to be in a single commit. But
here we are. I don't have the time to split these up more cleanly; this
project is taking more time than I originally hoped that it would.
This is a new static site generator. More information to follow in the
near future (hopefully in the form of an article), but repo2html is now
removed. See code comments for additional information; I tried to make it
suitable as a learning resource for others. It is essentially a set of
shell scripts with a fairly robust build for incremental generation.
The site has changed drastically, reflecting that its purpose has changed
over the years: it is now intended for publishing quality works (or at least
I hope), not just a braindump.
This retains most of the text of the original pages verbatim, with the
exception of the About page. Other pages may have their text modified in
commits that follow.
Enhancements to follow in future commits.
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/lsfonts | 22 | ||||
-rwxr-xr-x | build-aux/mkmk | 48 |
2 files changed, 70 insertions, 0 deletions
diff --git a/build-aux/lsfonts b/build-aux/lsfonts new file mode 100755 index 0000000..652615e --- /dev/null +++ b/build-aux/lsfonts @@ -0,0 +1,22 @@ +#!/bin/sh +# List fonts used by CSS +# +# Copyright (C) 2019 Mike Gerwitz +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +## + +grep -A2 @font-face style.css \ + | grep -o "fonts/[^']\+" + diff --git a/build-aux/mkmk b/build-aux/mkmk new file mode 100755 index 0000000..4f6a983 --- /dev/null +++ b/build-aux/mkmk @@ -0,0 +1,48 @@ +#!/bin/bash +# Generate dependency Makefile for post +# +# Copyright (C) 2019 Mike Gerwitz +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# The dependency Makefile is responsible for webroot generation. This is +# necessary since the directory structure of the webroot varies so wildly +# from that of the source. +## + +set -euo pipefail + + +# Generate Makefile. Produces webroot target and adds that target to the +# `www-posts' phony target. +main() +{ + local -r distdir=${1?Missing distdir} + local -r meta=${2?Missing post path} + + local slug + slug=$( recsel -P slug "$meta" ) + + local -r dest="$distdir/$slug.html" + local -r src="${meta%%.meta}.html" + + cat <<EOF +www-posts: $dest +$dest: $src + install -Dma+r $src $dest +EOF +} + + +main "$@" |