converts tags to topics

This commit is contained in:
Drew
2025-04-07 15:41:29 -06:00
parent 75114cdbbe
commit 67866adb1a
15 changed files with 27 additions and 27 deletions

View File

@ -4,7 +4,7 @@ title = 'Protocol Oral History Project'
theme = "hugo-starter-tailwind-basic"
[taxonomies]
tag = "tags"
topics = "topics"
narrator = "narrator"
facilitator = "facilitator"

View File

@ -6,7 +6,7 @@ date: 2025-03-18
approved: 2025-03-20
summary: "Drawing on many ancestral traditions and the experience of her own body, Asia Dorsey learns and teaches the pattern language of a healthy gut."
location: "Denver CO"
tags: [ancestors, food, health, indigeneity]
topics: [ancestors, food, health, indigeneity]
headshot: "/headshots/placeholder-headshot.png"
links:
- text: "Bugs Bones & Botany"

View File

@ -7,7 +7,7 @@ approved: 2024-10-11
summary: "After widespread resistance to codes of conduct in open-source software communities, Coraline Ada Ehmke's Contributor Covenant became the most popular code of conduct in the ecosystem."
location: "Chicago, USA"
headshot: "/headshots/placeholder-headshot.png"
tags: [code of conduct, dispute resolution, gender, open source, organizations, software]
topics: [code of conduct, dispute resolution, gender, open source, organizations, software]
---
*First of all, I want to begin with the question of how you how you prefer to introduce yourself.*

View File

@ -7,7 +7,7 @@ approved: 2024-12-16
summary: "Good Market is a digital commons for enterprises that prioritize people and the planet over profit. It enables communities to set and enforce their own standards for doing business."
location: "Sri Lanka / United States"
headshot: "/headshots/placeholder-headshot.png"
tags: [economics, organizations, ecology, standards]
topics: [economics, organizations, ecology, standards]
---
*I want to begin with the question of how you like to introduce yourself. How do you introduce yourself to somebody you've just met? Where do you begin?*

View File

@ -7,7 +7,7 @@ approved: 2025-02-11
summary: "Constructed languages, or conlangs, are the basis of a hobby, a science, and a community that now occupies a small corner of the entertainment industry."
location: "Wellington, NZ"
headshot: "/headshots/placeholder-headshot.png"
tags: [fiction, gender, language, open source, software]
topics: [fiction, gender, language, open source, software]
---
*Can you tell me a bit about how you like to introduce yourself?*

View File

@ -7,7 +7,7 @@ approved: 2025-03-04
summary: "A diplomat for Bangladesh describes the role of protocol in high-profile international visits and treaty negotiations."
location: "Dhaka, Bangladesh"
headshot: "/headshots/placeholder-headshot.png"
tags: [diplomacy, government, friendship]
topics: [diplomacy, government, friendship]
---
*How do you introduce yourself?*

View File

@ -12,7 +12,7 @@ links:
url: https://evanp.me/
- text: "ActivityPub: Programming the Social Web"
url: https://www.oreilly.com/library/view/activitypub/9781098162733/
tags: [decentralization, open source, organizations, social media, software, standards]
topics: [decentralization, open source, organizations, social media, software, standards]
---
*How do you introduce yourself?*

View File

@ -7,7 +7,7 @@ approved: 2024-12-02
summary: "As a sport often played with no referees, ultimate frisbee has developed a strong set of norms for addressing conflict and self-governing."
location: "East Greenbush, NY USA"
headshot: "/headshots/placeholder-headshot.png"
tags: [frisbee, sports, organizations, dispute resolution]
topics: [frisbee, sports, organizations, dispute resolution]
---
*How do you like to introduce yourself to people as you encounter them in the world?*

View File

@ -30,8 +30,8 @@
{{ end }}
<meta name="description" content="{{ $description }}" />
{{/* Generate keywords from tags */}}
{{ with .Params.tags }}
{{/* Generate keywords from topics */}}
{{ with .Params.topics }}
<meta name="keywords" content="{{ delimit . ", " }}" />
{{ end }}
@ -60,14 +60,14 @@
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" />
<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}" />
<meta property="article:section" content="Oral History" />
{{ with .Params.tags }}
{{ with .Params.topics }}
{{ range . }}
<meta property="article:tag" content="{{ . }}" />
{{ end }}
{{ end }}
{{/* Author information using standard meta tags instead of article:author */}}
{{/* Author information using standard meta topics instead of article:author */}}
{{ with .Params.narrator }}
<meta name="author" content="{{ . }}" />
{{ end }}

