mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Add "Latest Posts" section to homepage
This commit is contained in:
parent
219f97bc00
commit
c82d5602bb
@ -31,6 +31,13 @@ params:
|
||||
# gitFileURL: https://github.com/BBaoVanC/bobatheme/blob/master
|
||||
# gitFileIcon: github-circle
|
||||
|
||||
# display a "Latest Posts" section on the homepage below its content
|
||||
homepageLatestPosts: true
|
||||
|
||||
# footer: >-
|
||||
# Some example text for the footer.
|
||||
|
||||
|
||||
# see https://gohugo.io/about/hugo-and-gdpr/#all-privacy-settings
|
||||
# you probably want to keep this default
|
||||
privacy:
|
||||
|
@ -8,6 +8,9 @@ table_of_contents:
|
||||
browser_no_video_support:
|
||||
other: "Your browser does not support video."
|
||||
|
||||
latest_posts:
|
||||
other: "Latest Posts"
|
||||
|
||||
|
||||
# Meta items
|
||||
long_date:
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<main>
|
||||
{{ block "main" . }}
|
||||
{{ .Content }}
|
||||
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
|
||||
{{ end }}
|
||||
</main>
|
||||
|
||||
|
@ -1,2 +1,29 @@
|
||||
{{ define "main" }}
|
||||
{{ with .Content }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.homepageLatestPosts }}
|
||||
<hr>
|
||||
<h1>
|
||||
{{ i18n "latest_posts" }}
|
||||
{{ partial "rss-link.html" . }}
|
||||
</h1>
|
||||
|
||||
{{ with (.Paginate .Site.RegularPages).Pages }}
|
||||
<div class="page-list">
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div>
|
||||
{{ i18n "no_posts" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user