mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
tags: leverage space in taxonomy layout #530
This commit is contained in:
parent
922922cf94
commit
55549897c5
8 changed files with 54 additions and 10 deletions
|
@ -1,4 +1,5 @@
|
||||||
+++
|
+++
|
||||||
|
tags = ["documentation"]
|
||||||
title = "Installation"
|
title = "Installation"
|
||||||
weight = 15
|
weight = 15
|
||||||
+++
|
+++
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
+++
|
+++
|
||||||
|
tags = ["documentat'n"]
|
||||||
title = "Installat'n"
|
title = "Installat'n"
|
||||||
weight = 15
|
weight = 15
|
||||||
+++
|
+++
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
+++
|
+++
|
||||||
|
tags = ["content"]
|
||||||
title = "Markdown syntax"
|
title = "Markdown syntax"
|
||||||
weight = 3
|
weight = 3
|
||||||
+++
|
+++
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
+++
|
+++
|
||||||
|
tags = ["content"]
|
||||||
title = "Marrrkdown rules"
|
title = "Marrrkdown rules"
|
||||||
weight = 3
|
weight = 3
|
||||||
+++
|
+++
|
||||||
|
|
|
@ -1,8 +1,23 @@
|
||||||
<div class="default-animation progress">
|
<div class="default-animation progress">
|
||||||
<div class="toc-wrapper">
|
<div class="toc-wrapper">
|
||||||
{{- partial "shortcodes/piratify.html" (dict
|
{{- if eq .Kind "taxonomy" }}
|
||||||
"context" .
|
<nav id="TableOfContents">
|
||||||
"pagefield" "TableOfContents"
|
<ul>
|
||||||
) }}
|
{{- $lastCapital := "" }}
|
||||||
|
{{- range .Data.Terms.Alphabetical }}
|
||||||
|
{{- $capital := substr .Page.Title 0 1 | upper }}
|
||||||
|
{{- if ne $lastCapital $capital }}
|
||||||
|
<li><a href="#{{ $capital | anchorize }}">{{ $capital }}</a></li>
|
||||||
|
{{- end }}
|
||||||
|
{{- $lastCapital = $capital }}
|
||||||
|
{{- end }}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{{- else }}
|
||||||
|
{{- partial "shortcodes/piratify.html" (dict
|
||||||
|
"context" .
|
||||||
|
"pagefield" "TableOfContents"
|
||||||
|
) }}
|
||||||
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -8,8 +8,19 @@
|
||||||
{{- $title = .Data.Plural | humanize }}
|
{{- $title = .Data.Plural | humanize }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
|
<h1 id="{{ $title | anchorize }}">{{ $title }}</h1>
|
||||||
<ul>
|
<div class="tax-container">
|
||||||
{{- range .Data.Terms.Alphabetical }}
|
{{- $lastCapital := "" }}
|
||||||
|
{{- range .Data.Terms.Alphabetical }}
|
||||||
|
{{- $capital := substr .Page.Title 0 1 | upper }}
|
||||||
|
{{- if ne $lastCapital $capital }}
|
||||||
|
{{- if ne $lastCapital "" }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
<div class="tax-box">
|
||||||
|
<h2 id="{{ $capital | anchorize }}">{{ $capital }}</h2>
|
||||||
|
<ul>
|
||||||
|
{{- end }}
|
||||||
{{- $c:=""}}{{/* display terms of a taxonomy */}}
|
{{- $c:=""}}{{/* display terms of a taxonomy */}}
|
||||||
{{- $len := 0 }}
|
{{- $len := 0 }}
|
||||||
{{- range .Pages }}
|
{{- range .Pages }}
|
||||||
|
@ -19,10 +30,15 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $len }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- $lastCapital = $capital }}
|
||||||
</ul>
|
{{- end }}
|
||||||
|
{{- if ne $lastCapital "" }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<footer class="footline">
|
<footer class="footline">
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -1759,3 +1759,12 @@ article ul > li > input[type="checkbox"]:checked::before {
|
||||||
html[dir="rtl"] #sidebar ul.collapsible-menu > li > label > i.fa-chevron-right {
|
html[dir="rtl"] #sidebar ul.collapsible-menu > li > label > i.fa-chevron-right {
|
||||||
transform: scaleX(-1);
|
transform: scaleX(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tax-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tax-box {
|
||||||
|
width: 18rem;
|
||||||
|
}
|
||||||
|
|
|
@ -428,7 +428,7 @@ function initOpenapi( update, attrs ){
|
||||||
}
|
}
|
||||||
|
|
||||||
function initAnchorClipboard(){
|
function initAnchorClipboard(){
|
||||||
document.querySelectorAll( 'h1~h2,h1~h3,h1~h4,h1~h5,h1~h6').forEach( function( element ){
|
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 ){
|
||||||
var url = encodeURI( (document.location.origin == "null" ? (document.location.protocol + "//" + document.location.host) : document.location.origin )+ document.location.pathname);
|
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 link = url + "#" + element.id;
|
||||||
var new_element = document.createElement( 'span' );
|
var new_element = document.createElement( 'span' );
|
||||||
|
|
Loading…
Reference in a new issue