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

_mdinclude.html « partials « layouts - github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 812b8c9f5630890335f6edfb0efed4f02122b42a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{- 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}}
	    	{{safeHTML .tip}}
	  	{{end}}
	{{end}}
{{- end -}}

{{- define "pageBlock" -}}
{{ $path :=  printf "%s__%s.md" .page.Dir .name}}
	{{ with .page.Site.GetPage $path }}
		{{ .Content }}
	{{end}}
{{- end -}}