This repository has been archived on 2023-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
cyancat-net/Makefile

58 lines
1.6 KiB
Makefile
Raw Normal View History

2023-06-15 20:16:57 +03:00
CC = swege
SOURCE = src
DESTINATION = dst
PYHTON = python3
PORT = 8000
BIND = 127.0.0.1
2023-07-25 12:49:06 +03:00
RS_USER = neko
2023-06-15 20:16:57 +03:00
RS_HOST = darkn.space
2023-07-25 12:49:06 +03:00
RS_PATH = /home/neko/cyancat_net
2023-06-15 20:16:57 +03:00
CSSDIR = ${SOURCE}/assets/styles
SCRIPTS_DIR = ./scripts
all:
${CC}
rebuild:
${CC} rebuild
post:
@@${SCRIPTS_DIR}/newpost
mincss:
@find ${CSSDIR} -type f -not -name '*.min.css' | ${SCRIPTS_DIR}/mincss
urlcheck:
@find ${SOURCE} -type f -name '*.md' -exec cat {} \+ | ${SCRIPTS_DIR}/urlcheck
perm:
find ./${DESTINATION} -type d -exec chmod 755 {} \;
find ./${DESTINATION} -type f -exec chmod 644 {} \;
serve: all
${PYHTON} -m http.server --bind ${BIND} -d ./${DESTINATION} ${PORT}
entr:
find ./${SOURCE} | entr make
deploy: all perm
rsync -rtvzP ./${DESTINATION}/* ${RS_USER}@${RS_HOST}:${RS_PATH}/
clean:
rm -rf ./${DESTINATION} ./.manifest
help:
@echo 'make # build site'
@echo 'make rebuild # forcefully rebuild site'
@echo 'make post # write a new article'
@echo 'make mincss # minify CSS, invoke each time you modify CSS files'
@echo 'make urlcheck # check Markdown source files for dead URLs'
@echo 'make perm # set correct file permissions for output site files'
@echo 'make serve # launch a local HTTP server to see changes, requires python 3'
@echo 'make entr # check for file changes, and rebuild site automatically'
@echo 'make deploy # upload site to the server'
@echo 'make clean # delete the built site'
@echo 'make help # print this text'
.PHONY: all rebuild post mincss urlcheck perm serve entr deploy clean