From 0558766defa08e3d160dde57875c3d4135cc3bed Mon Sep 17 00:00:00 2001 From: mms Date: Mon, 24 Jun 2024 22:33:54 +0200 Subject: feat: cross-post on blog --- layouts/blog/baseof.html | 15 ++++++++++++ layouts/blog/list.html | 14 +++++++---- layouts/partials/blog/cross-site-post.html | 37 ++++++++++++++++++++++++++++++ layouts/partials/blog/full-post.html | 13 +++++++++++ 4 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 layouts/partials/blog/cross-site-post.html create mode 100644 layouts/partials/blog/full-post.html (limited to 'layouts') diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html index 1714b89..9b0700a 100644 --- a/layouts/blog/baseof.html +++ b/layouts/blog/baseof.html @@ -163,6 +163,21 @@ text-align: justify; display: flow-root; } + + article.link { + padding: 20px; + display: flex; + justify-content: center; + } + article.link .img { + padding-right: 20px; + flex-grow: 0; + height: 32px; + width: 32px; + } + article.link .text { + flex-grow: 1; + } article figure { text-align: center; diff --git a/layouts/blog/list.html b/layouts/blog/list.html index bf20f9d..58cb880 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -5,16 +5,20 @@ {{ .Page.Content }} {{ else }} -{{ $paginator := .Paginator 10 }} +{{ $paginator := .Paginate .Site.RegularPages.ByDate.Reverse 10 }} -{{ range (.Paginate (where .Site.Pages.ByDate "Section" .Section )).Pages }} - {{ partial "partials/article_list_full_item.html" . }} +{{ range $paginator.Pages }} +{{ if eq .Section "blog" }} +{{ partial "partials/blog/full-post.html" . }} +{{ else }} +{{ partial "partials/blog/cross-site-post.html" . }} +{{ end }} {{ end }} diff --git a/layouts/partials/blog/cross-site-post.html b/layouts/partials/blog/cross-site-post.html new file mode 100644 index 0000000..3a13af8 --- /dev/null +++ b/layouts/partials/blog/cross-site-post.html @@ -0,0 +1,37 @@ +{{ $section := "some other site" }} + +{{ if eq .Section "cool-emacs" }} + {{ $section = "Cool Emacs" }} +{{ else if eq .Section "brain-rot" }} + {{ $section = "Brain Rots" }} +{{ else if eq .Section "unix-history" }} + {{ $section = "Unix History" }} +{{ else if eq .Section "star-trek" }} + {{ $section = "Star Trek" }} +{{ end }} + + diff --git a/layouts/partials/blog/full-post.html b/layouts/partials/blog/full-post.html new file mode 100644 index 0000000..31ab76f --- /dev/null +++ b/layouts/partials/blog/full-post.html @@ -0,0 +1,13 @@ +
+

{{ .Title }}

+ + + + + + {{ .Page.Content }} +
-- cgit v1.2.3