refactor: split single header and meta components into partials

This commit is contained in:
Ben Goldsworthy 2025-01-27 23:34:33 +01:00
parent d0577aec91
commit e6889cabba
No known key found for this signature in database
22 changed files with 742 additions and 406 deletions

View file

@ -0,0 +1,30 @@
{{- /*
Displays the skills for an item.
@params pc The page context.
@params skills The item's skills
@params skills_ciisec_levels The matched CIISec levels for the skills. Optional.
*/
-}}
<section
class="article-footer__links"
itemprop="articleSection"
>
<h3 id="item-skills-title">Skills</h3>
<ul>
{{- .pc.Scratch.Set "i" 0 -}}
{{- range .skills.ByTitle -}}
{{- if hasPrefix .LinkTitle "CIISec/" -}}
<li class="p-category">
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
<span class="level">(level {{ index $.skills_ciisec_levels ( $.pc.Scratch.Get "i" ) }})</span>
</li>
{{- $.pc.Scratch.Add "i" 1 -}}
{{- else -}}
<li class="p-category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{- end -}}
{{- end -}}
</ul>
</section>