mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-04-15 21:28:32 +02:00
Update: UniNotes slugs
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
<h1>{{ $semesterName }}</h1>
|
||||
|
||||
{{/* Collect unique subject codes from posts tagged with this semester */}}
|
||||
{{/* Collect unique subject codes from posts in this semester */}}
|
||||
{{ $subjectCodes := slice }}
|
||||
{{ range .Pages }}
|
||||
{{ $raw := .Params.subjectcode }}
|
||||
@@ -23,7 +23,6 @@
|
||||
{{ $subjectCodes = $subjectCodes | append $code }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $subjectCodes = sort $subjectCodes }}
|
||||
|
||||
<ol class="uninotes-list uninotes-list--subjects">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{{ $subjectCode := .Title }}
|
||||
|
||||
{{/* Find which semester this subject belongs to */}}
|
||||
{{/* Get semester from first post */}}
|
||||
{{ $semester := "" }}
|
||||
{{ range .Pages }}
|
||||
{{ if eq $semester "" }}
|
||||
@@ -15,7 +15,6 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Breadcrumbs */}}
|
||||
<nav class="uninotes-breadcrumbs breadcrumbs">
|
||||
<a href="/uninotes/">UniNotes</a>
|
||||
{{ if $semester }}
|
||||
@@ -29,9 +28,8 @@
|
||||
|
||||
<h1>{{ $subjectCode }}</h1>
|
||||
|
||||
{{/* List units sorted by date */}}
|
||||
<ul class="uninotes-list uninotes-list--units">
|
||||
{{ range .Pages.ByDate }}
|
||||
{{ range .Pages.ByWeight }}
|
||||
<li class="uninotes-list__item">
|
||||
<a class="uninotes-list__link" href="{{ .RelPermalink }}">
|
||||
{{ with .Params.unit }}{{ . }}{{ else }}{{ .Title }}{{ end }}
|
||||
@@ -40,7 +38,7 @@
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{/* Subject prev/next — siblings are other subjectcodes in the same semester */}}
|
||||
{{/* Subject prev/next — siblings in same semester */}}
|
||||
{{ if $semester }}
|
||||
{{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
|
||||
{{ if $semPage }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user