mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-09-19 02:23:17 +02:00
Fix: uninotes subject code url
This commit is contained in:
@@ -45,11 +45,12 @@
|
||||
|
||||
{{ if $sortedCodeDicts }}
|
||||
<div class="uninotes-contents__semester">
|
||||
<a class="uninotes-contents__sem-link" href="{{ .Page.RelPermalink }}">{{ $semName }}</a>
|
||||
{{ $semUrl := .Page.RelPermalink }}
|
||||
<a class="uninotes-contents__sem-link" href="{{ $semUrl }}">{{ $semName }}</a>
|
||||
|
||||
{{ range $sortedCodeDicts }}
|
||||
{{ $code := .code }}
|
||||
{{ $subPage := site.GetPage (printf "/subjectcode/%s" ($code | urlize)) }}
|
||||
{{ $subjectUrl := printf "%s%s/" $semUrl ($code | urlize) }}
|
||||
|
||||
{{/* Collect one representative page per unit for this subject, then sort numerically */}}
|
||||
{{ $unitDicts := slice }}
|
||||
@@ -78,11 +79,7 @@
|
||||
{{ $sortedUnitDicts := sort $unitDicts "num" }}
|
||||
|
||||
<div class="uninotes-contents__subject">
|
||||
{{ if $subPage }}
|
||||
<a class="uninotes-contents__subject-link" href="{{ $subPage.RelPermalink }}">{{ $code }}</a>
|
||||
{{ else }}
|
||||
<span class="uninotes-contents__subject-link">{{ $code }}</span>
|
||||
{{ end }}
|
||||
<a class="uninotes-contents__subject-link" href="{{ $subjectUrl }}">{{ $code }}</a>
|
||||
<ul class="uninotes-contents__units">
|
||||
{{ range $sortedUnitDicts }}
|
||||
{{ $unitLabel := .label }}
|
||||
|
||||
@@ -8,9 +8,11 @@ $subjectcode = $subjectcodeRaw }} {{ end }}
|
||||
<a href="/uninotes/">UniNotes</a>
|
||||
{{ if $semester }} {{ $semPage := site.GetPage (printf "/semester/%s" ($semester | urlize)) }}
|
||||
{{ if $semPage }} › <a href="{{ $semPage.RelPermalink }}">{{ $semester }}</a> {{ end }} {{ end
|
||||
}} {{ if $subjectcode }} {{ $subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode |
|
||||
urlize)) }} {{ if $subPage }} › <a href="{{ $subPage.RelPermalink }}">{{ $subjectcode }}</a> {{
|
||||
end }} {{ end }} {{ if .Params.uniturl }} ›
|
||||
}} {{ if $subjectcode }} {{ if $semester }} › <a
|
||||
href="{{ printf "/uninotes/%s/%s/" ($semester | urlize) ($subjectcode | urlize) }}"
|
||||
>{{ $subjectcode }}</a
|
||||
>
|
||||
{{ end }} {{ end }} {{ if .Params.uniturl }} ›
|
||||
<a href="{{ .Params.uniturl }}">{{ .Params.unit | default .Title }}</a> ›
|
||||
<span>{{ .Params.notecategory | default "Notes" }}</span> {{ else }} ›
|
||||
<span>{{ .Params.unit | default .Title }}</span>
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $subjectcode }}
|
||||
{{ $subPage := site.GetPage (printf "/subjectcode/%s" ($subjectcode | urlize)) }}
|
||||
{{ if $subPage }}
|
||||
› <a href="{{ $subPage.RelPermalink }}">{{ $subjectcode }}</a>
|
||||
{{ if $semester }}
|
||||
› <a href="{{ printf "/uninotes/%s/%s/" ($semester | urlize) ($subjectcode | urlize) }}">{{ $subjectcode }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
› <span>{{ .Params.unit | default .Title }}</span>
|
||||
|
||||
Reference in New Issue
Block a user