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

github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/_mdinclude.html')
-rw-r--r--layouts/partials/_mdinclude.html18
1 files changed, 14 insertions, 4 deletions
diff --git a/layouts/partials/_mdinclude.html b/layouts/partials/_mdinclude.html
index 820a5e3..812b8c9 100644
--- a/layouts/partials/_mdinclude.html
+++ b/layouts/partials/_mdinclude.html
@@ -1,9 +1,12 @@
-{{- template "extrapage" dict "name" .name "page" .context "tip" .tip -}}
-{{- define "extrapage" -}}
- {{ $header := print .name "." .page.Lang }}
- {{ range where .page.Site.Pages "File.BaseFileName" $header }}
+{{- template "pageBlock" dict "name" .name "page" .context -}}
+{{- template "siteBlock" dict "name" .name "page" .context "tip" .tip -}}
+
+{{- define "siteBlock" -}}
+ {{ $path := printf "_layout/%s/_index.%s.md" .name .page.Lang}}
+ {{ range where .page.Site.Pages "File.BaseFileName" $path }}
{{ .Content }}
{{else}}
+ {{ $path = printf "_layout/%s/_index.md" .name }}
{{ if .page.Site.GetPage "page" (print .name ".md") }}
{{(.page.Site.GetPage "page" (print .name ".md")).Content}}
{{else}}
@@ -11,3 +14,10 @@
{{end}}
{{end}}
{{- end -}}
+
+{{- define "pageBlock" -}}
+{{ $path := printf "%s__%s.md" .page.Dir .name}}
+ {{ with .page.Site.GetPage $path }}
+ {{ .Content }}
+ {{end}}
+{{- end -}}