diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/baseof.html | 16 | ||||
| -rw-r--r-- | layouts/_default/home.html | 15 | ||||
| -rw-r--r-- | layouts/_default/section.html | 16 | ||||
| -rw-r--r-- | layouts/_default/single.html | 10 | ||||
| -rw-r--r-- | layouts/partials/breadcrumbs.html | 8 | ||||
| -rw-r--r-- | layouts/partials/children.html | 7 |
6 files changed, 72 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..6e97e54 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <title>{{ block "title" . }}Untitled{{ end }}</title> + <link rel="stylesheet" href="/base.css" /> + </head> + <body> + {{ block "body" . }} + There is nothing to be seen here at the moment. + {{ end }} + </body> +</html> + + diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..9f21fed --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,15 @@ +{{ define "title" }} + {{ .Title }} +{{ end }} +{{ define "body" }} + <h1>{{ .Title }}</h1> + <main> + {{ .Content }} + </main> + {{ if .Pages }} + <nav class="children"> + <h2>Contents of this website</h2> + {{ partial "children" . }} + </nav> + {{ end }} +{{ end }} diff --git a/layouts/_default/section.html b/layouts/_default/section.html new file mode 100644 index 0000000..9ffb815 --- /dev/null +++ b/layouts/_default/section.html @@ -0,0 +1,16 @@ +{{ define "title" }} + {{ .Title }} +{{ end }} +{{ define "body" }} + <nav class="breadcrumbs"> + {{ partial "breadcrumbs" . }} + </nav> + <h1>{{ .Title }}</h1> + {{ .Content }} + {{ if .Pages }} + <nav class="children"> + <h2>Contents</h2> + {{ partial "children" . }} + </nav> + {{ end }} +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..20af493 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,10 @@ +{{ define "title" }} + {{ .Title }} +{{ end }} +{{ define "body" }} + <nav class="breadcrumbs"> + {{ partial "breadcrumbs" . }} + </nav> + <h1>{{ .Title }}</h1> + {{ .Content }} +{{ end }} diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..b5a9860 --- /dev/null +++ b/layouts/partials/breadcrumbs.html @@ -0,0 +1,8 @@ +<ul> + {{ $ancestors := .Ancestors.Reverse }} + {{ range $ancestors }} + <li> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </li> + {{ end }} +</ul> diff --git a/layouts/partials/children.html b/layouts/partials/children.html new file mode 100644 index 0000000..132ae8e --- /dev/null +++ b/layouts/partials/children.html @@ -0,0 +1,7 @@ +<ul> + {{ range .Pages }} + <li> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </li> + {{ end }} +</ul> |
