From 025b2c65c6af04530fd5dcb8157a59f8257897b1 Mon Sep 17 00:00:00 2001 From: vjeantet Date: Fri, 25 Sep 2020 09:34:09 +0200 Subject: fiw hugo build warns --- layouts/partials/_mdinclude.html | 4 +++- layouts/partials/body-article-content.html | 2 ++ 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}} {{ 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}} Include : File "{{$path}}" not found !
param was "{{$file}}"
-{{ end }} \ No newline at end of file +{{ end }} +{{else}} + + Include : Current page file does not exist ! +
+ param was "{{$file}}" +
+ +{{end}} \ No newline at end of file -- cgit v1.2.3