2020-03-05 13:30:50 +01:00
|
|
|
OUTPUT_DIR=./public
|
2020-03-05 14:08:48 +01:00
|
|
|
FTP_HOST=xsteadfastx.org
|
|
|
|
FTP_USER=xstead_0
|
2020-02-27 15:11:23 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf public
|
|
|
|
|
|
|
|
build:
|
|
|
|
hugo
|
2020-02-29 16:59:36 +01:00
|
|
|
mkdir public/feed
|
|
|
|
cp public/index.xml public/feed/index.html
|
2020-02-27 15:11:23 +01:00
|
|
|
|
2020-03-18 08:55:36 +01:00
|
|
|
docker:
|
|
|
|
docker build -t quay.io/xsteadfastx/blog - < Dockerfile
|
|
|
|
|
|
|
|
push: docker
|
|
|
|
docker push quay.io/xsteadfastx/blog
|
2020-02-27 15:11:23 +01:00
|
|
|
|
|
|
|
ftp_upload:
|
2020-03-05 14:59:31 +01:00
|
|
|
rclone sync -v --size-only $(OUTPUT_DIR) blog:/
|
2020-02-27 15:11:23 +01:00
|
|
|
|
2020-03-05 14:08:48 +01:00
|
|
|
rclone_config:
|
|
|
|
echo "[blog]" > ~/.config/rclone/rclone.conf
|
|
|
|
echo "type = sftp" >> ~/.config/rclone/rclone.conf
|
|
|
|
echo "host = $(FTP_HOST)" >> ~/.config/rclone/rclone.conf
|
|
|
|
echo "user = $(FTP_USER)" >> ~/.config/rclone/rclone.conf
|
|
|
|
echo "pass = $(FTP_PASS)" >> ~/.config/rclone/rclone.conf
|
|
|
|
|
2020-03-13 17:56:49 +01:00
|
|
|
slurp_mentions:
|
|
|
|
$(eval TOKEN := $(shell stty -echo; read -p "Token: " token; stty echo; echo $$token))
|
|
|
|
curl "https://webmention.io/api/mentions?token=$(TOKEN)"|python -mjson.tool > data/mentions.json
|
|
|
|
sed -i 's/https:\/\/xsteadfastx.org/http:\/\/localhost:1313/g' data/mentions.json
|
2020-03-05 14:08:48 +01:00
|
|
|
|
2020-04-07 11:00:16 +02:00
|
|
|
new_note:
|
|
|
|
$(eval NOTE := notes/$(shell date +%Y%m%d%H%M).md)
|
|
|
|
hugo new $(NOTE)
|
|
|
|
nvim content/$(NOTE)
|
2020-03-13 17:56:49 +01:00
|
|
|
|
2020-04-07 11:00:16 +02:00
|
|
|
|
|
|
|
.PHONY: clean build docker push install_deps ftp_upload rclone_config slurp_mentions new_note
|