From 0c885ba1bf30ce8308880f926be85b6f5a499fa6 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 24 Feb 2025 02:18:20 +0800 Subject: feat(www): YEAH! --- www/layouts/_default/baseof.html | 54 ++++++++++++++++++ www/layouts/_default/list.html | 12 ++++ www/layouts/_default/single.html | 17 ++++++ www/layouts/partials/css.html | 9 +++ www/layouts/partials/date.html | 1 + www/layouts/partials/js.html | 9 +++ www/layouts/partials/nav.html | 6 ++ www/layouts/partials/preview/article.html | 10 ++++ www/layouts/partials/preview/post.html | 7 +++ www/layouts/partials/preview/posts.html | 7 +++ www/layouts/real-home/home.html | 93 +++++++++++++++++++++++++++++++ 11 files changed, 225 insertions(+) create mode 100644 www/layouts/_default/baseof.html create mode 100644 www/layouts/_default/list.html create mode 100644 www/layouts/_default/single.html create mode 100644 www/layouts/partials/css.html create mode 100644 www/layouts/partials/date.html create mode 100644 www/layouts/partials/js.html create mode 100644 www/layouts/partials/nav.html create mode 100644 www/layouts/partials/preview/article.html create mode 100644 www/layouts/partials/preview/post.html create mode 100644 www/layouts/partials/preview/posts.html create mode 100644 www/layouts/real-home/home.html (limited to 'www/layouts') diff --git a/www/layouts/_default/baseof.html b/www/layouts/_default/baseof.html new file mode 100644 index 0000000..defa6ac --- /dev/null +++ b/www/layouts/_default/baseof.html @@ -0,0 +1,54 @@ + + + + + + + + + {{ block "title" . }} + {{ .Site.Title }} + {{ end }} + {{ with resources.Get "catppuccin-latte.css" | minify | fingerprint }} + + {{ end }} + {{ with resources.Get "catppuccin-mocha.css" | minify | fingerprint }} + + {{ end }} + {{ partial "css.html" "base-style.css" }} + {{ block "head" . }} + {{ end }} + + + {{ partial "js.html" "color-scheme.ts" }} +
+ 🙃The world is full of pain, but we can fix it with love! +
+ {{ block "pre-article" .}} + {{ end }} +
+ {{ block "content" . }} + {{ end }} +
+ +
+ + {{ block "scripts" . }} + {{ end }} + + diff --git a/www/layouts/_default/list.html b/www/layouts/_default/list.html new file mode 100644 index 0000000..ddc3942 --- /dev/null +++ b/www/layouts/_default/list.html @@ -0,0 +1,12 @@ +{{ define "head"}} + {{ partial "css.html" "partials/preview/article.css" }} +{{ end }} + +{{ define "content" }} + {{ partial "nav.html" . }} +

Posts

+ {{ partial "preview/posts.html" (dict + "h" "h3" + "pages" (.RegularPages.ByDate.Reverse.Limit 3)) + }} +{{ end }} diff --git a/www/layouts/_default/single.html b/www/layouts/_default/single.html new file mode 100644 index 0000000..83297cf --- /dev/null +++ b/www/layouts/_default/single.html @@ -0,0 +1,17 @@ +{{ define "head"}} + {{ partial "css.html" "single.css" }} +{{ end }} + +{{ define "title" }} + {{ .Title }} +{{ end }} + +{{ define "content" }} + {{ partial "nav.html" . }} +

{{ .Title }}

+
+

{{ partial "date.html" .Date }} Last updated: {{ partial "date.html" .Lastmod }}

