2022-02-27 17:40:55 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-02-27 16:07:57 +01:00
|
|
|
# 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.
|
|
|
|
|
2022-02-27 17:40:55 +01:00
|
|
|
# Make errors be fatal
|
|
|
|
set -e
|
|
|
|
|
2022-02-27 16:07:57 +01:00
|
|
|
WEBSITE_URL="https://n07070.xyz"
|
|
|
|
|
2022-02-27 17:40:55 +01:00
|
|
|
echo ">> Update the remotes..."
|
|
|
|
|
2022-02-27 16:07:57 +01:00
|
|
|
# Last blog version
|
|
|
|
git pull origin master
|
|
|
|
|
|
|
|
# Get last theme version
|
2022-02-27 17:40:55 +01:00
|
|
|
git submodule foreach git pull origin main
|
2022-02-27 16:07:57 +01:00
|
|
|
|
|
|
|
# Dither images present in the blog, moving the existing images to filename_original.jpg
|
|
|
|
|
2022-02-27 17:40:55 +01:00
|
|
|
# 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
|
2022-02-27 16:07:57 +01:00
|
|
|
|
|
|
|
# Generate the openring ( https://git.sr.ht/~sircmpwn/openring )
|
2022-02-27 17:40:55 +01:00
|
|
|
echo ">> Generating the openring..."
|
2022-02-27 18:18:45 +01:00
|
|
|
openring -s https://www.laquadrature.net/feed -s https://blog.mondediplo.net/rss/ -s https://solar.lowtechmagazine.com/feeds/all-en.rss.xml < themes/blogotheme/layouts/partials/openring-in.html > themes/blogotheme/layouts/partials/openring-out.html
|
2022-02-27 16:07:57 +01:00
|
|
|
|
2022-02-27 17:40:55 +01:00
|
|
|
echo ">> Building the website..."
|
2022-02-27 16:07:57 +01:00
|
|
|
hugo --themesDir themes --theme blogotheme --baseURL="https://n07070.xyz" --enableGitInfo --minify --templateMetrics
|
2022-02-27 17:40:55 +01:00
|
|
|
|
|
|
|
echo ">> All done !"
|