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

github.com/tastaturtier/someparts-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Leuchter <sandro.leuchter@dama.io>2020-02-12 13:15:49 +0300
committerSandro Leuchter <sandro.leuchter@dama.io>2020-02-12 13:15:49 +0300
commitec9de32ce04f576e8a1c20e62cebb5445b338678 (patch)
tree9411bb559a85d2f1dba21ea6e6630432f4b8b7da /layouts
parent737e72b9e51d5d5dc161049e848bc56e198adc5e (diff)
extension: part does not have to be in a bundle but can also be a single page (see exampleSite/content/blue.md)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/part/list.html29
-rw-r--r--layouts/part/single.html4
-rw-r--r--layouts/partials/part.html27
3 files changed, 32 insertions, 28 deletions
diff --git a/layouts/part/list.html b/layouts/part/list.html
index 497898a..9bf6d8c 100644
--- a/layouts/part/list.html
+++ b/layouts/part/list.html
@@ -1,33 +1,6 @@
{{- define "main" -}}
-<h1>{{ .Title | markdownify }}</h1>
-<p><a href="../">{{ .Site.Params.title | markdownify }}</a>, {{ .Params.id | markdownify }}</p>
-<p><em>{{ .Params.subtitle | markdownify }}</em></p>
-<hr/>
-<div class="container">
- <div class="row">
- <div class="col-sm-9">
- {{ with .Params.description }}
- {{ . | markdownify }}
- {{ end }}
- {{ with .Params.link }}
- <nav class="nav flex-column">
- <a href="{{ .url }}"><i class='fa fa-bookmark' aria-hidden='true'></i> {{ .linktext | markdownify }}</a>
- </nav>
- {{ end }}
- </div>
- {{ with .Params.cover }}
- <div class="col-sm-3">
- <p>{{ if .link }}<a href="{{ .link }}">{{ end }}<img src="{{ .img }}" alt="Cover" />{{ if .link }}</a>{{ end }}</p>
- </div>
- {{ end }}
- </div>
-</div>
-{{ if .Content }}
-<hr/>
-{{ end }}
-{{ .Content }}
-
+{{ partial "part.html" . }}
{{ if .Pages }}
<hr/>
{{ end }}
diff --git a/layouts/part/single.html b/layouts/part/single.html
new file mode 100644
index 0000000..f072479
--- /dev/null
+++ b/layouts/part/single.html
@@ -0,0 +1,4 @@
+{{- define "main" -}}
+
+{{ partial "part.html" . }}
+{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/part.html b/layouts/partials/part.html
new file mode 100644
index 0000000..4351cca
--- /dev/null
+++ b/layouts/partials/part.html
@@ -0,0 +1,27 @@
+<h1>{{ .Title | markdownify }}</h1>
+<p><a href="../">{{ .Site.Params.title | markdownify }}</a>, {{ .Params.id | markdownify }}</p>
+<p><em>{{ .Params.subtitle | markdownify }}</em></p>
+<hr/>
+<div class="container">
+ <div class="row">
+ <div class="col-sm-9">
+ {{ with .Params.description }}
+ {{ . | markdownify }}
+ {{ end }}
+ {{ with .Params.link }}
+ <nav class="nav flex-column">
+ <a href="{{ .url }}"><i class='fa fa-bookmark' aria-hidden='true'></i> {{ .linktext | markdownify }}</a>
+ </nav>
+ {{ end }}
+ </div>
+ {{ with .Params.cover }}
+ <div class="col-sm-3">
+ <p>{{ if .link }}<a href="{{ .link }}">{{ end }}<img src="{{ .img }}" alt="Cover" />{{ if .link }}</a>{{ end }}</p>
+ </div>
+ {{ end }}
+ </div>
+</div>
+{{ if .Content }}
+<hr/>
+{{ end }}
+{{ .Content }}