mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 09:12:47 +00:00
added partial all-posts-list and added a condition to use it.
This commit is contained in:
parent
5a77deedc9
commit
b6890bf302
@ -12,6 +12,10 @@
|
|||||||
{{/* Derive the section name */}}
|
{{/* Derive the section name */}}
|
||||||
{{ $section_name := index (.Site.Params.mainSections) 0 }}
|
{{ $section_name := index (.Site.Params.mainSections) 0 }}
|
||||||
|
|
||||||
|
{{ if $.Param "all_post_list" }}
|
||||||
|
{{ partial "all-posts-list.html" . }}
|
||||||
|
{{ else }}
|
||||||
|
|
||||||
<div class="pa3 pa4-ns w-100 w-70-ns center">
|
<div class="pa3 pa4-ns w-100 w-70-ns center">
|
||||||
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
|
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
|
||||||
{{ with .Site.GetPage "section" $section_name }}
|
{{ with .Site.GetPage "section" $section_name }}
|
||||||
@ -57,3 +61,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
16
layouts/partials/all-posts-list.html
Normal file
16
layouts/partials/all-posts-list.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{{ $n_posts := $.Param "recent_posts_number" | default 3 }}
|
||||||
|
<div class="pa3 pa4-ns w-100 w-70-ns center">
|
||||||
|
<h1 class="flex-none">
|
||||||
|
Últimos posts:
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<section class="w-100 mw8">
|
||||||
|
|
||||||
|
{{ range (first $n_posts .Pages) }}
|
||||||
|
<div class="relative w-100 mb4">
|
||||||
|
{{ partial "summary-with-image.html" . }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user