Added an 'All posts' page to show all adequate regular pages

next
Gianmarco Gargiulo 2023-11-12 01:09:39 +01:00
parent fcf7e743d7
commit 543219cf0c
2 changed files with 35 additions and 0 deletions

3
content/all/_index.md Normal file
View File

@ -0,0 +1,3 @@
---
title: All posts
---

32
layouts/all/list.html Normal file
View File

@ -0,0 +1,32 @@
{{ define "body_class" }} tag-template {{ end }}
{{ define "main" }}
<header class="site-header">
{{- partial "site-header.html" $ -}}
<style type="text/css">
.responsive-header-img {
background-color: #1e1e1e;
}
</style>
<div class="outer site-header-background responsive-header-img fadein no-image">
<div class="inner site-header-content-list">
<h1 class="site-title">{{ .Title }}</h1>
<h2 class="site-description">{{ len .Site.RegularPages }} post{{ if gt (len .Site.RegularPages) 1 }}s{{ end }}
</h2>
</div>
</div>
</header>
<main id="site-main" class="site-main outer">
<div class="inner posts">
<div class="post-feed">
{{ range $index, $element := (where .Site.RegularPages ".Params.rss_ignore" "ne" "true") }}
{{- partial "post-card.html" (dict "context" . "index" $index "home" $.IsHome) -}}
{{ end }}
</div>
</div>
</main>
{{ end }}