+ {{ .Content }} +
+ {{ partial "nav.html" . }} +{{ end }} diff --git a/www/layouts/partials/css.html b/www/layouts/partials/css.html new file mode 100644 index 0000000..5ddd65b --- /dev/null +++ b/www/layouts/partials/css.html @@ -0,0 +1,9 @@ +{{ with resources.Get . | minify }} + {{ if hugo.IsProduction }} + {{ with . | fingerprint }} + + {{ end }} + {{ else }} + + {{ end }} +{{ end }} diff --git a/www/layouts/partials/date.html b/www/layouts/partials/date.html new file mode 100644 index 0000000..9769e4e --- /dev/null +++ b/www/layouts/partials/date.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/layouts/partials/js.html b/www/layouts/partials/js.html new file mode 100644 index 0000000..a4e8048 --- /dev/null +++ b/www/layouts/partials/js.html @@ -0,0 +1,9 @@ +{{ with resources.Get . }} + {{ if hugo.IsProduction }} + {{ with . | js.Build (dict "minify" true "sourceMap" "external") | fingerprint }} + + {{ end }} + {{ else }} + + {{ end }} +{{ end }} diff --git a/www/layouts/partials/nav.html b/www/layouts/partials/nav.html new file mode 100644 index 0000000..42c9ad1 --- /dev/null +++ b/www/layouts/partials/nav.html @@ -0,0 +1,6 @@ + diff --git a/www/layouts/partials/preview/article.html b/www/layouts/partials/preview/article.html new file mode 100644 index 0000000..6245434 --- /dev/null +++ b/www/layouts/partials/preview/article.html @@ -0,0 +1,10 @@ +
+ {{ .date | time.Format ":date_medium" }} + {{ (printf `<%[1]s class="title">%s` .h .link .title) | safeHTML }} +

+ {{ range split .content "\n" | first 5 }} + {{ . | htmlUnescape }}
+ {{ end }} +

+

... Read more

+
diff --git a/www/layouts/partials/preview/post.html b/www/layouts/partials/preview/post.html new file mode 100644 index 0000000..f0c6fb5 --- /dev/null +++ b/www/layouts/partials/preview/post.html @@ -0,0 +1,7 @@ +{{ partial "preview/article.html" (dict + "h" .h + "title" .page.Title + "link" .page.RelPermalink + "content" .page.Plain + "date" .page.Date) +}} diff --git a/www/layouts/partials/preview/posts.html b/www/layouts/partials/preview/posts.html new file mode 100644 index 0000000..f2cb640 --- /dev/null +++ b/www/layouts/partials/preview/posts.html @@ -0,0 +1,7 @@ +{{ $h := .h }} +{{ range .pages }} + {{ partial "preview/post.html" (dict + "h" $h + "page" .) + }} +{{ end }} \ No newline at end of file diff --git a/www/layouts/real-home/home.html b/www/layouts/real-home/home.html new file mode 100644 index 0000000..3de9903 --- /dev/null +++ b/www/layouts/real-home/home.html @@ -0,0 +1,93 @@ +{{ define "head"}} + {{ partial "css.html" "real-home.css" }} + {{ partial "css.html" "partials/preview/article.css" }} +{{ end }} + +{{ define "friend" }} + {{ $gh_url := printf "https://github.com/%s" .github}} +
+ + Friend {{.name}}'s avatar
{{.name}}
+ + {{- with resources.Get "github-mark.png" -}} + + {{- end -}} +
+ {{ if .tag }} + {{ .tag }} + {{ end }} +
+{{ end }} + +{{ define "content"}} + My avatar +

Hello! This is crupest !

+
+
+

Welcome to my home page! Nice to meet you here! 🥰

+

If you have something interesting to share with me, feel free to email me at + crupest@crupest.life. +

+

You can also create an issue in any of my repos on GitHub to talk anything to me, + https://github.com/crupest. +

+
+
+ {{ with .Site.GetPage "posts" }} +
+

Recent Posts (all)

+ {{ partial "preview/posts.html" (dict + "h" "h3" + "pages" (.RegularPages.ByDate.Reverse.Limit 3)) + }} +
+ {{ end }} +
+
+

My Friends (more links are being collected ...)

+
+ {{ block "friend" dict + "name" "wsm" + "avatar" "https://avatars.githubusercontent.com/u/74699943?v=4" + "github" "wushuming666" + }} + {{ end }} + {{ block "friend" dict + "name" "hsz" + "url" "https://www.hszsoft.com" + "avatar" "https://avatars.githubusercontent.com/u/63097618?v=4" + "github" "hszSoft" + "tag" "随性の程序员" + }} + {{ end }} +
+
+ +
+
+

Always Remember

+
+
+

Die Philosophen haben die Welt nur verschieden interpretiert, es kömmt aber darauf an, sie zu verändern.

+

Translated from German: + The philosophers have only interpreted the world in various ways, the point is to change it.

+
+
+ Karl Marx, Theses on Feuerbach (1845) +
+
+
+{{ end }} \ No newline at end of file -- cgit v1.2.3