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

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanzei <hanzei@mailbox.org>2018-07-01 11:09:29 +0300
committerHanzei <hanzei@mailbox.org>2018-07-01 11:09:29 +0300
commitdaca1fe109da3b57005cfe77c27819f9666c646d (patch)
tree98da048782aae45ddf79463e73969c3fbef67ec1 /layouts/partials/home/blog.html
parent11587f7efe568e46075321af7f4a1bec54a6ae04 (diff)
Use baseof temple to dry code
Diffstat (limited to 'layouts/partials/home/blog.html')
-rw-r--r--layouts/partials/home/blog.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/layouts/partials/home/blog.html b/layouts/partials/home/blog.html
new file mode 100644
index 0000000..bb323c9
--- /dev/null
+++ b/layouts/partials/home/blog.html
@@ -0,0 +1,37 @@
+{{ with .Site.GetPage "section" "blog" }}
+<div class="section" id="{{ .Title | urlize }}">
+ <!-- Begin Blog container -->
+ <div class="container">
+ {{ if .Site.Params.showLatest }}
+ <h2 class="title is-2 has-text-centered">{{ i18n "index_blog_latestPosts" . }}</h2>
+ {{ range first 1 .Pages.ByPublishDate.Reverse }}
+ <div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }}
+ <h3 class="title is-3 latest-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
+ <div class="markdown">
+ {{ .Summary }}
+ {{ if .Truncated }}
+ <a href="{{ .RelPermalink }}">{{ i18n "index_blog_readMore" . }}</a>
+ {{ end }}
+ </div>
+ </div>
+ {{ end }}
+ {{ end }}
+ {{ if .Site.Params.showAllPosts }}
+ <h2 class="title is-2 has-text-centered top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
+ <ul>
+ {{ range .Pages }}
+ {{ partial "li.html" . }}
+ {{ end }}
+ </ul>
+ {{ else }}
+ <div class="container has-text-centered top-pad">
+ <a href="{{ .RelPermalink }}">{{ i18n "index_blog_allPosts" . }}</a>
+ </div>
+ {{ end }}
+ </div>
+ <!-- End Blog container -->
+ {{ partial "top-icon.html" . }}
+</div>
+<!-- End Blog section -->
+<div class="container"><hr></div>
+{{ end }}