Mise à jour du script de publication
This commit is contained in:
parent
ddfa39475d
commit
e6ba2b0a47
39
publish.sh
39
publish.sh
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# This script will publish the compiled output of the blog
|
# This script will publish the compiled output of the blog
|
||||||
# as it is now in this directory.
|
# as it is now in this directory.
|
||||||
|
|
||||||
@ -5,28 +7,41 @@
|
|||||||
# making a git branch at this point, or a git tag
|
# making a git branch at this point, or a git tag
|
||||||
# to enable rollbacks.
|
# to enable rollbacks.
|
||||||
|
|
||||||
|
# Make errors be fatal
|
||||||
|
set -e
|
||||||
|
|
||||||
WEBSITE_URL="https://n07070.xyz"
|
WEBSITE_URL="https://n07070.xyz"
|
||||||
|
|
||||||
|
echo ">> Update the remotes..."
|
||||||
|
|
||||||
# Last blog version
|
# Last blog version
|
||||||
git pull origin master
|
git pull origin master
|
||||||
|
|
||||||
# Get last theme version
|
# 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
|
# Dither images present in the blog, moving the existing images to filename_original.jpg
|
||||||
|
|
||||||
## Travel down the directory content/
|
# Commented, because colors is nice, and dithering actually brings more issues than it solves:
|
||||||
find content/ \ # Find from the content directory
|
# Images size tends to be bigger, relative to quality,
|
||||||
-maxdepth 4 \ # Maximum depth of 4 dirs
|
# It's not easy for some people to see the image that way,
|
||||||
-type f \ # Find only files
|
# It's more trouble than it's worth.
|
||||||
-name "*.jpg" \ # Find only JPEG files
|
# echo ">> Dithering the images..."
|
||||||
-exec \ # Execute next lines
|
# ## Travel down the directory content/
|
||||||
cp {} {}.original && \ # Copy file and add .original to it's filename
|
# find "./content" \ # Find from the content directory
|
||||||
convert {} -colorspace GRAY -o ordered-dither o2x2 {} &&\ # Dither image
|
# -maxdepth 4 \ # Maximum depth of 4 dirs
|
||||||
jpegoptim {} -S 80 -t ; # Optimize the jpeg file
|
# -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 )
|
# 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
|
hugo --themesDir themes --theme blogotheme --baseURL="https://n07070.xyz" --enableGitInfo --minify --templateMetrics
|
||||||
|
|
||||||
|
echo ">> All done !"
|
||||||
|
Loading…
Reference in New Issue
Block a user