From 55549897c54b559483951ed07b60b953120f66ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 19 May 2023 09:54:14 +0200 Subject: [PATCH] tags: leverage space in taxonomy layout #530 --- .../content/basics/installation/_index.en.md | 1 + .../content/basics/installation/_index.pir.md | 1 + exampleSite/content/cont/markdown.en.md | 1 + exampleSite/content/cont/markdown.pir.md | 1 + exampleSite/layouts/partials/toc.html | 23 +++++++++++++--- layouts/_default/taxonomy.html | 26 +++++++++++++++---- static/css/theme.css | 9 +++++++ static/js/theme.js | 2 +- 8 files changed, 54 insertions(+), 10 deletions(-) diff --git a/exampleSite/content/basics/installation/_index.en.md b/exampleSite/content/basics/installation/_index.en.md index cf24f57379..6a3110640f 100644 --- a/exampleSite/content/basics/installation/_index.en.md +++ b/exampleSite/content/basics/installation/_index.en.md @@ -1,4 +1,5 @@ +++ +tags = ["documentation"] title = "Installation" weight = 15 +++ diff --git a/exampleSite/content/basics/installation/_index.pir.md b/exampleSite/content/basics/installation/_index.pir.md index c23fc58cd7..a45457f794 100644 --- a/exampleSite/content/basics/installation/_index.pir.md +++ b/exampleSite/content/basics/installation/_index.pir.md @@ -1,4 +1,5 @@ +++ +tags = ["documentat'n"] title = "Installat'n" weight = 15 +++ diff --git a/exampleSite/content/cont/markdown.en.md b/exampleSite/content/cont/markdown.en.md index fd714f4294..8465512130 100644 --- a/exampleSite/content/cont/markdown.en.md +++ b/exampleSite/content/cont/markdown.en.md @@ -1,4 +1,5 @@ +++ +tags = ["content"] title = "Markdown syntax" weight = 3 +++ diff --git a/exampleSite/content/cont/markdown.pir.md b/exampleSite/content/cont/markdown.pir.md index a250605408..59eea7d2de 100644 --- a/exampleSite/content/cont/markdown.pir.md +++ b/exampleSite/content/cont/markdown.pir.md @@ -1,4 +1,5 @@ +++ +tags = ["content"] title = "Marrrkdown rules" weight = 3 +++ diff --git a/exampleSite/layouts/partials/toc.html b/exampleSite/layouts/partials/toc.html index ced4b58a63..517fbcf460 100644 --- a/exampleSite/layouts/partials/toc.html +++ b/exampleSite/layouts/partials/toc.html @@ -1,8 +1,23 @@
-{{- partial "shortcodes/piratify.html" (dict - "context" . - "pagefield" "TableOfContents" -) }} +{{- if eq .Kind "taxonomy" }} + +{{- else }} + {{- partial "shortcodes/piratify.html" (dict + "context" . + "pagefield" "TableOfContents" + ) }} +{{- end }}
\ No newline at end of file diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index bbb24c8be8..8c2102b744 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -8,8 +8,19 @@ {{- $title = .Data.Plural | humanize }} {{- end }}

{{ $title }}

- + + {{- end }} +
+

{{ $capital }}

+ + {{- $lastCapital = $capital }} +{{- end }} +{{- if ne $lastCapital "" }} + +
+{{- end }} + diff --git a/static/css/theme.css b/static/css/theme.css index 4b95335c14..4144b189e3 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -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 { transform: scaleX(-1); } + +.tax-container { + display: flex; + flex-wrap: wrap; +} + +.tax-box { + width: 18rem; +} diff --git a/static/js/theme.js b/static/js/theme.js index 8c6a7ec880..a5e057fcaa 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -428,7 +428,7 @@ function initOpenapi( update, attrs ){ } 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 link = url + "#" + element.id; var new_element = document.createElement( 'span' );