diff options
author | vjeantet <valere.jeantet@gmail.com> | 2020-07-27 02:42:31 +0300 |
---|---|---|
committer | vjeantet <valere.jeantet@gmail.com> | 2020-07-27 02:42:31 +0300 |
commit | f812820330338c2a150f4b2eb924dd06f18e01fc (patch) | |
tree | 0b7646e6418c4e41265c068b908ec6d7d5bf8303 | |
parent | c035fd9e8f3cd5647e40b4acfec2a561257dd252 (diff) |
fix menu chevron aligment
14 files changed, 132 insertions, 73 deletions
diff --git a/assets/sass/menu.scss b/assets/sass/menu.scss index 1e75f47..878ac54 100644 --- a/assets/sass/menu.scss +++ b/assets/sass/menu.scss @@ -32,6 +32,12 @@ article>aside { font-size: 16px;
color:black;
}
+ > i {
+ position: absolute;
+ left:15px;
+ font-size: 2em;
+
+ }
}
// menu items
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 808c2d3..15b37a5 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -25,44 +25,46 @@ enableMissingTranslationPlaceholders = false # languageName = "Français" [params] -editURL = "https://github.com/vjeantet/hugo-theme-docport/edit/master/exampleSite/content/" ordersectionsby = "weight" # ordersectionsby = "title" +color_main = "#737373" +color_second = "#b30000" disableSearch = false # default is false disableNavChevron = false # set true to hide next/prev chevron, default is false menushortcutsnewtab = false # set true to open shortcuts links to a new tab/window + +editURL = "https://github.com/vjeantet/hugo-theme-docport/edit/master/exampleSite/content/" enableGitInfo = true -#color_main = "#B0B0B0" -# color_second = "green" + [outputs] home = [ "HTML", "RSS", "JSON"] -# Code highlight configuration -[markup] - [markup.highlight] - codeFences = true - guessSyntax = true - hl_Lines = "" - lineNoStart = 1 - lineNos = false - lineNumbersInTable = true - noClasses = true - style = "monokai" - tabWidth = 4 - [markup.goldmark.renderer] unsafe = true +# Code highlight configuration +[markup.highlight] +codeFences = true +guessSyntax = true +hl_Lines = "" +lineNoStart = 1 +lineNos = false +lineNumbersInTable = true +noClasses = true +style = "monokai" +tabWidth = 2 + +# # top menu shotcuts +# [[menu.shortcuts]] -pre = "<h>More</h3>" -name = "Github repo" +name = "Github" identifier = "ds" url = "https://github.com/vjeantet/hugo-theme-docport" weight = 10 [[menu.shortcuts]] -name = "<i class='material-icons'>cloud_download</i> Download" +name = "Download" url = "https://github.com/vjeantet/hugo-theme-docport/archive/master.zip" weight = 11 diff --git a/exampleSite/content/getting-start/installation/_index.md b/exampleSite/content/getting-start/installation/_index.md index 353a3c9..c41e0c2 100644 --- a/exampleSite/content/getting-start/installation/_index.md +++ b/exampleSite/content/getting-start/installation/_index.md @@ -4,7 +4,7 @@ description = "" weight = 1 +++ -{{% alert theme="warning" %}}HUGO **v0.43** minimum required to use this theme (prefer extended version if you want to modify this theme source{{%/alert%}} +{{% alert theme="warning" %}}HUGO **v0.50** minimum required to use this theme (prefer extended version if you want to modify this theme source{{%/alert%}} {{% alert theme="info" %}}Last version of HUGO is recomended, tests are always done with the last version.{{%/alert%}} diff --git a/exampleSite/resources/_gen/assets/scss/sass/main.scss_8211071dd35cc258f01c62f8d3d53bd1.content b/exampleSite/resources/_gen/assets/scss/sass/main.scss_8211071dd35cc258f01c62f8d3d53bd1.content index 3ae509b..734d258 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/main.scss_8211071dd35cc258f01c62f8d3d53bd1.content +++ b/exampleSite/resources/_gen/assets/scss/sass/main.scss_8211071dd35cc258f01c62f8d3d53bd1.content @@ -5,7 +5,7 @@ body { line-height: 1.5; color: black; } body a { - color: #241500; + color: #b30000; text-decoration: none; background-color: transparent; } body header { @@ -17,7 +17,7 @@ body { flex-wrap: nowrap; justify-content: space-between; align-items: stretch; - color: black; } + color: #4d4d4d; } body header .logo { display: flex; flex-direction: row; @@ -57,7 +57,7 @@ body { font-size: 1.5rem; margin-right: 0.5rem; } body header nav.shortcuts li a { - color: black; + color: #4d4d4d; padding: 0 1rem; font-weight: bold; font-size: 90%; } @@ -81,8 +81,8 @@ body { letter-spacing: -1px; display: block; margin-bottom: 14px; - border-bottom: 1px dotted #241500; - color: black; + border-bottom: 1px dotted #b30000; + color: #272626; font-variant: small-caps; } body article section.right-menu .TableOfContents nav > ul { padding: 0px 0px 0px 0px; @@ -90,7 +90,7 @@ body { body article section.right-menu .TableOfContents nav > ul ul { padding: 0px 0px 0px 14px; margin: 0px 0px 0px 0px; - border-left: 1px solid #241500; } + border-left: 1px solid #b30000; } body article section.right-menu .TableOfContents nav > ul ul li { font-size: 90%; } body article section.right-menu .TableOfContents ul { @@ -123,7 +123,7 @@ article section.page #breadcrumb { content: "⊸"; } article section.page #breadcrumb ol li a { color: black; - border-bottom: 1px solid black; + border-bottom: 1px solid #4d4d4d; padding-bottom: 2px; padding-right: 0px; } article section.page #breadcrumb ol li.active:after { @@ -145,22 +145,22 @@ article section.page nav.subpages { min-width: 50px; } article section.page nav.subpages li a { font-size: 90%; - color: #241500; } + color: #b30000; } article section.page nav.subpages li:not(:first-child):before { display: inline-block; padding-right: .75rem; - color: #241500; + color: #b30000; content: "|"; } article section.page nav.subpages li.active { font-weight: bold; } article section.page nav.subpages li:first-child:before { content: "└ "; - color: #241500; } + color: #b30000; } article section.page div.chevrons { margin-top: 3rem; - border-top: 1px solid #f09719; - border-bottom: 1px solid #f09719; + border-top: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; padding: 1rem 0rem; display: flex; flex-direction: row; @@ -198,7 +198,7 @@ article section.page { article section.page h1:first-of-type { font-size: 2.6rem; margin-top: 3rem !important; - color: black; + color: #272626; margin-bottom: 0px; line-height: 1.05; letter-spacing: -.05em; @@ -209,7 +209,7 @@ article section.page { article section.page h1:first-of-type span:before { padding-left: .75rem; padding-right: .75rem; - color: black; + color: #272626; content: "⊷"; } article section.page div.content { @@ -220,11 +220,11 @@ article section.page div.content { top: -7rem; visibility: hidden; } article section.page div.content a { - color: #241500; + color: #b30000; font-weight: 500; text-decoration: underline; } article section.page div.content h1 { - color: black; + color: #4d4d4d; font-size: 30px; font-variant-ligatures: none; font-weight: 700; diff --git a/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content b/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content index 1fc504d..734d258 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content +++ b/exampleSite/resources/_gen/assets/scss/sass/main.scss_9fd32d87d247ca96761d3cae485087fe.content @@ -5,7 +5,7 @@ body { line-height: 1.5; color: black; } body a { - color: #d10300; + color: #b30000; text-decoration: none; background-color: transparent; } body header { @@ -17,7 +17,7 @@ body { flex-wrap: nowrap; justify-content: space-between; align-items: stretch; - color: #830301; } + color: #4d4d4d; } body header .logo { display: flex; flex-direction: row; @@ -57,7 +57,7 @@ body { font-size: 1.5rem; margin-right: 0.5rem; } body header nav.shortcuts li a { - color: #830301; + color: #4d4d4d; padding: 0 1rem; font-weight: bold; font-size: 90%; } @@ -81,8 +81,8 @@ body { letter-spacing: -1px; display: block; margin-bottom: 14px; - border-bottom: 1px dotted #d10300; - color: #380101; + border-bottom: 1px dotted #b30000; + color: #272626; font-variant: small-caps; } body article section.right-menu .TableOfContents nav > ul { padding: 0px 0px 0px 0px; @@ -90,7 +90,7 @@ body { body article section.right-menu .TableOfContents nav > ul ul { padding: 0px 0px 0px 14px; margin: 0px 0px 0px 0px; - border-left: 1px solid #d10300; } + border-left: 1px solid #b30000; } body article section.right-menu .TableOfContents nav > ul ul li { font-size: 90%; } body article section.right-menu .TableOfContents ul { @@ -123,7 +123,7 @@ article section.page #breadcrumb { content: "⊸"; } article section.page #breadcrumb ol li a { color: black; - border-bottom: 1px solid #830301; + border-bottom: 1px solid #4d4d4d; padding-bottom: 2px; padding-right: 0px; } article section.page #breadcrumb ol li.active:after { @@ -145,22 +145,22 @@ article section.page nav.subpages { min-width: 50px; } article section.page nav.subpages li a { font-size: 90%; - color: #d10300; } + color: #b30000; } article section.page nav.subpages li:not(:first-child):before { display: inline-block; padding-right: .75rem; - color: #d10300; + color: #b30000; content: "|"; } article section.page nav.subpages li.active { font-weight: bold; } article section.page nav.subpages li:first-child:before { content: "└ "; - color: #d10300; } + color: #b30000; } article section.page div.chevrons { margin-top: 3rem; - border-top: 1px solid #feb9b8; - border-bottom: 1px solid #feb9b8; + border-top: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; padding: 1rem 0rem; display: flex; flex-direction: row; @@ -198,7 +198,7 @@ article section.page { article section.page h1:first-of-type { font-size: 2.6rem; margin-top: 3rem !important; - color: #380101; + color: #272626; margin-bottom: 0px; line-height: 1.05; letter-spacing: -.05em; @@ -209,7 +209,7 @@ article section.page { article section.page h1:first-of-type span:before { padding-left: .75rem; padding-right: .75rem; - color: #380101; + color: #272626; content: "⊷"; } article section.page div.content { @@ -220,11 +220,11 @@ article section.page div.content { top: -7rem; visibility: hidden; } article section.page div.content a { - color: #d10300; + color: #b30000; font-weight: 500; text-decoration: underline; } article section.page div.content h1 { - color: #830301; + color: #4d4d4d; font-size: 30px; font-variant-ligatures: none; font-weight: 700; diff --git a/exampleSite/resources/_gen/assets/scss/sass/menu.scss_11ec87c0e45b1a85c098a07257dc0c80.content b/exampleSite/resources/_gen/assets/scss/sass/menu.scss_11ec87c0e45b1a85c098a07257dc0c80.content index 1064646..2bd07d0 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/menu.scss_11ec87c0e45b1a85c098a07257dc0c80.content +++ b/exampleSite/resources/_gen/assets/scss/sass/menu.scss_11ec87c0e45b1a85c098a07257dc0c80.content @@ -1,7 +1,7 @@ article > aside { /*background-color: $c_light3;*/ - background-color: rgba(204, 49, 25, 0.1); - background-color: #fcebe8; + background-color: rgba(115, 115, 115, 0.1); + background-color: #f3f2f2; padding: 2rem 0rem 1rem 0rem; } article > aside .menu { list-style-type: none; @@ -14,6 +14,10 @@ article > aside { font-weight: 700; font-size: 16px; color: black; } + article > aside .menu > .dd-item > i { + position: absolute; + left: 15px; + font-size: 2em; } article > aside .menu .dd-item { padding: 10px 0px 10px 16px; list-style: none; } @@ -24,7 +28,7 @@ article > aside { font-size: 14px; /*color: rgb(110, 119, 122);*/ /*color:$color_main;*/ - color: #b12b16; } + color: #646464; } article > aside .menu .dd-item ul { padding-inline-start: 0px; } article > aside .menu .dd-item li { @@ -34,17 +38,17 @@ article > aside { article > aside .menu .dd-item.parent > ul { display: block; } article > aside .menu .dd-item.active { - background-color: rgba(204, 49, 25, 0.1); } + background-color: rgba(115, 115, 115, 0.1); } article > aside .menu .dd-item.active.haschildren { /*background-color: transparent;*/ } article > aside .menu .dd-item.active.haschildren > a { font-weight: 700; } article > aside .menu .dd-item.active > a { - color: #882111; } + color: #4d4d4d; } article > aside .menu .dd-item.active > ul { display: block; } article > aside .menu .dd-item.active > div { - background-color: #882111; } + background-color: #4d4d4d; } article > aside .menu .dd-item.active > div * { font-weight: bold; border-bottom: dotted 1px red; } diff --git a/exampleSite/resources/_gen/assets/scss/sass/menu.scss_351ac3e8f13af76fe8c76ce0d01fb09a.content b/exampleSite/resources/_gen/assets/scss/sass/menu.scss_351ac3e8f13af76fe8c76ce0d01fb09a.content index 42650d4..daf9bb5 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/menu.scss_351ac3e8f13af76fe8c76ce0d01fb09a.content +++ b/exampleSite/resources/_gen/assets/scss/sass/menu.scss_351ac3e8f13af76fe8c76ce0d01fb09a.content @@ -1,7 +1,7 @@ article > aside { /*background-color: $c_light3;*/ - background-color: rgba(217, 166, 13, 0.1); - background-color: #fef8e7; + background-color: rgba(115, 115, 115, 0.1); + background-color: #f3f2f2; padding: 2rem 0rem 1rem 0rem; } article > aside .menu { list-style-type: none; @@ -24,7 +24,7 @@ article > aside { font-size: 14px; /*color: rgb(110, 119, 122);*/ /*color:$color_main;*/ - color: #bc900b; } + color: #646464; } article > aside .menu .dd-item ul { padding-inline-start: 0px; } article > aside .menu .dd-item li { @@ -34,17 +34,17 @@ article > aside { article > aside .menu .dd-item.parent > ul { display: block; } article > aside .menu .dd-item.active { - background-color: rgba(217, 166, 13, 0.1); } + background-color: rgba(115, 115, 115, 0.1); } article > aside .menu .dd-item.active.haschildren { /*background-color: transparent;*/ } article > aside .menu .dd-item.active.haschildren > a { font-weight: 700; } article > aside .menu .dd-item.active > a { - color: #916f08; } + color: #4d4d4d; } article > aside .menu .dd-item.active > ul { display: block; } article > aside .menu .dd-item.active > div { - background-color: #916f08; } + background-color: #4d4d4d; } article > aside .menu .dd-item.active > div * { font-weight: bold; border-bottom: dotted 1px red; } diff --git a/exampleSite/resources/_gen/assets/scss/sass/shortcodes/children.scss_6fa2be902ef8caa56cd91727d4d085e0.content b/exampleSite/resources/_gen/assets/scss/sass/shortcodes/children.scss_6fa2be902ef8caa56cd91727d4d085e0.content new file mode 100644 index 0000000..2719ff7 --- /dev/null +++ b/exampleSite/resources/_gen/assets/scss/sass/shortcodes/children.scss_6fa2be902ef8caa56cd91727d4d085e0.content @@ -0,0 +1,27 @@ +article ul.children.children-card { + flex-wrap: wrap; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; } + article ul.children.children-card > span { + -webkit-box-flex: 1; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + min-width: 0; + min-height: 0; + width: 40%; + min-width: 250px; + margin: 1rem 1rem; + border: 0.1rem solid #ccc; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); } + article ul.children.children-card > span card { + margin: 0px 0px; + display: block; + padding: 1rem; + background-color: #eee; + font-size: 200%; } + article ul.children.children-card > span p { + padding: 0rem 1rem; } diff --git a/exampleSite/resources/_gen/assets/scss/sass/shortcodes/children.scss_6fa2be902ef8caa56cd91727d4d085e0.json b/exampleSite/resources/_gen/assets/scss/sass/shortcodes/children.scss_6fa2be902ef8caa56cd91727d4d085e0.json new file mode 100644 index 0000000..c5976b5 --- /dev/null +++ b/exampleSite/resources/_gen/assets/scss/sass/shortcodes/children.scss_6fa2be902ef8caa56cd91727d4d085e0.json @@ -0,0 +1 @@ +{"Target":"sass/shortcodes/children.css","MediaType":"text/css","Data":{}}
\ No newline at end of file diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 74b2c68..c471c15 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -3,7 +3,13 @@ {{ end }} {{ define "main" }} - {{ partial "body-article-content.html" . }} + {{ if eq .WordCount 0}} + {{with index .Pages 0}} + {{ partial "body-article-content.html" . }} + {{end}} + {{else}} + {{ partial "body-article-content.html" . }} + {{end}} {{ end }} {{ define "sidepage" }} diff --git a/layouts/partials/_menu.html b/layouts/partials/_menu.html index 1ffb499..f94a9d1 100644 --- a/layouts/partials/_menu.html +++ b/layouts/partials/_menu.html @@ -25,9 +25,12 @@ {{- if ne $numberOfPages 0 }} haschildren{{end}} item_level_$level "> + + {{$menuTitle := .Title}} + {{if eq $menuTitle ""}}{{$menuTitle = .CurrentSection}}{{end}} {{if gt $level 0 }} - <a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}</a> + <a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{$menuTitle}}{{safeHTML .Params.Post}}</a> {{end}} {{- if ne $numberOfPages 0 }} @@ -39,7 +42,7 @@ {{- end}} {{if eq $level 0 }} - <a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}</a> + <a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{$menuTitle}}{{safeHTML .Params.Post}}</a> {{end}} diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html index eb05e5f..7385db5 100644 --- a/layouts/partials/body-article-content.html +++ b/layouts/partials/body-article-content.html @@ -10,8 +10,10 @@ <!-- FIN FIL D'ARIANE -->
{{if not .Params.layout }}
- <h1>{{.CurrentSection.Title}}
- {{if ne .CurrentSection.Title .Title}}<span>{{.Title}}</span>{{end}}
+ {{$pagetitle := .Title}}
+ {{if eq $pagetitle ""}}{{$pagetitle = .File.BaseFileName}}{{end}}
+ <h1>{{.Section}}
+ {{if .IsPage }}<span>{{$pagetitle}}</span>{{end}}
</h1>
{{ if gt (len .CurrentSection.Pages) 0}}
{{- $cPage := . }}
@@ -19,8 +21,10 @@ {{- range .CurrentSection.Pages.ByWeight }}
{{- if not .Params.hidden }}
{{- if eq .Kind "page" }}
+ {{$pagetitle := .Title}}
+ {{if eq $pagetitle ""}}{{$pagetitle = .File.BaseFileName}}{{end}}
<li {{if eq . $cPage}}class="active"{{- end}}>
- <a title="{{.Title}}" href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}</a>
+ <a title="$pagetitle" href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{$pagetitle}}{{safeHTML .Params.Post}}</a>
</li>
{{- end}}
{{- end}}
@@ -34,6 +38,12 @@ <div class="content">
{{- with .Content -}}
{{ . | replaceRE "(<h[1-9]) id=\"([^\"]+)\"(.+)(</h[1-9]+>)" `${1}${3}${4}<a class="anchor" id="${2}"></a>` | safeHTML }}
+ {{- else -}}
+ {{with index .Pages 0}}
+ <meta http-equiv = "refresh" content = "0; url = {{.RelPermalink}}"/>
+ {{- else -}}
+ No content
+ {{- end -}}
{{- end -}}
</div>
diff --git a/layouts/partials/html-head.html b/layouts/partials/html-head.html index bc370e6..a82981c 100644 --- a/layouts/partials/html-head.html +++ b/layouts/partials/html-head.html @@ -35,11 +35,11 @@ cursor: pointer; } i.keyboard_arrow_right:before { - content: "keyboard_arrow_right" + content: "chevron_right" } i.keyboard_arrow_down:before { - content: "keyboard_arrow_down" + content: "expand_more" } i.chevron_right:before { @@ -9,7 +9,7 @@ homepage = "https://github.com/vjeantet/hugo-theme-docport" repo = "https://github.com/vjeantet/hugo-theme-docport" tags = ["documentation", "menu","slide","search"] features = ["documentation","menu","nested sections","search","slide","attachments"] -min_version = 0.43 +min_version = 0.50 [author] name = "Valere JEANTET" |