mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
♻️ refactor article links, cards, and recent articles partials
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
{{ end }}
|
||||
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
|
||||
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
||||
{{ partial "article-meta-list.html" (dict "context" . "scope" "single") }}
|
||||
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
|
||||
</div>
|
||||
</header>
|
||||
<section class="{{ if $toc -}}
|
||||
@@ -59,7 +59,7 @@
|
||||
</h2>
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
@@ -74,7 +74,7 @@
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -84,7 +84,7 @@
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
@@ -102,7 +102,7 @@
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{ .Title | emojify }}
|
||||
</h1>
|
||||
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
||||
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
|
||||
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
|
||||
</div>
|
||||
</header>
|
||||
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{ end }}
|
||||
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
|
||||
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
||||
{{ partial "article-meta-taxonomy.html" (dict "context" . "scope" "single") }}
|
||||
{{ partial "article-meta/taxonomy.html" (dict "context" . "scope" "single") }}
|
||||
</div>
|
||||
</header>
|
||||
{{ if .Content }}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{{ end }}
|
||||
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
|
||||
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
||||
{{ partial "article-meta-term.html" (dict "context" . "scope" "single") }}
|
||||
{{ partial "article-meta/term.html" (dict "context" . "scope" "single") }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</h2>
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
@@ -68,7 +68,7 @@
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -78,7 +78,7 @@
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
@@ -96,7 +96,7 @@
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
@@ -108,7 +108,7 @@
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
{{ end }}
|
||||
|
||||
<div class="text-sm text-neutral-500 dark:text-neutral-400">
|
||||
{{ partial "article-meta.html" . }}
|
||||
{{ partial "article-meta/basic.html" . }}
|
||||
</div>
|
||||
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
@@ -69,7 +69,7 @@
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="text-sm text-neutral-500 dark:text-neutral-400">
|
||||
{{ partial "article-meta.html" . }}
|
||||
{{ partial "article-meta/basic.html" . }}
|
||||
</div>
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
<div class="py-1 prose dark:prose-invert">
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles.html" . }}
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
{{ if .Site.Params.homepage.layoutBackgroundBlur | default false }}
|
||||
<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
|
||||
|
||||
@@ -27,5 +27,5 @@
|
||||
</div>
|
||||
</div>
|
||||
<section>
|
||||
{{ partial "recent-articles.html" . }}
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
@@ -51,5 +51,5 @@
|
||||
</div>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles.html" . }}
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
@@ -7,5 +7,5 @@
|
||||
<section>{{ .Content | emojify }}</section>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles.html" . }}
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
|
||||
@@ -32,5 +32,5 @@
|
||||
<section class="prose dark:prose-invert">{{ .Content | emojify }}</section>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles.html" . }}
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
|
||||
.Site.Params.mainSections)).Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
+1
-1
@@ -4,6 +4,6 @@
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
|
||||
.Site.Params.mainSections)).Pages }}
|
||||
{{ partial "article-link-card.html" . }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
+1
-1
@@ -4,6 +4,6 @@
|
||||
<section class="space-y-10 w-full">
|
||||
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages
|
||||
}}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
@@ -7,11 +7,11 @@
|
||||
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
|
||||
|
||||
{{ if and .Site.Params.homepage.cardView (not .Site.Params.homepage.cardViewScreenWidth) | default false }}
|
||||
{{ partial "recent-articles-cardview.html" . }}
|
||||
{{ partial "recent-articles/cardview.html" . }}
|
||||
{{ else if and .Site.Params.homepage.cardView .Site.Params.homepage.cardViewScreenWidth | default false }}
|
||||
{{ partial "recent-articles-cardview-fullwidth.html" . }}
|
||||
{{ partial "recent-articles/cardview-fullwidth.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "recent-articles-list.html" . }}
|
||||
{{ partial "recent-articles/list.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.homepage.showMoreLink | default false }}
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ $RelPermalink := .Get "link" }}
|
||||
{{ range ( where .Site.RegularPages "RelPermalink" $RelPermalink | first 1 ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
</section>
|
||||
@@ -8,13 +8,13 @@
|
||||
{{ if $where }}
|
||||
{{ range ( where .Site.RegularPages $where $value | first 1 ) }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ else }}
|
||||
{{ range .Site.RegularPages | first $limit }}
|
||||
{{ if not (eq .RelPermalink $parent) }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user