add document layout
This commit is contained in:
parent
3cb43796ea
commit
293ced3505
30
layouts/_default/documents.html
Normal file
30
layouts/_default/documents.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "nav.html" . }}
|
||||
<div class="content">
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{- define "listDir" -}}
|
||||
{{- $dir := .dir -}}
|
||||
|
||||
<ul>
|
||||
{{ $files := readDir (printf "/assets/%s" $dir)}}
|
||||
{{- range $files -}}
|
||||
<li>
|
||||
{{- if .IsDir -}}
|
||||
{{ title .Name }}
|
||||
{{- template "listDir" (dict "dir" (printf "%s/%s" $dir .Name)) -}}
|
||||
{{- else -}}
|
||||
{{- with resources.Get (printf "%s/%s" $dir .Name) -}}
|
||||
<a href="{{ .RelPermalink }}">{{ title (replace (path.BaseName .Name) "-" " ") }}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- template "listDir" (dict "dir" "dokumenty") -}}
|
||||
|
||||
</div>
|
||||
{{ partial "footer.html" . }}
|
Loading…
Reference in New Issue
Block a user