hugo-theme-introduction/layouts/partials/blogsection.html

38 lines
1.5 KiB
HTML
Raw Normal View History

2018-06-25 13:03:18 +00:00
{{ with .Site.GetPage "section" "blog" }}
2018-06-27 09:30:11 +00:00
<div class="section" id="{{ .Title | urlize }}">
2018-06-25 13:03:18 +00:00
<!-- Begin Blog container -->
<div class="container">
{{ if .Site.Params.showLatest }}
2018-06-27 00:10:46 +00:00
<h2 class="title is-2 has-text-centered">{{ i18n "index_blog_latestPosts" . }}</h2>
2018-06-27 00:33:38 +00:00
{{ range first 1 .Pages.ByPublishDate.Reverse }}
2018-06-25 13:03:18 +00:00
<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 }}
2018-06-27 00:10:46 +00:00
<a href="{{ .RelPermalink }}">{{ i18n "index_blog_readMore" . }}</a>
2018-06-25 13:03:18 +00:00
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
{{ if .Site.Params.showAllPosts }}
2018-06-27 00:10:46 +00:00
<h2 class="title is-2 has-text-centered top-pad">{{ i18n "index_blog_allPosts" . }}</h2>
2018-06-25 13:03:18 +00:00
<ul>
{{ range .Pages }}
{{ partial "li.html" . }}
{{ end }}
2018-06-25 13:03:18 +00:00
</ul>
{{ else }}
2018-06-27 00:10:46 +00:00
<div class="container has-text-centered top-pad">
<a href="{{ .RelPermalink }}">{{ i18n "index_blog_allPosts" . }}</a>
</div>
2018-06-25 13:03:18 +00:00
{{ end }}
</div>
2018-06-25 13:03:18 +00:00
<!-- End Blog container -->
{{ partial "top-icon.html" . }}
</div>
<!-- End Blog section -->
<div class="container"><hr></div>
2017-03-13 09:14:02 +00:00
{{ end }}