diff options
author | vjeantet <valere.jeantet@gmail.com> | 2020-09-25 10:34:09 +0300 |
---|---|---|
committer | vjeantet <valere.jeantet@gmail.com> | 2020-09-25 10:34:09 +0300 |
commit | 025b2c65c6af04530fd5dcb8157a59f8257897b1 (patch) | |
tree | bfc82237aee5df0d1e875950b886efc653483493 | |
parent | e4e112f9f561c428fa2d443aecbc82cacbbeae27 (diff) |
fiw hugo build warns
-rw-r--r-- | layouts/partials/_mdinclude.html | 4 | ||||
-rw-r--r-- | layouts/partials/body-article-content.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/include.html | 15 |
3 files changed, 17 insertions, 4 deletions
diff --git a/layouts/partials/_mdinclude.html b/layouts/partials/_mdinclude.html index 812b8c9..f23ea92 100644 --- a/layouts/partials/_mdinclude.html +++ b/layouts/partials/_mdinclude.html @@ -16,8 +16,10 @@ {{- end -}} {{- define "pageBlock" -}} -{{ $path := printf "%s__%s.md" .page.Dir .name}} +{{ if .page.File}} +{{ $path := printf "%s__%s.md" .page.File.Dir .name}} {{ with .page.Site.GetPage $path }} {{ .Content }} {{end}} {{- end -}} +{{- end -}} diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html index f4d9698..73f2abf 100644 --- a/layouts/partials/body-article-content.html +++ b/layouts/partials/body-article-content.html @@ -41,6 +41,7 @@ {{ if gt (len $elements) 0}}
<nav class="subpages">
{{- range $elements}}
+ {{- if .File -}}
{{- if and (not .Params.hidden) ( not (hasPrefix .File.BaseFileName "__")) }}
{{$pagetitle := .Title}}
{{if eq $pagetitle ""}}{{$pagetitle = .File.BaseFileName}}{{end}}
@@ -48,6 +49,7 @@ <a title="$pagetitle" href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{$pagetitle}}{{safeHTML .Params.Post}}</a>
</li>
{{- end}}
+ {{- end}}
{{- end}}
</nav>
{{ end }}
diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html index c099e6e..2fd8012 100644 --- a/layouts/shortcodes/include.html +++ b/layouts/shortcodes/include.html @@ -1,9 +1,18 @@ {{$file := .Get 0}} -{{$path := printf "%s%s" .Page.File.Dir $file}} -{{ with .Site.GetPage $path }}{{ .Content }}{{else}} +{{ with .Page.File }} +{{ $path := printf "%s%s" .Dir $file}} +{{ with $.Site.GetPage $path }}{{ .Page.Content }}{{else}} <span style=" border: 4px dashed white;display: block;background-color: red;padding: 1em;color:white; font-size: large;font-weight: bold;text-transform: capitalize;"> Include : File "{{$path}}" not found ! <br> <small>param was "{{$file}}"</small> </span> -{{ end }}
\ No newline at end of file +{{ end }} +{{else}} +<span style=" border: 4px dashed white;display: block;background-color: red;padding: 1em;color:white; font-size: large;font-weight: bold;text-transform: capitalize;"> + Include : Current page file does not exist ! + <br> + <small>param was "{{$file}}"</small> +</span> + +{{end}}
\ No newline at end of file |