Add photoswipe
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
31
Makefile
31
Makefile
@@ -1,19 +1,14 @@
|
||||
.PHONY: all css js font update-inter reset-submodules
|
||||
.PHONY: default update update-inter update-photoswipe format
|
||||
|
||||
all: css js font reset-submodules
|
||||
default:
|
||||
|
||||
css:
|
||||
|
||||
js:
|
||||
|
||||
font:
|
||||
update: update-inter update-photoswipe format
|
||||
|
||||
update-inter:
|
||||
@tmp_zip=$$(mktemp) && \
|
||||
tmp_dir=$$(mktemp -d) && \
|
||||
curl -s https://api.github.com/repos/rsms/inter/releases/latest \
|
||||
| grep "browser_download_url.*zip" \
|
||||
| cut -d '"' -f 4 \
|
||||
| jq -r '.assets[] | select(.name | test("\\.zip$$")) | .browser_download_url' \
|
||||
| xargs curl -Ls -o $$tmp_zip && \
|
||||
unzip -q -o $$tmp_zip "web/*" -d $$tmp_dir && \
|
||||
rm -rf static/font/inter && \
|
||||
@@ -21,5 +16,19 @@ update-inter:
|
||||
cp -r $$tmp_dir/web/{InterVariable*.woff2,Inter-*.woff2} static/font/inter && \
|
||||
rm -rf $$tmp_zip $$tmp_dir
|
||||
|
||||
reset-submodules:
|
||||
git submodule foreach --recursive 'git reset --hard'
|
||||
update-photoswipe:
|
||||
@tmp_zip=$$(mktemp) && \
|
||||
tmp_dir=$$(mktemp -d) && \
|
||||
curl -s https://api.github.com/repos/dimsemenov/photoswipe/releases/latest \
|
||||
| jq -r '.zipball_url' \
|
||||
| xargs curl -Ls -o $$tmp_zip && \
|
||||
unzip -q -o $$tmp_zip -d $$tmp_dir && \
|
||||
rm -rf assets/js/photoswipe assets/css/photoswipe && \
|
||||
mkdir -p assets/js/photoswipe assets/css/photoswipe && \
|
||||
cp $$tmp_dir/*PhotoSwipe*/dist/photoswipe-lightbox.esm.js assets/js/photoswipe && \
|
||||
cp $$tmp_dir/*PhotoSwipe*/dist/photoswipe.esm.js assets/js/photoswipe && \
|
||||
cp $$tmp_dir/*PhotoSwipe*/dist/photoswipe.css assets/css/photoswipe && \
|
||||
rm -rf $$tmp_zip $$tmp_dir
|
||||
|
||||
format:
|
||||
nix fmt
|
||||
|
Reference in New Issue
Block a user