Compare commits

...

6 Commits

Author SHA1 Message Date
Case Duckworth dd3409a4f6 Line endings 2021-02-04 23:28:54 -06:00
Case Duckworth e9f7d5acef Slight changes to G 2021-02-04 23:28:32 -06:00
Case Duckworth df0677b072 Configure attributes 2021-02-04 23:27:48 -06:00
Case Duckworth 1dfc8485d4 Add Makefile 2021-02-04 22:47:32 -06:00
Case Duckworth 649d4e0ff4 Correct L glob 2021-02-04 22:47:22 -06:00
Case Duckworth 2b6473b314 Change T definition to remove newline 2021-02-04 22:47:01 -06:00
5 changed files with 43 additions and 6 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto

10
G
View File

@ -6,6 +6,8 @@
# symbols (?)
PHI="<span class=phi>&#x2C77;</span>"
T()(sed q "$1")
# functions
Nav() { # Nav <INDEX> <files...>
idx="$1";shift
@ -19,19 +21,19 @@ Nav() { # Nav <INDEX> <files...>
if [ "$post" != "$idx" ]; then
echo "<a href=\"$ROOT/${post#*/}\""
[ "$post" = "$F" ] && echo "class=current"
echo ">$(T $post)</a>"
echo ">$(T "$post")</a>"
fi
done
}
alias T=sed\ q
# redefine X for better logging
X()(eval "$(P "cat<<.";cat;P;P .)")
. hell/hell
# MAIN
set +C # it's clobberin' time!!!
[ $DEBUG ] && set -x # debug if DEBUG is set
for F
do
printf>&2 '%s\t...' "$F"
@ -40,4 +42,4 @@ do
} || {
echo>&2 "FAIL."
}
done
done

2
L
View File

@ -17,7 +17,7 @@
</main>
<footer>
<span class=phi>&copy; 2017&ndash;$(date +%Y) Case Duckworth</span>
$(Nav - I/.{license,colophon}.html)
$(Nav - I/.??*)
<a href="${ROOT}/.atom.xml">feed</a>
</footer>
</body>

34
Makefile Normal file
View File

@ -0,0 +1,34 @@
# acdw.net
BUILD:= nef/nef
LHTML:= hell/hell
NEF = G # Generator (shell functions and generator loop)
NEF+= R # Renderer (awk script to convert to compliant HTML)
NEF+= L # Layout (template script expanded by X)
INPUT = $(wildcard I/*) # regular files
INPUT+= $(wildcard I/.??*) # hidden files (for the footer)
STATIC = $(wildcard S/*) # static files
OUTPUT =$(patsubst I/%,O/%,$(INPUT))
OUTPUT+=$(patsubst S/%,O/S/%,$(STATIC))
.PHONY: all clean
all: $(OUTPUT)
clean:
rm -rf O
O:; mkdir -p O
O/S: O; mkdir -p O/S
O/S/%: S/% O/S
cp $< $@
O/%: I/% $(NEF)
$(BUILD) $<
# submodules
$(BUILD) $(LHTML):
git submodule update --init --recursive

2
nef

@ -1 +1 @@
Subproject commit 9ae2eef082ddaa41f773059cb485db4e39c63553
Subproject commit a4d6574ffb752b31093c30fe3c7d68710e9e1b50