Converted 'article' nomenclature to 'interview'
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
{{- if and .Params.narrator .Params.subject -}}
|
||||
<span class="article-title__narrator">{{- .Params.narrator }}</span> <span class="article-title__subject">{{ .Params.subject -}}</span>
|
||||
{{- end -}}
|
@ -6,7 +6,7 @@
|
||||
{{- end -}}
|
||||
<li class="group flex md:flex-row flex-col md:gap-4 gap-2 md:items-center">
|
||||
<div class="flex-1 min-w-0 flex gap-2 items-center h-full">
|
||||
<a class="wompum-container h-full aspect-7/2 md:aspect-auto" href="{{ $page.RelPermalink }}">{{ partial "article-wompum.html" $page }}</a>
|
||||
<a class="wompum-container h-full aspect-7/2 md:aspect-auto" href="{{ $page.RelPermalink }}">{{ partial "interview-wompum.html" $page }}</a>
|
||||
<time class="text-gray-800 dark:text-sand-500 font-iosevka w-12 flex-shrink-0" datetime="{{ $page.Date.Format "2006-01-02" }}">
|
||||
<p>{{ $page.Date.Format "Jan" }}</p>
|
||||
<p>{{ $page.Date.Format "02" }}</p>
|
||||
@ -14,7 +14,7 @@
|
||||
</time>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 md:w-3/5 flex-shrink-0 md:py-8">
|
||||
<a class="article-title article-title--list" href="{{ $page.RelPermalink }}">{{ partial "article-title" $page }}</a>
|
||||
<a class="interview-title interview-title--list" href="{{ $page.RelPermalink }}">{{ partial "interview-title" $page }}</a>
|
||||
{{ if $page.Params.location }}
|
||||
<p class="light:text-gray-800 dark:text-sand-100 italic">{{ $page.Params.location }}</p>
|
||||
{{ end }}
|
3
layouts/partials/interview-title.html
Normal file
3
layouts/partials/interview-title.html
Normal file
@ -0,0 +1,3 @@
|
||||
{{- if and .Params.narrator .Params.subject -}}
|
||||
<span class="interview-title__narrator">{{- .Params.narrator }}</span> <span class="interview-title__subject">{{ .Params.subject -}}</span>
|
||||
{{- end -}}
|
@ -1,4 +1,4 @@
|
||||
<div class="wompum-article-grid"
|
||||
<div class="wompum-interview-grid"
|
||||
data-metadata="{{ dict "narrator" .Params.narrator "subject" .Params.subject "facilitator" .Params.facilitator | jsonify }}"
|
||||
data-columns="7"
|
||||
data-rows="5">
|
@ -1,40 +0,0 @@
|
||||
{{- $topics := .topics -}}
|
||||
{{- $limit := default 3 .limit -}}
|
||||
{{- $currentPath := .page.RelPermalink -}}
|
||||
|
||||
{{- $related := where (where site.RegularPages "Type" "articles") "RelPermalink" "!=" $currentPath -}}
|
||||
{{- $matchingArticles := slice -}}
|
||||
|
||||
{{/* First try to find articles with matching topics */}}
|
||||
{{- range $related -}}
|
||||
{{- $matches := 0 -}}
|
||||
{{- range .Params.topics -}}
|
||||
{{- if in $topics . -}}
|
||||
{{- $matches = add $matches 1 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if gt $matches 0 -}}
|
||||
{{- $matchingArticles = $matchingArticles | append (dict "page" . "matches" $matches) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* If we found matching articles, sort by number of matching topics */}}
|
||||
{{- $finalArticles := slice -}}
|
||||
{{- if gt (len $matchingArticles) 0 -}}
|
||||
{{- $finalArticles = first $limit (sort $matchingArticles "matches" "desc") -}}
|
||||
{{- else -}}
|
||||
{{/* Fallback to showing other articles sorted by date */}}
|
||||
{{- $finalArticles = first $limit (sort $related "Date" "desc") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if gt (len $finalArticles) 0 -}}
|
||||
<div class="related-articles flex flex-wrap gap-4">
|
||||
<h2 class="title text-3xl font-bold">Related Articles</h2>
|
||||
<div class="wompum-container wompum-container--no-gap">
|
||||
<div class="wompum-grid" data-text="Related Articles" data-columns="8" data-rows="1"></div>
|
||||
</div>
|
||||
<ul class="flex flex-col gap-4 w-full">
|
||||
{{ partial "article-list" (dict "Pages" $finalArticles) }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- end -}}
|
40
layouts/partials/related-interviews.html
Normal file
40
layouts/partials/related-interviews.html
Normal file
@ -0,0 +1,40 @@
|
||||
{{- $topics := .topics -}}
|
||||
{{- $limit := default 3 .limit -}}
|
||||
{{- $currentPath := .page.RelPermalink -}}
|
||||
|
||||
{{- $related := where (where site.RegularPages "Type" "interviews") "RelPermalink" "!=" $currentPath -}}
|
||||
{{- $matchingInterviews := slice -}}
|
||||
|
||||
{{/* First try to find interviews with matching topics */}}
|
||||
{{- range $related -}}
|
||||
{{- $matches := 0 -}}
|
||||
{{- range .Params.topics -}}
|
||||
{{- if in $topics . -}}
|
||||
{{- $matches = add $matches 1 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if gt $matches 0 -}}
|
||||
{{- $matchingInterviews = $matchingInterviews | append (dict "page" . "matches" $matches) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* If we found matching interviews, sort by number of matching topics */}}
|
||||
{{- $finalInterviews := slice -}}
|
||||
{{- if gt (len $matchingInterviews) 0 -}}
|
||||
{{- $finalInterviews = first $limit (sort $matchingInterviews "matches" "desc") -}}
|
||||
{{- else -}}
|
||||
{{/* Fallback to showing other interviews sorted by date */}}
|
||||
{{- $finalInterviews = first $limit (sort $related "Date" "desc") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if gt (len $finalInterviews) 0 -}}
|
||||
<div class="related-interviews flex flex-wrap gap-4">
|
||||
<h2 class="title text-3xl font-bold">Related Interviews</h2>
|
||||
<div class="wompum-container wompum-container--no-gap">
|
||||
<div class="wompum-grid" data-text="Related Interviews" data-columns="8" data-rows="1"></div>
|
||||
</div>
|
||||
<ul class="flex flex-col gap-4 w-full">
|
||||
{{ partial "interview-list" (dict "Pages" $finalInterviews) }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- end -}}
|
Reference in New Issue
Block a user