Ajout d'un script pour la publication

This commit is contained in:
nono 2022-02-27 16:07:57 +01:00
parent 3b3186d6ce
commit 20f002d97b
3 changed files with 34 additions and 1 deletions

View File

33
publish.sh Executable file
View File

@ -0,0 +1,33 @@
# This script will publish the compiled output of the blog
# as it is now in this directory.
# It could be futher improved by taking this version,
# making a git branch at this point, or a git tag
# to enable rollbacks.
WEBSITE_URL="https://n07070.xyz"
# Last blog version
git pull origin master
# Get last theme version
git submodule foreach git pull origin master
# Dither images present in the blog, moving the existing images to filename_original.jpg
## Travel down the directory content/
find content/ \ # Find from the content directory
-maxdepth 4 \ # Maximum depth of 4 dirs
-type f \ # Find only files
-name "*.jpg" \ # Find only JPEG files
-exec \ # Execute next lines
cp {} {}.original && \ # Copy file and add .original to it's filename
convert {} -colorspace GRAY -o ordered-dither o2x2 {} &&\ # Dither image
jpegoptim {} -S 80 -t ; # Optimize the jpeg file
# Generate the openring ( https://git.sr.ht/~sircmpwn/openring )
./openring -s https://www.laquadrature.net/feed -s https://mamot.fr/@n07070.rss -s https://solar.lowtechmagazine.com/feeds/all-en.rss.xml < in.html > openring-out.html
hugo --themesDir themes --theme blogotheme --baseURL="https://n07070.xyz" --enableGitInfo --minify --templateMetrics

@ -1 +1 @@
Subproject commit 200b19178e206b11729bd366dd95b337bae55931
Subproject commit c1c2b078f40c9bf85e61af0e601ad20433d4bd34