aboutsummaryrefslogtreecommitdiff
path: root/docker/blog/install-hugo.bash
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2024-11-11 01:12:29 +0800
committerYuqian Yang <crupest@crupest.life>2024-12-19 21:42:01 +0800
commita7fb0508867ee53934be18a6606aa8bc12c2645b (patch)
tree5994f0a62733b13f9f330e3515260ae20dc4a0bd /docker/blog/install-hugo.bash
parent7692763f83ad1be735b0b9e9ab0af8ce666d8de8 (diff)
downloadcrupest-a7fb0508867ee53934be18a6606aa8bc12c2645b.tar.gz
crupest-a7fb0508867ee53934be18a6606aa8bc12c2645b.tar.bz2
crupest-a7fb0508867ee53934be18a6606aa8bc12c2645b.zip
HALF WORK: 2024.12.19
Re-organize file structure.
Diffstat (limited to 'docker/blog/install-hugo.bash')
-rw-r--r--docker/blog/install-hugo.bash22
1 files changed, 22 insertions, 0 deletions
diff --git a/docker/blog/install-hugo.bash b/docker/blog/install-hugo.bash
new file mode 100644
index 0000000..a448138
--- /dev/null
+++ b/docker/blog/install-hugo.bash
@@ -0,0 +1,22 @@
+#! /usr/bin/env bash
+
+set -e
+
+apt-get update
+apt-get install -y tini locales curl git
+rm -rf /var/lib/apt/lists/*
+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"
+
+echo "Download hugo from $url."
+
+curl -sSfOL "$url"
+dpkg -i "hugo_extended_${VERSION}_linux-amd64.deb"
+rm "hugo_extended_${VERSION}_linux-amd64.deb"
+
+echo "Hugo version: $(hugo version)."