webmention form only on posts and using more if and where content type clauses

This commit is contained in:
Marvin Steadfast 2020-04-02 10:46:25 +02:00
parent f5b3ad6cc7
commit df14e32b46
4 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,6 @@ author:
name: "Marvin Preuss" name: "Marvin Preuss"
params: params:
AuthorName: "Marvin Preuss" AuthorName: "Marvin Preuss"
mainSections:
- "posts"
locallinks: locallinks:
- search - search
- impressum - impressum

View File

@ -25,7 +25,7 @@
{{ with .OutputFormats.Get "RSS" }} {{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }} {{ end }}
{{ range $pages }} {{ range (where .Site.RegularPages "Type" "eq" "posts") }}
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>

View File

@ -2,7 +2,9 @@
<main> <main>
<article class="h-entry"> <article class="h-entry">
{{ partial "article.html" . }} {{ partial "article.html" . }}
{{ if eq .Type "posts" }}
{{ partial "mentions.html" . }} {{ partial "mentions.html" . }}
{{ end }}
</article> </article>
</main> </main>
{{ end }} {{ end }}

View File

@ -1,6 +1,6 @@
{{ define "main" }} {{ define "main" }}
<main> <main>
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} {{ $paginator := .Paginate (where .Site.RegularPages "Type" "eq" "posts") }}
{{ range $paginator.Pages }} {{ range $paginator.Pages }}
<article class="h-entry"> <article class="h-entry">
{{ partial "article.html" . }} {{ partial "article.html" . }}