Compare commits
2 Commits
c8a40d5c98
...
c8f4df96ac
Author | SHA1 | Date |
---|---|---|
Case Duckworth | c8f4df96ac | |
Case Duckworth | 517ab4c685 |
2
L
2
L
|
@ -21,7 +21,7 @@
|
|||
<div class=mainwidth>
|
||||
<span class=phi>© 2017–$(date +%Y) Case Duckworth</span>
|
||||
$(Nav - I/.??*)
|
||||
<a href="${ROOT}/.atom.xml">feed</a>
|
||||
<a href="${ROOT}/atom.xml">feed</a>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
|
|
18
Makefile
18
Makefile
|
@ -2,19 +2,25 @@
|
|||
|
||||
BUILD:= nef/nef
|
||||
LHTML:= hell/hell
|
||||
LATOM:= shatom/shatom
|
||||
SUBMODS:= $(BUILD) $(LHTML) $(LATOM)
|
||||
|
||||
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/*) # regular files
|
||||
INPUT+= $(wildcard I/.??*) # hidden files (for the footer)
|
||||
|
||||
STATIC = $(wildcard S/*) # static files
|
||||
STATIC = $(wildcard S/*) # static files
|
||||
|
||||
OUTPUT =$(patsubst I/%,O/%,$(INPUT))
|
||||
OUTPUT+=$(patsubst S/%,O/S/%,$(STATIC))
|
||||
|
||||
ATOM = O/atom.xml
|
||||
ATOMCONF = shatom.conf.sh
|
||||
OUTPUT+=$(ATOM)
|
||||
|
||||
.PHONY: all clean
|
||||
all: $(OUTPUT)
|
||||
clean:
|
||||
|
@ -28,6 +34,12 @@ O/S/%: S/% O/S
|
|||
O/%: I/% $(NEF)
|
||||
$(BUILD) $<
|
||||
|
||||
$(ATOM): $(ATOMCONF) $(LATOM)
|
||||
$(LATOM) O/ > $@
|
||||
|
||||
$(ATOMCONF):
|
||||
touch $@
|
||||
|
||||
# submodules
|
||||
$(BUILD) $(LHTML):
|
||||
$(SUBMODS):
|
||||
git submodule update --init --recursive
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
# VARIABLES
|
||||
FEED_TITLE=acdw.net
|
||||
FEED_SUBTITLE="inner space"
|
||||
FEED_URL="https://www.acdw.net/atom.xml"
|
||||
SITE_URL="https://www.acdw.net"
|
||||
FEED_ID="${SITE_URL#*//}"
|
||||
FEED_AUTHOR="Case Duckworth"
|
||||
FEED_COPYRIGHT="(c) 2017-$(date +%Y) $FEED_AUTHOR"
|
||||
FEED_UPDATED="$(date -u +'%FT%TZ')"
|
||||
|
||||
# FUNCTIONS
|
||||
recent_files() {
|
||||
# I realized that the stock `recent_files` doesn't make sense with a
|
||||
# Makefile-based design, since the mtime might change whenever I run `make
|
||||
# clean` and fuck up the ordering. So I've decided this:
|
||||
# - if a file starts with a date stamp (ISO, of course!), it is a candidate
|
||||
# for inclusion; if not, it won't be in the feed
|
||||
# - those slated for feeding (?) will be sorted newest to oldest, of course.
|
||||
|
||||
dir="$1"
|
||||
shift
|
||||
|
||||
find "$dir" |
|
||||
grep -v 'S/' |
|
||||
grep -E '^[[:digit:]]\{4\}[[:digit:]]\{2\}[[:digit:]]\{2\}' |
|
||||
sort -nr
|
||||
}
|
||||
|
||||
# ENTRY FUNCTIONS
|
||||
entry_content() {
|
||||
# Since the input files (as of now...) are of the form
|
||||
# title
|
||||
# content
|
||||
# ... this function needs to reflect that.
|
||||
sed 1d "$1"
|
||||
}
|
||||
entry_title() {
|
||||
# see above.
|
||||
sed q "$1"
|
||||
}
|
Loading…
Reference in New Issue