Update: UniNotes slugs

This commit is contained in:
hyzen
2026-04-10 06:38:21 +05:30
parent 4976376c06
commit bd42342dca
37 changed files with 128 additions and 1759 deletions

View File

@@ -1,14 +1,12 @@
{{ define "main" }}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/uninotes/">UniNotes</a>
</nav>
<h1>UniNotes</h1>
{{/* Pull all semester terms from the taxonomy */}}
{{ $semesterTaxonomy := site.Taxonomies.semester }}
{{ $semesters := $semesterTaxonomy.Alphabetical }}
{{ $semesters := site.Taxonomies.semester.Alphabetical }}
<ul class="uninotes-list">
{{ range $semesters }}
<li class="uninotes-list__item">
@@ -16,4 +14,5 @@
</li>
{{ end }}
</ul>
{{ end }}

View File

@@ -15,7 +15,6 @@
{{ $subjectcode = $subjectcodeRaw }}
{{ end }}
{{/* Breadcrumbs */}}
<nav class="uninotes-breadcrumbs breadcrumbs">
<a href="/uninotes/">UniNotes</a>
{{ if $semester }}
@@ -33,7 +32,6 @@
<span>{{ .Params.unit | default .Title }}</span>
</nav>
{{/* Metadata pills */}}
<div class="uninotes-meta">
{{ with $semester }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }}
{{ with $subjectcode }}<span class="uninotes-meta__pill">{{ . }}</span>{{ end }}
@@ -41,7 +39,6 @@
<h1>{{ .Params.unit | default .Title }}</h1>
{{ partial "main/dates.html" . }}
{{ partial "page/toc.html" . }}
{{ .Content }}
@@ -49,15 +46,15 @@
{{ partial "page/terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ partial "page/terms.html" (dict "taxonomy" "categories" "page" .) }}
{{/* Next/prev: siblings = other posts with same subjectcode, sorted by date */}}
{{/* Next/prev among sibling units in the same subjectcode */}}
{{ if $subjectcode }}
{{ $subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode | urlize)) }}
{{ if $subPage }}
{{ $siblings := $subPage.Pages.ByDate }}
{{ $currentTitle := .Title }}
{{ $siblings := $subPage.Pages.ByWeight }}
{{ $currentPermalink := .RelPermalink }}
{{ $currentIdx := 0 }}
{{ range $i, $p := $siblings }}
{{ if eq $p.Title $currentTitle }}{{ $currentIdx = $i }}{{ end }}
{{ if eq $p.RelPermalink $currentPermalink }}{{ $currentIdx = $i }}{{ end }}
{{ end }}
{{ if gt (len $siblings) 1 }}
<nav class="page-nav">