jwcook.tilde.team/Makefile

40 lines
1.1 KiB
Makefile
Raw Normal View History

2022-11-24 23:49:18 +00:00
.PHONY: all clean docs linkcheck livedocs publish size
SOURCE_DIR = pages
BUILD_DIR = _build/html
2022-11-26 23:03:54 +00:00
TAGS_DIR = pages/tags
2022-11-24 20:10:22 +00:00
2023-07-10 23:48:43 +00:00
all: clean lint docs linkcheck size publish
2022-11-07 02:42:26 +00:00
clean:
2022-11-26 23:03:54 +00:00
rm -rf $(BUILD_DIR) $(TAGS_DIR)
2022-11-07 02:42:26 +00:00
docs:
2022-11-24 23:49:18 +00:00
sphinx-build $(SOURCE_DIR) $(BUILD_DIR)
2023-07-10 23:48:43 +00:00
lint:
-pre-commit run --all
2023-07-10 23:48:43 +00:00
2022-11-24 23:49:18 +00:00
linkcheck:
sphinx-build -b linkcheck $(SOURCE_DIR) $(BUILD_DIR)
2022-11-07 02:42:26 +00:00
2022-11-15 04:04:04 +00:00
livedocs: clean
2023-07-11 03:17:59 +00:00
( sleep 2; python -m webbrowser http://localhost:8181 ) & # Open browser after delay
2022-11-24 23:49:18 +00:00
sphinx-autobuild $(SOURCE_DIR) $(BUILD_DIR) -a \
2022-11-07 03:36:08 +00:00
--watch assets \
--watch templates \
2022-11-07 03:36:08 +00:00
--watch pages/conf.py \
2022-11-07 02:42:26 +00:00
--ignore '*.tmp' \
2022-11-26 23:03:54 +00:00
--ignore '**/tags/*' \
2022-11-07 02:42:26 +00:00
--port 8181
2022-11-15 04:04:04 +00:00
publish:
rsync -rlpt --delete --progress _build/html/* tilde.team:~/public_html/
rsync -pt assets/dotfiles/tagline.txt tilde.team:~/public_html/
rsync -pt assets/images/avatar.png tilde.team:~/public_html/
rsync -pt assets/dotfiles/.project tilde.team:~/
2022-11-15 23:57:20 +00:00
ssh tilde.team 'cp ~/public_html/tagline.txt ~/.ring'
ssh tilde.team 'touch ~/public_html/index.html'
2022-11-24 20:10:22 +00:00
size:
/bin/du -h -d 1 _build/html/ | sort -h