diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-02-24 02:18:20 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-02-26 02:21:41 +0800 |
commit | 0874dd5d5652f7d710d98329ba111fd69e7d8fce (patch) | |
tree | d07e51b0f743d796d8e680530d2d2811565dac2b /www/layouts/partials/preview | |
parent | 46e66fefdf1affe6062ab498a28d766ef0e5d0c3 (diff) | |
download | crupest-0874dd5d5652f7d710d98329ba111fd69e7d8fce.tar.gz crupest-0874dd5d5652f7d710d98329ba111fd69e7d8fce.tar.bz2 crupest-0874dd5d5652f7d710d98329ba111fd69e7d8fce.zip |
feat(www): YEAH!
Diffstat (limited to 'www/layouts/partials/preview')
-rw-r--r-- | www/layouts/partials/preview/article.html | 10 | ||||
-rw-r--r-- | www/layouts/partials/preview/post.html | 7 | ||||
-rw-r--r-- | www/layouts/partials/preview/posts.html | 7 |
3 files changed, 24 insertions, 0 deletions
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 @@ +<section class="article-preview"> + <span class="date">{{ .date | time.Format ":date_medium" }}</span> + {{ (printf `<%[1]s class="title"><a href="%s">%s</a></%[1]s>` .h .link .title) | safeHTML }} + <p class="content"> + {{ range split .content "\n" | first 5 }} + {{ . | htmlUnescape }}<br/> + {{ end }} + </p> + <p>... <a class="mono-link" href="{{ .link }}">Read more</a></p> +</section> 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 |