diff --git a/docs/config/_default/hugo.toml b/docs/config/_default/hugo.toml index ad7a8dc82e..19fdef5821 100644 --- a/docs/config/_default/hugo.toml +++ b/docs/config/_default/hugo.toml @@ -138,11 +138,13 @@ summaryLength = 10 pre = ' ' name = 'Hugo' url = 'https://gohugo.io/documentation/' + weight = 1 [[languages.en.menu.devshortcuts]] parent = 'devshortcuts' pre = ' ' identifier = 'theme' name = 'Theme' + weight = 2 [[languages.en.menu.devshortcuts.params]] alwaysopen = true [[languages.en.menu.devshortcuts]] @@ -150,18 +152,27 @@ summaryLength = 10 pre = ' ' identifier = 'configoptions' pageRef = 'configuration/reference' + weight = 1 [[languages.en.menu.devshortcuts]] parent = 'theme' pre = ' ' identifier = 'frontmatter' title = 'Front Matter Reference' pageRef = 'authoring/frontmatter/reference#annotated-front-matter' + weight = 2 [[languages.en.menu.devshortcuts]] parent = 'theme' pre = ' ' identifier = 'screenshotframe' title = 'Screenshot Frame' pageRef = 'images/hero.zip' + weight = 3 + [[languages.en.menu.devshortcuts]] + parent = 'theme' + pre = ' ' + title = 'Maaagic Download' + pageRef = 'images/magic.gif?download' + weight = 4 # this is ourrr way t' showcase th' multilang settings by # doing autotrrranlat'n of th' english content; we are @@ -216,11 +227,13 @@ summaryLength = 10 pre = ' ' name = "Cap'n Hugo" url = 'https://gohugo.io/documentation/' + weight = 1 [[languages.pir.menu.devshortcuts]] parent = 'devshortcuts' pre = ' ' identifier = 'theme' name = "Th' Theme" + weight = 2 [[languages.pir.menu.devshortcuts.params]] alwaysopen = true [[languages.pir.menu.devshortcuts]] @@ -228,18 +241,27 @@ summaryLength = 10 pre = ' ' identifier = 'configoptions' pageRef = 'configuration/reference' + weight = 1 [[languages.pir.menu.devshortcuts]] parent = 'theme' pre = ' ' identifier = 'frontmatter' title = 'Front Matter Reference' pageRef = 'authoring/frontmatter/reference#annotated-front-matter' + weight = 2 [[languages.pir.menu.devshortcuts]] parent = 'theme' pre = ' ' identifier = 'screenshotframe' title = 'Screenshot Frame' pageRef = 'images/hero.zip' + weight = 3 + [[languages.pir.menu.devshortcuts]] + parent = 'theme' + pre = ' ' + title = 'Maaagic Download' + pageRef = 'images/magic.gif?download' + weight = 4 # mounts are only needed in this showcase to access the publicly available screenshots and CHANGELOG; # remove this section if you don't need further mounts diff --git a/layouts/partials/_relearn/imageAttributes.gotmpl b/layouts/partials/_relearn/imageAttributes.gotmpl index 6ad73f485e..e105483920 100644 --- a/layouts/partials/_relearn/imageAttributes.gotmpl +++ b/layouts/partials/_relearn/imageAttributes.gotmpl @@ -1,4 +1,4 @@ -{{- $attributes := dict }} +{{- $attributes := .attributes | default dict }} {{- $height := "auto" }} {{- $width := "auto" }} {{- $effects := dict "border" false "lazy" true "lightbox" true "shadow" false }} @@ -63,7 +63,7 @@ {{- end }} {{- end }} {{- end }} -{{- if $attributes.class }}{{ $classes = $classes | append $attributes.class }}{{ end }} +{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }} {{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }} {{- $attributes = merge $attributes (dict "src" .url) }} {{- $attributes = merge $attributes (dict "style" (printf " height: %s; width: %s;%s" $height $width (index $attributes "style" | default ""))) }} diff --git a/layouts/partials/_relearn/linkAttributes.gotmpl b/layouts/partials/_relearn/linkAttributes.gotmpl index 6827516620..275ef167d9 100644 --- a/layouts/partials/_relearn/linkAttributes.gotmpl +++ b/layouts/partials/_relearn/linkAttributes.gotmpl @@ -1,4 +1,4 @@ -{{- $attributes := dict }} +{{- $attributes := .attributes | default dict }} {{- /* target will be boolean false if no user defined value was set and effect default should be applied */}} {{- $target := false }} {{- $u := urls.Parse .url }} @@ -64,7 +64,7 @@ {{- end }} {{- end }} {{- end }} -{{- if $attributes.class }}{{ $classes = $classes | append $attributes.class }}{{ end }} +{{- if $attributes.class }}{{ $classes = $classes | append (split $attributes.class " ") }}{{ end }} {{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }} {{- $attributes = merge $attributes (dict "href" .url) }} {{- $attributes = merge $attributes (dict "download" $effects.download) }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 7200275666..a6db00ee51 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -169,7 +169,6 @@ {{- $title := partial "title.gotmpl" (dict "page" . "linkTitle" true) }} {{- $url := partial "permalink.gotmpl" (dict "to" .) }} {{- $isCrosslink := false }} - {{- $target := "" }} {{- if .Params.menuPageRef }} {{- $isCrosslink = true }} {{- $url = .Params.menuPageRef }} @@ -180,13 +179,6 @@ {{- else if .Params.menuUrl }} {{- $isCrosslink = true }} {{- $url = .Params.menuUrl | relLangURL }} - {{- $u := urls.Parse $url }} - {{- if $u.IsAbs }} - {{- $target = "_blank" }} - {{- if isset site.Params "externallinktarget" }} - {{- $target = site.Params.externalLinkTarget }} - {{- end }} - {{- end }} {{- end }} {{- $pre := partial "menu-pre.html" . }} {{- $post := partial "menu-post.html" . }} @@ -200,7 +192,21 @@ {{- $isOpen := or $currentAlwaysopen $isSelf $isAncestor }}