View File

@ -9,7 +9,7 @@
</ul>
<section>
<h2 class="text-4xl my-8 font-bold text-center">Other {{ .Data.Plural | title }}</h2>
<h2 class="text-4xl my-8 font-bold text-center">Other {{ .Data.Plural }}</h2>
<div class="tag-cloud font-iosevka text-gray-600 text-center">
{{ $terms := index .Site.Taxonomies .Data.Plural }}
{{ range $term, $pages := $terms }}

View File

@ -20,7 +20,7 @@
{{ if .Params.location }}
<p><strong>Location:</strong> {{ .Params.location }}</p>
{{ end }}
<p><strong>Topics:</strong> {{ partial "tags.html" . }}</p>
<p><strong>Topics:</strong> {{ partial "topics.html" . }}</p>
{{ if .Params.links }}
<div class="mt-4">
<p><strong>Narrator Links:</strong></p>
@ -41,7 +41,7 @@
</div>
</article>
<aside class="max-w-screen-xl mx-auto px-4 lg:px-0">
{{ partial "related-articles" (dict "page" . "tags" .Params.tags "limit" 3) }}
{{ partial "related-articles" (dict "page" . "topics" .Params.topics "limit" 3) }}
</aside>
<div class="text-center my-12"><a href="/">Go Home</a></div>
{{ end }}

View File

@ -14,9 +14,9 @@
<section>
<h2 class="text-2xl mb-4 font-bold">Topics</h2>
<div class="tag-cloud font-iosevka text-gray-600 text-sm">
{{ $tags := .Site.Taxonomies.tags }}
{{ range $tag, $pages := $tags }}
<a href="{{ "/tags/" | relLangURL }}{{ $tag | urlize }}" style="font-size: {{ add 1 (div (len $pages) 2) }}em;" data-count="{{ len $pages}}"
{{ $topics := .Site.Taxonomies.topics }}
{{ range $tag, $pages := $topics }}
<a href="{{ "/topics/" | relLangURL }}{{ $tag | urlize }}" style="font-size: {{ add 1 (div (len $pages) 2) }}em;" data-count="{{ len $pages}}"
class="tag inline-block p-2 my-1 border border-gray-100 rounded-lg hover:bg-yellow-100 whitespace-nowrap">
{{ $tag }}
</a>

View File

@ -17,7 +17,7 @@
<p class="text-gray-800 italic">{{ $page.Params.location }}</p>
{{ end }}
<p class="max-w-prose">{{ $page.Params.summary }}</p>
{{ partial "tags.html" $page }}
{{ partial "topics.html" $page }}
</div>
</li>
{{ end }}

View File

@ -1,15 +1,15 @@
{{- $tags := .tags -}}
{{- $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 tags */}}
{{/* First try to find articles with matching topics */}}
{{- range $related -}}
{{- $matches := 0 -}}
{{- range .Params.tags -}}
{{- if in $tags . -}}
{{- range .Params.topics -}}
{{- if in $topics . -}}
{{- $matches = add $matches 1 -}}
{{- end -}}
{{- end -}}
@ -18,7 +18,7 @@
{{- end -}}
{{- end -}}
{{/* If we found matching articles, sort by number of matching tags */}}
{{/* 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") -}}

View File

@ -1,7 +1,7 @@
{{- if .Params.tags }}
{{- if .Params.topics }}
<div class="flex flex-wrap gap-2 my-2 text-xs font-iosevka">
{{- range .Params.tags }}
<a href="{{ "tags/" | relURL }}{{ . | urlize }}"
{{- range .Params.topics }}
<a href="{{ "topics/" | relURL }}{{ . | urlize }}"
class="px-3 py-1 border border-green-100 hover:bg-green-300 text-green-900 rounded no-underline">
{{ . }}
</a>