Skip to content

Commit

Permalink
feat(layout): migrate from post to blog as default blog post folder
Browse files Browse the repository at this point in the history
Informed by user feedback.
  • Loading branch information
gcushen committed Mar 3, 2024
1 parent 07fe0da commit 469a458
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions modules/blox-plugin-decap-cms/data/decap_cms_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion modules/blox-tailwind/layouts/partials/jsonld/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{{/* Get schema type. */}}
{{ $schema := "Article" }}
{{ if eq $page.Type "post" }}
{{ if eq $page.Type "blog" }}
{{ $schema = "BlogPosting" }}
{{ end }}

Expand Down
2 changes: 1 addition & 1 deletion modules/blox-tailwind/layouts/partials/jsonld/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down

0 comments on commit 469a458

Please sign in to comment.