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

github.com/EmielH/tale-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Hollander <EmielH@users.noreply.github.com>2018-10-21 11:51:23 +0300
committerEmiel Hollander <EmielH@users.noreply.github.com>2018-10-21 11:51:23 +0300
commitffc436900bc174126845ad5fe632d151e16a0ff6 (patch)
treef4de24c6b076093f96c09278106018222cc203c3 /layouts/index.html
parent16c49c87d139b42cf985c1fab69ecdb02206959c (diff)
Extract summary from list templates into its own layout file
Extract the summary into its own layout file and use the .Render function to include the summary, which is the same for all list templates.
Diffstat (limited to 'layouts/index.html')
-rw-r--r--layouts/index.html15
1 files changed, 2 insertions, 13 deletions
diff --git a/layouts/index.html b/layouts/index.html
index f25fe6f..5918367 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -3,18 +3,7 @@
<main>
<div class="catalogue">
{{ range (.Paginate .Pages).Pages }}
- <a href="{{ .Permalink }}" class="catalogue-item">
- <div>
- <time datetime="{{ .PublishDate }}" class="catalogue-time">{{ i18n "publishdate" . }}</time>
- <h1 class="catalogue-title">{{ .Title }}</h1>
- <div class="catalogue-line"></div>
-
- <p>
- {{ if isset .Params "summary" }}{{ .Params.Summary }}{{ else }}{{ .Summary }}{{ end }}
- </p>
-
- </div>
- </a>
+ {{ .Render "summary" }}
{{ end }}
</div>
@@ -30,4 +19,4 @@
</div>
</main>
-{{ end }} \ No newline at end of file
+{{ end }}