aboutsummaryrefslogtreecommitdiff
path: root/services/docker/nginx/install-hugo.bash
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-02-24 02:18:20 +0800
committerYuqian Yang <crupest@crupest.life>2025-02-26 02:21:41 +0800
commit0874dd5d5652f7d710d98329ba111fd69e7d8fce (patch)
treed07e51b0f743d796d8e680530d2d2811565dac2b /services/docker/nginx/install-hugo.bash
parent46e66fefdf1affe6062ab498a28d766ef0e5d0c3 (diff)
downloadcrupest-0874dd5d5652f7d710d98329ba111fd69e7d8fce.tar.gz
crupest-0874dd5d5652f7d710d98329ba111fd69e7d8fce.tar.bz2
crupest-0874dd5d5652f7d710d98329ba111fd69e7d8fce.zip
feat(www): YEAH!
Diffstat (limited to 'services/docker/nginx/install-hugo.bash')
-rw-r--r--services/docker/nginx/install-hugo.bash15
1 files changed, 15 insertions, 0 deletions
diff --git a/services/docker/nginx/install-hugo.bash b/services/docker/nginx/install-hugo.bash
new file mode 100644
index 0000000..dcf6800
--- /dev/null
+++ b/services/docker/nginx/install-hugo.bash
@@ -0,0 +1,15 @@
+#! /usr/bin/env bash
+
+set -e
+
+apt-get update
+apt-get install -y locales curl
+localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+
+VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
+echo "The latest version of hugo is $VERSION."
+url="https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_extended_${VERSION}_linux-amd64.deb"
+curl -fOL "$url"
+dpkg -i "hugo_extended_${VERSION}_linux-amd64.deb"
+rm "hugo_extended_${VERSION}_linux-amd64.deb"
+hugo version