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/preview/article.html | 10 ++++++++++ www/layouts/partials/preview/post.html | 7 +++++++ www/layouts/partials/preview/posts.html | 7 +++++++ 3 files changed, 24 insertions(+) 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/preview') 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