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/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 +++++++ 7 files changed, 49 insertions(+) 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 (limited to 'www/layouts/partials') 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 -- cgit v1.2.3