feat(layout): migrate from post to blog as default blog post folder

Informed by user feedback.
This commit is contained in:
George Cushen committed 2024-03-03 16:58:09 +00:00
1 parent 07fe0da177
commit 469a458ab9
5 files changed
+10 -10

No files matched your search

@@ -86,9 +86,9 @@ collections:
required: false
widget: "list"
- name: posts
label: Posts
label_singular: Post
folder: 'content/post'
label: Blog Posts
label_singular: Blog Post
folder: 'content/blog'
path: '{{slug}}/index'
filter: {field: "cms_exclude"}
create: true # Allow users to create new documents in this collection
@@ -115,7 +115,7 @@
{{/* Localisation */}}
{{ $items_type := $archive_page.Type }}
{{ $i18n := "" }}
{{ if eq $items_type "post" }}
{{ if eq $items_type "blog" }}
{{ $i18n = "more_posts" }}
{{ else if eq $items_type "event" }}
{{ $i18n = "more_talks" }}
@@ -4,17 +4,17 @@
{{/*
Featured image is searched in this order:
1. Search for a file `*featured*` in the post directory
2. Search for a file `.Params.image.filename` in the post directory
1. Search for a file `*featured*` in the page directory
2. Search for a file `.Params.image.filename` in the page directory
3. Search for a file `.Params.image.filename` in the `assets/media/` directory
*/}}
{{/* Search for an image "*featured*" in post folder */}}
{{/* Search for an image "*featured*" in page folder */}}
{{ $resource := (.Resources.ByType "image").GetMatch "*featured*" }}
{{ if eq $resource nil }}
{{/* Otherwise fall back the image file specified in front matter */}}
{{ $filename := .Params.image.filename }}
{{/* Search in post folder */}}
{{/* Search in page folder */}}
{{ $resource = (.Resources.ByType "image").GetMatch $filename }}
{{/* Otherwise in `assets/media/` folder */}}
{{ if eq $resource nil }} {{ $resource = resources.GetMatch (path.Join "media" $filename) }} {{ end }}
@@ -4,7 +4,7 @@
{{/* Get schema type. */}}
{{ $schema := "Article" }}
{{ if eq $page.Type "post" }}
{{ if eq $page.Type "blog" }}
{{ $schema = "BlogPosting" }}
{{ end }}
@@ -12,7 +12,7 @@
{{- else if $page.IsPage -}}
{{ if (eq $page.Type "post") | or (eq $page.Type "publication") | or (eq $page.Type "project") }}
{{ if (eq $page.Type "blog") | or (eq $page.Type "publication") | or (eq $page.Type "project") }}
{{ partial "jsonld/article.html" (dict "page" $page "summary" $summary) }}
{{ end }}