Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/it-gro/hugo-theme-w3css-basic.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-gro <13005925+it-gro@users.noreply.github.com>2019-08-02 16:25:51 +0300
committerit-gro <13005925+it-gro@users.noreply.github.com>2019-08-02 16:25:51 +0300
commitaa6ceb72585c7251b9fcf5f341139606fa04808b (patch)
treeff644c820bd7ed31e4271ae7771b253561232f98
parentdf00b60371334e1f308002b46b0c1ed632996721 (diff)
wip
-rw-r--r--exampleSite/data/json/docs.json2
-rw-r--r--layouts/partials/footer.bottom.html2
-rw-r--r--layouts/partials/head.html2
-rw-r--r--layouts/partials/header.nav.html15
-rw-r--r--layouts/partials/resource.image.html6
-rw-r--r--layouts/shortcodes/gp.html9
-rw-r--r--layouts/shortcodes/liti.html10
-rw-r--r--layouts/shortcodes/litt.html2
-rw-r--r--layouts/shortcodes/res-gallery.html2
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>&nbsp;{{default .Name (i18n .Name)}}</a>
+ <a href='{{ $myChildrenURL }}{{$.Scratch.Get `myUglyPostfix`}}' class="w3-bar-item w3-button"><i class='{{ .Pre }}'></i>&nbsp;{{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>&nbsp;{{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>&nbsp;{{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>&nbsp;
+ <a href='{{$myPageURL}}'>{{.Title | markdownify | emojify }}</a>&nbsp;
{{- 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>&nbsp;
+ <a href='{{$myPageURL}}'>{{.Title | markdownify | emojify }}</a>&nbsp;
{{- 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 -}}:&nbsp;{{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 -}}:&nbsp;{{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 -}}:&nbsp;{{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/>