diff options
author | it-gro <13005925+it-gro@users.noreply.github.com> | 2019-08-02 16:25:51 +0300 |
---|---|---|
committer | it-gro <13005925+it-gro@users.noreply.github.com> | 2019-08-02 16:25:51 +0300 |
commit | aa6ceb72585c7251b9fcf5f341139606fa04808b (patch) | |
tree | ff644c820bd7ed31e4271ae7771b253561232f98 | |
parent | df00b60371334e1f308002b46b0c1ed632996721 (diff) |
wip
-rw-r--r-- | exampleSite/data/json/docs.json | 2 | ||||
-rw-r--r-- | layouts/partials/footer.bottom.html | 2 | ||||
-rw-r--r-- | layouts/partials/head.html | 2 | ||||
-rw-r--r-- | layouts/partials/header.nav.html | 15 | ||||
-rw-r--r-- | layouts/partials/resource.image.html | 6 | ||||
-rw-r--r-- | layouts/shortcodes/gp.html | 9 | ||||
-rw-r--r-- | layouts/shortcodes/liti.html | 10 | ||||
-rw-r--r-- | layouts/shortcodes/litt.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/res-gallery.html | 2 |
9 files changed, 30 insertions, 20 deletions
diff --git a/exampleSite/data/json/docs.json b/exampleSite/data/json/docs.json index 593dcab..0303c6e 100644 --- a/exampleSite/data/json/docs.json +++ b/exampleSite/data/json/docs.json @@ -2108,7 +2108,7 @@ ], "Examples": [ [ - "{{ if ge .Hugo.Version \"0.36\" }}Reasonable new Hugo version!{{ end }}", + "{{ if ge hugo.Version \"0.36\" }}Reasonable new Hugo version!{{ end }}", "Reasonable new Hugo version!" ] ] diff --git a/layouts/partials/footer.bottom.html b/layouts/partials/footer.bottom.html index 263816a..28dd218 100644 --- a/layouts/partials/footer.bottom.html +++ b/layouts/partials/footer.bottom.html @@ -18,7 +18,7 @@ {{ `<!-- $.Site.Params.bottomRight -->` | safeHTML }} {{- end}} {{ if $.Site.Params.bottomRight }} - {{- replaceRE `\[Hugo\]` (printf `[Hugo %s]` .Hugo.Version) $.Site.Params.bottomRight | markdownify }} + {{- replaceRE `\[Hugo\]` (printf `[Hugo %s]` hugo.Version) $.Site.Params.bottomRight | markdownify }} {{- end }} </div> <!-- w3-right --> </div> <!-- w3-cell --> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4d89e3d..f8c0f0c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -21,7 +21,7 @@ {{- end -}} </title> - {{ .Hugo.Generator }} + {{ hugo.Generator }} {{ partial `head.stylesheets.html` . -}} {{- if $.Site.Params.fontsUseGoogleApis }} diff --git a/layouts/partials/header.nav.html b/layouts/partials/header.nav.html index b4cb059..3da10a7 100644 --- a/layouts/partials/header.nav.html +++ b/layouts/partials/header.nav.html @@ -218,12 +218,13 @@ {{ `<!-- range .Children -->` | safeHTML }} {{- end}} {{- range .Children }} - {{- if and (and (not (in .URL `.html`)) (eq (substr .URL 0 1) `/`)) $.Site.Params.uglyURLs }} + {{- $myChildrenURL := .Permalink }} + {{- if and (and (not (in $myChildrenURL `.html`)) (eq (substr $myChildrenURL 0 1) `/`)) $.Site.Params.uglyURLs }} {{- $.Scratch.Set `myUglyPostfix` $.Site.Params.uglyUrl }} {{- else }} {{- $.Scratch.Set `myUglyPostfix` `` }} {{- end }} - <a href='{{ .URL }}{{$.Scratch.Get `myUglyPostfix`}}' class="w3-bar-item w3-button"><i class='{{ .Pre }}'></i> {{default .Name (i18n .Name)}}</a> + <a href='{{ $myChildrenURL }}{{$.Scratch.Get `myUglyPostfix`}}' class="w3-bar-item w3-button"><i class='{{ .Pre }}'></i> {{default .Name (i18n .Name)}}</a> {{- end }} {{- /* range .Children */}} </div> <!-- w3-dropdown-content --> </div> <!-- w3-dropdown-hover --> @@ -233,11 +234,11 @@ {{ `<!-- not .HasChildren -->` | safeHTML }} {{- end}} -{{- if and (and (not (in .URL `.html`)) (eq (substr .URL 0 1) `/`)) $.Site.Params.uglyURLs }} - {{- $.Scratch.Set `myUglyPostfix` $.Site.Params.uglyUrl }} -{{- else }} - {{- $.Scratch.Set `myUglyPostfix` `` }} -{{- end }} + {{- if and (and (not (in .URL `.html`)) (eq (substr .URL 0 1) `/`)) $.Site.Params.uglyURLs }} + {{- $.Scratch.Set `myUglyPostfix` $.Site.Params.uglyUrl }} + {{- else }} + {{- $.Scratch.Set `myUglyPostfix` `` }} + {{- end }} <a href='{{ .URL }}{{$.Scratch.Get `myUglyPostfix`}}' class="w3-bar-item w3-button w3-hide-small w3-hide-medium header-nav-menu-large "><i class='{{ .Pre }}'></i> {{default .Name (i18n .Name)}}</a> <a href='{{ .URL }}{{$.Scratch.Get `myUglyPostfix`}}' class="w3-bar-item w3-button w3-hide-small w3-hide-large header-nav-menu-medium"><i class='{{ .Pre }}'></i> {{default .Name (i18n .Name)}}</a> diff --git a/layouts/partials/resource.image.html b/layouts/partials/resource.image.html index bb7677d..fe8c208 100644 --- a/layouts/partials/resource.image.html +++ b/layouts/partials/resource.image.html @@ -41,8 +41,8 @@ theResImgOpt : {{- $theResImgOpt }} <br/> {{- if $thePage.Param `resImgRelPath`}} -{{/* {{- $myResourcePage := $thePage.Site.GetPage "page" ($thePage.Dir) ($thePage.Param `resImgRelPath`) "index.md" }} */}} - {{- $myResourcePage := $thePage.Site.GetPage "page" (printf "%s/%s/index.md" ($thePage.Dir) ($thePage.Param `resImgRelPath`) ) }} +{{/* {{- $myResourcePage := $thePage.Site.GetPage "page" ($thePage.File.Dir) ($thePage.Param `resImgRelPath`) "index.md" }} */}} + {{- $myResourcePage := $thePage.Site.GetPage "page" (printf "%s/%s/index.md" ($thePage.File.Dir) ($thePage.Param `resImgRelPath`) ) }} {{- if $myResourcePage }} {{ $thePage.Scratch.Set `myResImg` ( ( ($myResourcePage.Resources.ByType `image`).GetMatch ($theResImg)) | default ($thePage.Scratch.Get `myResImg`) ) }} {{- end }} {{/* if $myResourcePage */}} @@ -83,8 +83,6 @@ theResImgOpt : {{- $theResImgOpt }} <br/> data-dbg-myImagePermalinkWorkaround-absURL='{{$myImagePermalinkWorkaround | absURL }}' data-dbg-myImage-RelPermalink='{{$myImage.RelPermalink }}' data-dbg-myImage-RelPermalink-absURL='{{$myImage.RelPermalink | absURL }}' - data-dbg-myResource-Permalink='{{$myResource.Permalink }}' data-dbg-myImage-Permalink='{{$myImage.Permalink }}' - data-dbg-myResource-RelPermalink='{{$myResource.RelPermalink }}' > {{- end }} diff --git a/layouts/shortcodes/gp.html b/layouts/shortcodes/gp.html new file mode 100644 index 0000000..58e77ab --- /dev/null +++ b/layouts/shortcodes/gp.html @@ -0,0 +1,9 @@ +{{/* https://github.com/gohugoio/hugo/issues/3606 */}} +{{- $inlnk := .Get 0 }} +{{- $pgfl := printf "%s.md" $inlnk }} +{{- $pgtt := .Site.GetPage "page" $pgfl }} +{{- if $pgtt }} + <a href="{{ $pgtt.Permalink }}">{{ $pgtt.Title }}</a> +{{- else }} + <a href="{{ .Site.BaseURL }}{{ $inlnk }}">{{ $pgfl }} Not Found! </a> +{{- end }} diff --git a/layouts/shortcodes/liti.html b/layouts/shortcodes/liti.html index c9408e8..e0c363e 100644 --- a/layouts/shortcodes/liti.html +++ b/layouts/shortcodes/liti.html @@ -35,17 +35,18 @@ {{- if $.Scratch.Get `theHtmlList` }}<ul>{{end}} {{- if eq `regular` ($.Scratch.Get `theType`) }} {{- range $.Site.RegularPages }} + {{ $myPageURL := .Permalink }} {{- if ($.Scratch.Get `theOperator`) | eq `eq` }} {{- if or (eq .Title ($.Scratch.Get `theSearch` )) (and (eq `i` ($.Scratch.Get `theModifiers`)) (eq (lower .Title) (lower ($.Scratch.Get `theSearch`)) ) ) }} {{- if $.Scratch.Get `theHtmlList` }}<li>{{end}} - <a href='{{.URL}}'>{{.Title | markdownify | emojify }}</a> + <a href='{{$myPageURL}}'>{{.Title | markdownify | emojify }}</a> {{- if $.Scratch.Get `theHtmlList` }}</li>{{end}} {{- end }} {{- end }} {{- if ($.Scratch.Get `theOperator`) | eq `in` }} {{- if or (in .Title ($.Scratch.Get `theSearch` )) (and (eq `i` ($.Scratch.Get `theModifiers`)) (in (lower .Title) (lower ($.Scratch.Get `theSearch`)) ) ) }} {{- if $.Scratch.Get `theHtmlList` }}<li>{{end}} - <a href='{{.URL}}'>{{.Title | markdownify | emojify }}</a> + <a href='{{$myPageURL}}'>{{.Title | markdownify | emojify }}</a> {{- if $.Scratch.Get `theHtmlList` }}</li>{{end}} {{- end }} {{- end }} @@ -54,10 +55,11 @@ {{- if eq `all` ($.Scratch.Get `theType`) }} {{- range $.Site.Pages }} + {{ $myPageURL := .Permalink }} {{- if ($.Scratch.Get `theOperator`) | eq `eq` }} {{- if or (eq .Title ($.Scratch.Get `theSearch` )) (and (findRE `i` ($.Scratch.Get `theModifiers`)) (eq (lower .Title) (lower ($.Scratch.Get `theSearch`)) ) ) }} {{- if $.Scratch.Get `theHtmlList` }}<li>{{end}} - <a href='{{.URL}}'> + <a href='{{$myPageURL}}'> {{- if findRE `.Kind` ($.Scratch.Get `theOutFormat`)}}{{.Kind -}}: {{end}} {{- if findRE `.RelPermalink` ($.Scratch.Get `theOutFormat`)}}{{.RelPermalink}}{{end}} {{- if findRE `.Title` ($.Scratch.Get `theOutFormat`)}}{{.Title | markdownify | emojify }} {{end}} @@ -68,7 +70,7 @@ {{- if ($.Scratch.Get `theOperator`) | eq `in` }} {{- if or (in .Title ($.Scratch.Get `theSearch` )) (and (findRE `i` ($.Scratch.Get `theModifiers`)) (in (lower .Title) (lower ($.Scratch.Get `theSearch`)) ) ) }} {{- if $.Scratch.Get `theHtmlList` }}<li>{{end}} - <a href='{{.URL}}'> + <a href='{{$myPageURL}}'> {{- if findRE `.Kind` ($.Scratch.Get `theOutFormat`)}}{{.Kind -}}: {{end}} {{- if findRE `.RelPermalink` ($.Scratch.Get `theOutFormat`)}}{{.RelPermalink}}{{end}} {{- if findRE `.Title` ($.Scratch.Get `theOutFormat`)}}{{.Title | markdownify | emojify }} {{end}} diff --git a/layouts/shortcodes/litt.html b/layouts/shortcodes/litt.html index a62ada6..a404d8d 100644 --- a/layouts/shortcodes/litt.html +++ b/layouts/shortcodes/litt.html @@ -21,7 +21,7 @@ {{/*- with $.Site.GetPage `taxonomy` ($.Scratch.Get `theTaxonomy`) (lower ($.Scratch.Get `theTaxTerm`)) */}} {{- with $.Site.GetPage ($.Scratch.Get `theTaxonomy`) (lower ($.Scratch.Get `theTaxTerm`)) }} - <a href='{{.URL}}'> + <a href='{{.Permalink}}'> {{- if findRE `.Kind` ($.Scratch.Get `theOutFormat`)}}{{.Kind -}}: {{end}} {{- if findRE `.RelPermalink` ($.Scratch.Get `theOutFormat`)}}{{.RelPermalink}}{{end}} {{- if findRE `.Title` ($.Scratch.Get `theOutFormat`)}}{{.Title | markdownify | emojify }} {{end}} diff --git a/layouts/shortcodes/res-gallery.html b/layouts/shortcodes/res-gallery.html index 95780a3..dd6fb40 100644 --- a/layouts/shortcodes/res-gallery.html +++ b/layouts/shortcodes/res-gallery.html @@ -52,7 +52,7 @@ $myResPagePath : {{ $myResPagePath }} <br/> $myResMatch" : {{ $myResMatch }} <br/> $myResPage : {{ $myResPage }} <br/> {{- if $myResPage }} -$myResPage.Dir : {{ $myResPage.Dir }} <br/> +$myResPage.File.Dir : {{ $myResPage.File.Dir }} <br/> {{- end -}} $myResMatch : {{ $myResMatch }} <br/> $myImgCmd : {{ $myImgCmd }} <br/> |