Skip to content

Commit 5099b5b

Browse files
committed
tags: taxonomy layout with headings all on the left matcornic#530
and columned lists like in the terms page for a more concicse look
1 parent 98cc790 commit 5099b5b

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

layouts/_default/taxonomy.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@
88
{{- $title = .Data.Plural | humanize }}
99
{{- end }}
1010
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
11-
<div class="tax-container">
1211
{{- $lastCapital := "" }}
1312
{{- range .Data.Terms.Alphabetical }}
1413
{{- $capital := substr .Page.Title 0 1 | upper }}
1514
{{- if ne $lastCapital $capital }}
1615
{{- if ne $lastCapital "" }}
17-
</ul>
18-
</div>
16+
</ul>
1917
{{- end }}
20-
<div class="tax-box">
21-
<h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
22-
<ul>
18+
<h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
19+
<ul class="columnize">
2320
{{- end }}
2421
{{- $c:=""}}{{/* display terms of a taxonomy */}}
2522
{{- $len := 0 }}
@@ -30,15 +27,13 @@ <h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
3027
{{- end }}
3128
{{- end }}
3229
{{- if $len }}
33-
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Page.Title }}</a> ({{ $len }})</li>
30+
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Page.Title }}</a> ({{ $len }})</li>
3431
{{- end }}
3532
{{- $lastCapital = $capital }}
3633
{{- end }}
3734
{{- if ne $lastCapital "" }}
38-
</ul>
39-
</div>
35+
</ul>
4036
{{- end }}
41-
</div>
4237

4338
<footer class="footline">
4439
</footer>

static/css/theme.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,15 +1760,6 @@ html[dir="rtl"] #sidebar ul.collapsible-menu > li > label > i.fa-chevron-right {
17601760
transform: scaleX(-1);
17611761
}
17621762

1763-
.tax-container {
1764-
display: flex;
1765-
flex-wrap: wrap;
1766-
}
1767-
1768-
.tax-box {
1769-
width: 18rem;
1770-
}
1771-
17721763
.columnize{
17731764
column-count: 2;
17741765
}

static/js/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ function initOpenapi( update, attrs ){
428428
}
429429

430430
function initAnchorClipboard(){
431-
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 ){
431+
document.querySelectorAll( 'h1~h2,h1~h3,h1~h4,h1~h5,h1~h6').forEach( function( element ){
432432
var url = encodeURI( (document.location.origin == "null" ? (document.location.protocol + "//" + document.location.host) : document.location.origin )+ document.location.pathname);
433433
var link = url + "#" + element.id;
434434
var new_element = document.createElement( 'span' );

0 commit comments

Comments
 (0)