From e6ba2b0a47a416d35c54ddbdb232b2f038484396 Mon Sep 17 00:00:00 2001 From: nono Date: Sun, 27 Feb 2022 17:40:55 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20du=20script=20de=20publi?= =?UTF-8?q?cation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish.sh | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/publish.sh b/publish.sh index 0547895..8319411 100755 --- a/publish.sh +++ b/publish.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # This script will publish the compiled output of the blog # as it is now in this directory. @@ -5,28 +7,41 @@ # making a git branch at this point, or a git tag # to enable rollbacks. +# Make errors be fatal +set -e + WEBSITE_URL="https://n07070.xyz" +echo ">> Update the remotes..." + # Last blog version git pull origin master # Get last theme version -git submodule foreach git pull origin master +git submodule foreach git pull origin main # 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 +# Commented, because colors is nice, and dithering actually brings more issues than it solves: +# Images size tends to be bigger, relative to quality, +# It's not easy for some people to see the image that way, +# It's more trouble than it's worth. +# echo ">> Dithering the images..." +# ## 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 - +echo ">> Generating the openring..." +openring -s https://www.laquadrature.net/feed -s -s https://solar.lowtechmagazine.com/feeds/all-en.rss.xml < themes/blogotheme/layouts/partials/openring-in.html > themes/blogotheme/layouts/partials/openring-out.html +echo ">> Building the website..." hugo --themesDir themes --theme blogotheme --baseURL="https://n07070.xyz" --enableGitInfo --minify --templateMetrics + +echo ">> All done !"