-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: Fri Nov 22 09:16:08 PM UTC 2024 - Updated the recent posts an…
…d posts list to use a reusable card component
- Loading branch information
Showing
5 changed files
with
73 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{{ $showFeaturedImage := and site.Params.show_featured_image_in_list .Params.featured_image }} | ||
<div class="relative shadow-lg rounded-lg overflow-hidden h-full {{ if $showFeaturedImage }}bg-transparent{{ else }}bg-white dark:bg-hacking-slate{{ end }}"> | ||
{{ if $showFeaturedImage }} | ||
<div class="absolute inset-0 bg-cover bg-center z-0" style="background-image: url('{{ .Params.featured_image }}');"></div> | ||
<div class="absolute inset-0 bg-black opacity-70 z-10"></div> | ||
{{ end }} | ||
<div class="relative z-20 p-6 flex flex-col h-full"> | ||
<!-- Tags at the top --> | ||
{{ if .Params.tags }} | ||
<div class="mb-4 flex flex-wrap"> | ||
{{ range .Params.tags }} | ||
<a href="/tags/{{ . | urlize }}" class="inline-block bg-hacking-violet text-white text-xs px-2 py-1 rounded mr-2 mb-2">{{ . }}</a> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
|
||
<a href="{{ .RelPermalink }}" class="block flex-grow"> | ||
<h3 class="text-xl font-semibold mb-2 {{ if $showFeaturedImage }}text-white{{ else }}text-hacking-midnight dark:text-white{{ end }} hover:text-hacking-violet dark:hover:text-hacking-violet-lighter transition duration-300">{{ .Title }}</h3> | ||
|
||
{{ $content := default .Summary .Description | plainify }} | ||
<p class="{{ if $showFeaturedImage }}text-white{{ else }}text-neutral-600 dark:text-neutral-300{{ end }} mb-4"> | ||
{{ $content | truncate 120 }} | ||
</p> | ||
</a> | ||
|
||
<!-- Author, Date and Category --> | ||
<div class="flex flex-wrap items-center text-sm {{ if $showFeaturedImage }}text-neutral-300{{ else }}text-neutral-500{{ end }} mb-4"> | ||
{{ if .Params.author }} | ||
<span class="font-bold text-lg mr-4"> | ||
By | ||
<a href="/authors/{{ .Params.author | urlize }}" class="text-hacking-royal-lighter hover:text-hacking-violet dark:hover:text-hacking-violet-lighter transition duration-300"> | ||
{{ .Params.author }} | ||
</a> | ||
</span> | ||
{{ end }} | ||
|
||
<span class="mr-4"> | ||
{{ .Date.Format "January 2, 2006" }} | ||
</span> | ||
|
||
{{ if .Params.category }} | ||
<span class="mr-4">Category: <span class="font-semibold">{{ .Params.category }}</span></span> | ||
{{ end }} | ||
</div> | ||
|
||
<!-- Reading Time --> | ||
{{ if .ReadingTime }} | ||
<div class="flex items-center text-sm {{ if $showFeaturedImage }}text-neutral-300{{ else }}text-neutral-500{{ end }}"> | ||
<span class="icon-[mdi-light--clock] w-4 h-4 mr-1"></span> | ||
<span>{{ .ReadingTime }} min read</span> | ||
</div> | ||
{{ end }} | ||
|
||
<span class="text-hacking-royal-lighter hover:underline mt-4">Read more</span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters