54 lines
1.5 KiB
Makefile
54 lines
1.5 KiB
Makefile
_default: _project-name
|
|
@just --list
|
|
|
|
_project-name:
|
|
@echo "iiogama.0x212.com Website"
|
|
|
|
draft:
|
|
bash -c './bin/blog.sh draft'
|
|
|
|
edit:
|
|
bash -c './bin/blog.sh edit'
|
|
|
|
post:
|
|
bash -c './bin/blog.sh post'
|
|
|
|
clean: _clean-blog _clean-photos
|
|
|
|
_clean-blog:
|
|
test -d _output/ && rm -rf _output/ || exit 0
|
|
|
|
_clean-photos:
|
|
test -d photos/_thumbs/ && rm -rf photos/_thumbs/ || exit 0
|
|
test -f photos/index.html && rm photos/index.html || exit 0
|
|
test -f photos/style.css && rm photos/style.css || exit 0
|
|
|
|
build: _build-blog _build-photos
|
|
|
|
_build-blog: _clean-blog
|
|
bash -c './bin/blog.sh build'
|
|
|
|
_build-photos: _clean-photos
|
|
cd ./photos/; bash -c '../bin/gallery.sh -t "Photos" -d "_thumbs"'
|
|
|
|
push: _push-blog _push-photos _push-assets
|
|
git add .; git commit -m "$(date +%Y%m%d%H%M%S) push"; git push
|
|
|
|
_push-blog: _build-blog
|
|
find ./_output/ -type d -print0 | xargs -0 -I {} chmod 775 "{}"
|
|
find ./_output/ -type f -print0 | xargs -0 -I {} chmod 664 "{}"
|
|
rsync -avz ./_output/ iiogama-web:/var/www/htdocs/
|
|
|
|
_push-photos: _build-photos
|
|
find ./photos/ -type d -print0 | xargs -0 -I {} chmod 775 "{}"
|
|
find ./photos/ -type f -print0 | xargs -0 -I {} chmod 664 "{}"
|
|
rsync -avz ./photos/ iiogama-web:/var/www/htdocs/photos/
|
|
|
|
_push-assets:
|
|
find ./assets/ -type d -print0 | xargs -0 -I {} chmod 775 "{}"
|
|
find ./assets/ -type f -print0 | xargs -0 -I {} chmod 664 "{}"
|
|
rsync -avz ./assets/ iiogama-web:/var/www/htdocs/
|
|
|
|
serve:
|
|
test -d _output && bash -c './bin/serve.sh -d ./_output/' || exit 1
|