website/GNUmakefile

84 lines
2.3 KiB
Text
Raw Normal View History

DEPLOY_HTTPROOT ?= httproot
DEPLOY_BLOBS := $(foreach blob,$(wildcard blob/*),$(DEPLOY_HTTPROOT)/$(blob))
2025-10-09 14:46:26 -05:00
# AWESOME_BLOGS := -s https://lwn.net/headlines/rss \
# -s https://lobste.rs/rss \
# -s https://blog.haskell.org/atom.xml \
# -s https://www.phoronix.com/rss.php \
# -s https://static.fsf.org/fsforg/rss/news.xml \
# -s https://emersion.fr/blog/rss.xml
2023-10-20 04:31:43 -05:00
UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
OPEN=xdg-open
endif
BLOG_SRC=$(wildcard blog/*.md)
BLOG_HTML=$(foreach POST,$(BLOG_SRC),$(shell scripts/htmlify.bash $(POST)))
blog/%.inner.html: blog/%.md
pandoc --standalone --template template.html $^ -o $@
indicators: $(BLOG_SRC)
scripts/indicators.bash
blog/%.indicator.html: indicators
blog/%.html: %.head.html nav.head.html %.indicator.html nav.tail.html window.head.html %.inner.html window.tail.html
cat $^ > $@
2025-10-09 14:46:26 -05:00
blog/feed.xml blog.inner.html: $(BLOG_SRC) scripts/blogposts.bash #modules/openring/openring
scripts/blogposts.bash > $@
# scripts/blogposts.bash \
# | modules/openring/openring -n 12 -p 3 \
# $(AWESOME_BLOGS) > $@
2024-10-04 16:12:27 -05:00
modules/openring/openring.go: .gitmodules
git submodule update --init --recursive -- modules/openring
modules/openring/openring: modules/openring/openring.go
cd modules/openring && go build
2023-10-20 04:31:43 -05:00
2024-10-04 15:11:15 -05:00
modules/resume/resume.md: .gitmodules
git submodule update --init --recursive -- modules/resume
resume.md: modules/resume/resume.md
tail -n+9 < $< > $@
2023-10-20 04:31:43 -05:00
resume.inner.html: resume.md
pandoc --standalone --template template.html $^ -o $@
blog-posts: $(BLOG_HTML) blog.inner.html blog.html
@echo $(BLOG_HTML)
index.html: indexhead.html nav.head.html index.indicator.html nav.tail.html index.tail.html
cat $^ > $@
%.head.html:
cat headhead.html > $@
echo "<title>$* | Andrea OS</title>" >> $@
cat headtail.html >> $@
%.html: %.head.html nav.head.html %.indicator.html nav.tail.html window.head.html %.inner.html window.tail.html
cat $^ > $@
2025-10-09 14:46:26 -05:00
test: deploy
#$(OPEN) $@.html
2025-10-09 14:46:26 -05:00
cd $(DEPLOY_HTTPROOT) \
&& (ln -s . '~targetdisk' || :) \
2025-10-09 14:46:26 -05:00
&& python -m http.server
2023-10-20 04:31:43 -05:00
$(DEPLOY_HTTPROOT)/blob/%: blob/% $(DEPLOY_HTTPROOT)/blob
cp -rv $< $@
$(DEPLOY_HTTPROOT)/blob:
mkdir -p $@
deploy: all $(DEPLOY_BLOBS)
cp -rv *.css *.html blog media \
$(DEPLOY_HTTPROOT)
2025-10-09 14:46:26 -05:00
all: blog-posts index.html blog.html resume.html
2023-10-20 04:31:43 -05:00
.PHONY: all blog-posts indicators deploy