acdw.net/shatom.conf.sh

41 lines
1.1 KiB
Bash

# 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"
}