From 9cb68e45d5e80b720e8881ae64d55b7118dec3aa Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Fri, 21 Aug 2020 16:20:02 +0200 Subject: [PATCH] paragraph only after first list item... --- config/_default/config.toml | 2 +- themes/sandpoints/assets/css/site.css | 126 ++++++++++++++---- .../sandpoints/layouts/_default/baseof.html | 6 +- themes/sandpoints/layouts/_default/list.html | 11 +- themes/sandpoints/layouts/partials/head.html | 1 + .../sandpoints/layouts/partials/header.html | 28 ++-- themes/sandpoints/layouts/session/single.html | 11 +- themes/sandpoints/layouts/topic/single.html | 11 +- 8 files changed, 134 insertions(+), 62 deletions(-) diff --git a/config/_default/config.toml b/config/_default/config.toml index ef80ac2..30427e8 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -21,5 +21,5 @@ disableKinds = ["RSS", "sitemap"] [markup] [markup.tableOfContents] endLevel=4 - ordered = false + ordered = true startLevel = 1 diff --git a/themes/sandpoints/assets/css/site.css b/themes/sandpoints/assets/css/site.css index 7f0ab2f..59eb76b 100644 --- a/themes/sandpoints/assets/css/site.css +++ b/themes/sandpoints/assets/css/site.css @@ -421,15 +421,6 @@ template { url('../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes') format('svg'); /* Legacy iOS */ } -/* preflight */ -ol, -ul { - list-style: none; - margin: 0; - padding: 0; -} - - body { font-family: 'Vollkorn', serif; font-weight: 400; @@ -470,7 +461,7 @@ body { margin-bottom: 4rem; } -li, .toc, .has, .afterhas, .aftertoc { +.has, .afterhas { font-style: italic; font-size: 1.4rem; } @@ -485,13 +476,37 @@ li, .toc, .has, .afterhas, .aftertoc { .leftcolumn { grid-column: 1; - display: grid; - grid-template-columns: auto 1fr; padding-right: 1.2rem; + position: relative; } -.toc { - grid-column: 1; +#TableOfContents { + position: relative; + margin-left: -2rem; + margin-top: -1.5rem; +} + +#TableOfContents li { + list-style: decimal inside; + padding-left: 0.5rem; + color: rgba(0, 0, 0, 0.4); + margin: 0; + padding: 0; +} +#TableOfContents li a { + font-family: 'Vollkorn'; + font-size: 1.4rem; + font-weight: 500; + font-style: normal; +} + +#TableOfContents > ol:first-child > li:first-child> a::after { + content: "¶"; + color: rgba(0, 0, 0, 0.2); + font-size: 1.3em; + position: absolute; + margin-top: -0.3em; + top: 0; } .rightcolumn { @@ -507,6 +522,7 @@ li, .toc, .has, .afterhas, .aftertoc { .content { margin-top: 4rem; padding-left: 3rem; + padding-right: 6rem; } /* a::after { @@ -533,27 +549,22 @@ a:hover { cursor: pointer; } - -#TableOfContents { - margin-left: -0.5em; -} - -#TableOfContents li { - padding-left: 0.5em; - font-size: 1.3rem; -} - h1 { + display: none; +} + + +h2 { font-weight: 500; font-size: 1.6rem; } -h2 { +h3 { font-weight: 500; font-size: 1.5rem; } -h3 { +h4 { font-weight: 500; font-size: 1.4rem; } @@ -577,3 +588,66 @@ blockquote { background-color: white; z-index: 10; } + +.topicbar { + display: none; +} + +h2 + p:first-letter { + font-family: "Great Vibes", cursive; + color: rgba(0, 0, 0, 0.8); + font-size: 1.5em; + line-height: 0; +} + +.hx { + position: relative; +} + +.hpar { + position: absolute; + font-size: 1.7em; + font-style: normal; + color: rgba(0, 0, 0, 0.1); + top: 0; + margin-top: -0.4em; +} + + +body {counter-reset: h2} +h2 {counter-reset: h3} +h3 {counter-reset: h4} +h4 {counter-reset: h5} +h5 {counter-reset: h6} + +h2:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: h2; + content: counter(h2) ". " +} + +h3:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: h3; + content: counter(h2) "." counter(h3) ". " +} + +h4:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: h4; + content: counter(h2) "." counter(h3) "." counter(h4) ". " +} + +h5:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: h5; + content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". " +} + +h6:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: h6; + content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". " +} + +h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.nocount:before { content: ""; counter-increment: none } diff --git a/themes/sandpoints/layouts/_default/baseof.html b/themes/sandpoints/layouts/_default/baseof.html index 412aec7..4d1bbde 100644 --- a/themes/sandpoints/layouts/_default/baseof.html +++ b/themes/sandpoints/layouts/_default/baseof.html @@ -15,7 +15,11 @@ {{ end }} {{- partial "header.html" . -}} - {{- block "main" . }}{{- end }} + + {{$currentNode := . }} +

{{ .Title }}

+ + {{- block "main" . }}{{- end }} {{- partial "footer.html" . -}} diff --git a/themes/sandpoints/layouts/_default/list.html b/themes/sandpoints/layouts/_default/list.html index c8d54c6..0509404 100644 --- a/themes/sandpoints/layouts/_default/list.html +++ b/themes/sandpoints/layouts/_default/list.html @@ -4,14 +4,9 @@
-
- Table of Contents⁄ -
-
- {{ if ne (trim .Page.TableOfContents "\n") "" }} - {{ .Page.TableOfContents }} - {{ end }} -
+ {{ if ne (trim .Page.TableOfContents "\n") "" }} + {{ .Page.TableOfContents }} + {{ end }}
diff --git a/themes/sandpoints/layouts/partials/head.html b/themes/sandpoints/layouts/partials/head.html index dcc64b1..775cfbc 100644 --- a/themes/sandpoints/layouts/partials/head.html +++ b/themes/sandpoints/layouts/partials/head.html @@ -28,6 +28,7 @@ {{ $currentSession := . }} + {{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }} diff --git a/themes/sandpoints/layouts/partials/header.html b/themes/sandpoints/layouts/partials/header.html index a6697f1..029f8fa 100644 --- a/themes/sandpoints/layouts/partials/header.html +++ b/themes/sandpoints/layouts/partials/header.html @@ -1,12 +1,20 @@ - {{ $currentSession := . }} - {{ if not .IsHome }} -
- {{ substr $.Site.Home.Title 0 1 }}{{ substr $.Site.Home.Title 1 }} - {{ end }} +{{ $currentSession := . }} + {{ if not .IsHome }} +
+ {{ substr $.Site.Home.Title 0 1 }}{{ substr $.Site.Home.Title 1 }} + {{ end }} - {{ range where $.Site.RegularPages ".Section" "topic" }} - {{ if in .Params.has_sessions $currentSession.File.LogicalName }} - » {{ .Title }} - {{ end }} - {{ end }} + {{ if eq .File.Dir "topic/" }} + » {{ .Title }} + {{ end }} + + {{ range where $.Site.RegularPages ".Section" "topic" }} + {{ if in .Params.has_sessions $currentSession.File.LogicalName }} + » {{ .Title }} + {{ end }} + {{ end }} + + {{ if eq .File.Dir "session/" }} + » {{ .Title }} + {{ end }}
diff --git a/themes/sandpoints/layouts/session/single.html b/themes/sandpoints/layouts/session/single.html index 609a626..bb84b01 100644 --- a/themes/sandpoints/layouts/session/single.html +++ b/themes/sandpoints/layouts/session/single.html @@ -4,14 +4,9 @@
-
- Table of Contents⁄ -
-
- {{ if ne (trim .Page.TableOfContents "\n") "" }} - {{ .Page.TableOfContents }} - {{ end }} -
+ {{ if ne (trim .Page.TableOfContents "\n") "" }} + {{ .Page.TableOfContents }} + {{ end }}
diff --git a/themes/sandpoints/layouts/topic/single.html b/themes/sandpoints/layouts/topic/single.html index 0598562..727ebdd 100644 --- a/themes/sandpoints/layouts/topic/single.html +++ b/themes/sandpoints/layouts/topic/single.html @@ -4,14 +4,9 @@
-
- Table of Contents⁄ -
-
- {{ if ne (trim .Page.TableOfContents "\n") "" }} - {{ .Page.TableOfContents }} - {{ end }} -
+ {{ if ne (trim .Page.TableOfContents "\n") "" }} + {{ .Page.TableOfContents }} + {{ end }}