aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-03-03 16:58:21 +0800
committerYuqian Yang <crupest@crupest.life>2025-03-03 16:58:21 +0800
commitcfa5ea2f4a8fd79136cfe95ad1fdfe88d52eece8 (patch)
treec19d51134b8fed16ee10f8097a8e105462b75833
parent69c050e349956f4c982f7e73a09f9a0882f1973f (diff)
downloadcrupest-cfa5ea2f4a8fd79136cfe95ad1fdfe88d52eece8.tar.gz
crupest-cfa5ea2f4a8fd79136cfe95ad1fdfe88d52eece8.tar.bz2
crupest-cfa5ea2f4a8fd79136cfe95ad1fdfe88d52eece8.zip
feat(www): update page and use hugo image.
-rw-r--r--.editorconfig5
-rw-r--r--services/docker/nginx/Dockerfile11
-rwxr-xr-xservices/docker/nginx/build-www.bash8
-rwxr-xr-xservices/docker/nginx/install-hugo.bash15
-rw-r--r--www/archetypes/default.md1
-rw-r--r--www/assets/home.css (renamed from www/assets/real-home.css)20
-rw-r--r--www/content/_index.md1
-rw-r--r--www/content/hurd.md5
-rw-r--r--www/content/todos.md5
-rw-r--r--www/layouts/index.html (renamed from www/layouts/real-home/home.html)35
10 files changed, 55 insertions, 51 deletions
diff --git a/.editorconfig b/.editorconfig
index e0b1274..ab74694 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,10 +11,13 @@ trim_trailing_whitespace = true
indent_style = tab
tab_width = 8
+[*.{html,css,js,ts}]
+indent_size = 2
+
[*.{c,cpp,h}]
indent_size = 2
-[*.{yaml,yml}]
+[*.{json,yaml,yml}]
indent_size = 2
[*.py]
diff --git a/services/docker/nginx/Dockerfile b/services/docker/nginx/Dockerfile
index dfaa4a4..9f5b7fe 100644
--- a/services/docker/nginx/Dockerfile
+++ b/services/docker/nginx/Dockerfile
@@ -1,12 +1,9 @@
-FROM debian AS build-www
-ADD install-hugo.bash build-www.bash /app/
-COPY --from=www . /app/src/
-WORKDIR /app
-RUN /app/install-hugo.bash
-RUN /app/build-www.bash
+FROM ghcr.io/gohugoio/hugo AS build-www
+COPY --from=www . /project/
+RUN ls && hugo
FROM nginx:mainline
-COPY --from=build-www /app/src/public /srv/www
+COPY --from=build-www /project/public /srv/www
RUN apt update && apt-get install -y tini certbot && rm -rf /var/lib/apt/lists/*
ADD mail-robots.txt /srv/mail/robots.txt
ADD certbot.bash nginx-wrapper.bash /app/
diff --git a/services/docker/nginx/build-www.bash b/services/docker/nginx/build-www.bash
deleted file mode 100755
index 498f8b8..0000000
--- a/services/docker/nginx/build-www.bash
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /usr/bin/env bash
-
-set -e
-
-cd /app/src/
-ls -l .
-[[ ! -d public ]] || rm -rf public
-hugo
diff --git a/services/docker/nginx/install-hugo.bash b/services/docker/nginx/install-hugo.bash
deleted file mode 100755
index dcf6800..0000000
--- a/services/docker/nginx/install-hugo.bash
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /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
diff --git a/www/archetypes/default.md b/www/archetypes/default.md
index 00e77bd..54cae55 100644
--- a/www/archetypes/default.md
+++ b/www/archetypes/default.md
@@ -1,6 +1,7 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
+lastmod: {{ .Date }}
draft: true
---
diff --git a/www/assets/real-home.css b/www/assets/home.css
index 83c865b..1db357e 100644
--- a/www/assets/real-home.css
+++ b/www/assets/home.css
@@ -14,6 +14,24 @@
float: right;
}
+#links {
+ font-family: monospace;
+
+ margin-block-end: 1rem;
+
+ > ul {
+ display: inline;
+ padding-inline-start: 0.5em;
+ >li {
+ display: inline;
+
+ &::after {
+ content: " | ";
+ }
+ }
+ }
+}
+
#recent-posts {
margin-block-end: 1.5em;
}
@@ -58,4 +76,4 @@ html[data-theme="dark"] {
& .friend-github {
filter: invert(1);
}
-}
+} \ No newline at end of file
diff --git a/www/content/_index.md b/www/content/_index.md
index b4533a5..e144d39 100644
--- a/www/content/_index.md
+++ b/www/content/_index.md
@@ -1,4 +1,3 @@
---
title: Home
-type: real-home
---
diff --git a/www/content/hurd.md b/www/content/hurd.md
new file mode 100644
index 0000000..67cf6f8
--- /dev/null
+++ b/www/content/hurd.md
@@ -0,0 +1,5 @@
+---
+title: "Hurd"
+date: 2025-03-03T15:34:41+08:00
+lastmod: 2025-03-03T15:34:41+08:00
+---
diff --git a/www/content/todos.md b/www/content/todos.md
new file mode 100644
index 0000000..da7cc0f
--- /dev/null
+++ b/www/content/todos.md
@@ -0,0 +1,5 @@
+---
+title: "Todos"
+date: 2025-03-03T15:34:53+08:00
+lastmod: 2025-03-03T15:34:53+08:00
+---
diff --git a/www/layouts/real-home/home.html b/www/layouts/index.html
index daf3248..55e49ff 100644
--- a/www/layouts/real-home/home.html
+++ b/www/layouts/index.html
@@ -1,5 +1,5 @@
{{ define "head"}}
- {{ partial "css.html" "real-home.css" }}
+ {{ partial "css.html" "home.css" }}
{{ partial "css.html" "partials/preview/article.css" }}
{{ end }}
@@ -28,13 +28,25 @@
<p>Welcome to my home page! Nice to meet you here! 🥰</p>
<p>If you have something interesting to share with me, feel free to email me at
<a rel="noopener noreferrer" href="mailto:crupest@crupest.life">crupest@crupest.life</a>.
+ You can also create an issue in any of my repos on GitHub to talk anything to me.
</p>
- <p>You can also create an issue in any of my repos on GitHub to talk anything to me,
- <a rel="noopener noreferrer" href="https://github.com/crupest">https://github.com/crupest</a>.
- </p>
+ <div id="links" class="mono-link">
+ links:
+ <ul>
+ <li><a href="{{ .RelPermalink }}">home</a></li>
+ <li><a href="{{ absURL "/git/" }}">git</a></li>
+ {{ with .GetPage "/hurd" }}
+ <li><a href="{{ .RelPermalink }}">hurd</a></li>
+ {{ end }}
+ {{ with .GetPage "/todos" }}
+ <li><a href="{{ .RelPermalink }}">todos</a></li>
+ {{ end }}
+ <li><a rel="noopener noreferrer" href="https://github.com/crupest">github</a></li>
+ </ul>
+ </div>
</section>
<hr>
- {{ with .Site.GetPage "posts" }}
+ {{ with .GetPage "/posts" }}
<section id="recent-posts">
<h2>Recent Posts <a class="mono-link" href="{{ .RelPermalink }}">(all)</a></h2>
{{ partial "preview/posts.html" (dict
@@ -63,19 +75,6 @@
{{ end }}
</div>
</section>
- <section class="mono-link">
- <h2>Other Links</h2>
- <ul>
- <li><a rel="noopener noreferrer" href="{{ .RelPermalink }}">{{ .Permalink }}</a>
- : home page, aka the one you are reading, built with <a rel="noopener noreferrer"
- href="https://gohugo.io">hugo</a>.</li>
- <li><a rel="noopener noreferrer" href="{{ absURL "/git/" }}">{{ absURL "/git/" }}</a>
- : my git repos and <a rel="noopener noreferrer" href="https://git.zx2c4.com/cgit/">cgit</a> for viewing them.</li>
- <li><del><span class="fake-link">{{ .Site.Params.timeline }}</span> : micro-blog with my own web app
- <a rel="noopener noreferrer" href="https://github.com/crupest/Timeline">Timeline</a>.</del>
- No longer maintain, so it stops serving due to security concerns.</li>
- </ul>
- </section>
<hr>
<section>
<h2>Always Remember</h2>