mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
tags: taxonomy layout with headings all on the left #530
and columned lists like in the terms page for a more concicse look
This commit is contained in:
parent
98cc7904ab
commit
5099b5b73c
3 changed files with 6 additions and 20 deletions
|
@ -8,18 +8,15 @@
|
|||
{{- $title = .Data.Plural | humanize }}
|
||||
{{- end }}
|
||||
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
|
||||
<div class="tax-container">
|
||||
{{- $lastCapital := "" }}
|
||||
{{- range .Data.Terms.Alphabetical }}
|
||||
{{- $capital := substr .Page.Title 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
{{- end }}
|
||||
<div class="tax-box">
|
||||
<h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
|
||||
<ul>
|
||||
<h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
|
||||
<ul class="columnize">
|
||||
{{- end }}
|
||||
{{- $c:=""}}{{/* display terms of a taxonomy */}}
|
||||
{{- $len := 0 }}
|
||||
|
@ -30,15 +27,13 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $len }}
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Page.Title }}</a> ({{ $len }})</li>
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Page.Title }}</a> ({{ $len }})</li>
|
||||
{{- end }}
|
||||
{{- $lastCapital = $capital }}
|
||||
{{- end }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
|
|
|
@ -1760,15 +1760,6 @@ html[dir="rtl"] #sidebar ul.collapsible-menu > li > label > i.fa-chevron-right {
|
|||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
.tax-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tax-box {
|
||||
width: 18rem;
|
||||
}
|
||||
|
||||
.columnize{
|
||||
column-count: 2;
|
||||
}
|
||||
|
|
|
@ -428,7 +428,7 @@ function initOpenapi( update, attrs ){
|
|||
}
|
||||
|
||||
function initAnchorClipboard(){
|
||||
document.querySelectorAll( 'h1~h2,h1~h3,h1~h4,h1~h5,h1~h6,.tax-container h2,.tax-container h3,.tax-container h4,.tax-container h5,.tax-container h6').forEach( function( element ){
|
||||
document.querySelectorAll( 'h1~h2,h1~h3,h1~h4,h1~h5,h1~h6').forEach( function( element ){
|
||||
var url = encodeURI( (document.location.origin == "null" ? (document.location.protocol + "//" + document.location.host) : document.location.origin )+ document.location.pathname);
|
||||
var link = url + "#" + element.id;
|
||||
var new_element = document.createElement( 'span' );
|
||||
|
|
Loading…
Reference in a new issue