diff --git a/assets/css/styles.css b/assets/css/styles.css index b411dbd..6ff3dc7 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -1772,6 +1772,11 @@ body:is(.dark *) { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.text-hacking-royal-darker { + --tw-text-opacity: 1; + color: rgb(36 3 101 / var(--tw-text-opacity)); +} + .opacity-20 { opacity: 0.2; } @@ -1976,6 +1981,11 @@ body:is(.dark *) { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.dark\:text-hacking-royal-darker:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(36 3 101 / var(--tw-text-opacity)); +} + .dark\:hover\:text-hacking-violet-lighter:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(143 110 217 / var(--tw-text-opacity)); diff --git a/layouts/partials/components/post-card.html b/layouts/partials/components/post-card.html new file mode 100644 index 0000000..93f65e8 --- /dev/null +++ b/layouts/partials/components/post-card.html @@ -0,0 +1,56 @@ +{{ $showFeaturedImage := and site.Params.show_featured_image_in_list .Params.featured_image }} +
+ {{ if $showFeaturedImage }} +
+
+ {{ end }} +
+ + {{ if .Params.tags }} +
+ {{ range .Params.tags }} + {{ . }} + {{ end }} +
+ {{ end }} + + +

{{ .Title }}

+ + {{ $content := default .Summary .Description | plainify }} +

+ {{ $content | truncate 120 }} +

+
+ + +
+ {{ if .Params.author }} + + By + + {{ .Params.author }} + + + {{ end }} + + + {{ .Date.Format "January 2, 2006" }} + + + {{ if .Params.category }} + Category: {{ .Params.category }} + {{ end }} +
+ + + {{ if .ReadingTime }} +
+ + {{ .ReadingTime }} min read +
+ {{ end }} + + Read more +
+
diff --git a/layouts/partials/components/recent-posts.html b/layouts/partials/components/recent-posts.html index 7624844..0093248 100644 --- a/layouts/partials/components/recent-posts.html +++ b/layouts/partials/components/recent-posts.html @@ -1,60 +1,11 @@

Recent Posts

-
- {{ $posts := where .Site.RegularPages "Section" "posts" }} - {{ range first 6 $posts }} - + {{ $posts := where .Site.RegularPages "Section" "posts" }} + {{ $postCount := len $posts }} +
+ {{ range first (cond (ge $postCount 8) 8 (cond (ge $postCount 4) 4 3)) $posts }} + {{ partial "components/post-card.html" . }} {{ end }}
diff --git a/layouts/posts/list.html b/layouts/posts/list.html index f148473..2068cd8 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -13,56 +13,7 @@

{{ .Title }}

{{ range .Pages }} - + {{ partial "components/post-card.html" . }} {{ end }}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 7f3b9cf..f10c006 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -12,7 +12,7 @@

{{ .Title }}

{{ .Date.Format "January 2, 2006" }} {{ .ReadingTime }} min read {{ with .Params.author }} - By {{ . }} + By {{ . }} {{ end }} {{ with .Params.categories }} In