From 219b05cbd2c498a954a13bd40b3a82152108cef5 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 28 Dec 2020 23:17:43 +0000 Subject: [PATCH] refactor: support any event type Informed by user demand to support all event types rather than just talks. Brings consistency to further align Academic and Research Group templates. BREAKING CHANGE: Rename `talk` folder to `event` Remove `type` set to `talk` in any event front matter (if applicable) To keep existing `/talk/` URLs, set the following in `config.toml`: ``` [permalinks] events = "/talk/:slug/" ``` --- netlify-cms-academic/static/admin/config.yml | 8 ++++---- wowchemy/archetypes/{talk => event}/index.md | 8 ++++---- wowchemy/assets/js/wowchemy-search.js | 2 +- wowchemy/i18n/en.yaml | 6 +++--- wowchemy/layouts/{talk => event}/single.html | 0 wowchemy/layouts/partials/jsonld/main.html | 2 +- wowchemy/layouts/partials/li_card.html | 4 ++-- wowchemy/layouts/partials/li_compact.html | 4 ++-- wowchemy/layouts/partials/page_header.html | 2 +- wowchemy/layouts/partials/page_metadata.html | 2 +- wowchemy/layouts/partials/site_js.html | 2 +- wowchemy/layouts/partials/widgets/featured.html | 2 +- wowchemy/layouts/partials/widgets/pages.html | 2 +- wowchemy/layouts/project/single.html | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) rename wowchemy/archetypes/{talk => event}/index.md (87%) rename wowchemy/layouts/{talk => event}/single.html (100%) diff --git a/netlify-cms-academic/static/admin/config.yml b/netlify-cms-academic/static/admin/config.yml index 23a097e3..eb54fdf4 100644 --- a/netlify-cms-academic/static/admin/config.yml +++ b/netlify-cms-academic/static/admin/config.yml @@ -277,10 +277,10 @@ collections: - {label: Description for screen readers, name: alt_text, widget: string, required: false} - {label: "Where's the focal point in the image? Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.", name: focal_point, widget: string, required: false, default: "Smart"} - {label: Thumbnail Only?, name: preview_only, widget: boolean, default: false, required: false} - - name: talks - label: Talks - label_singular: Talk - folder: 'content/talk' + - name: events + label: Events + label_singular: Event + folder: 'content/event' path: '{{slug}}/index' create: true # Allow users to create new documents in this collection fields: # The fields each document in this collection have diff --git a/wowchemy/archetypes/talk/index.md b/wowchemy/archetypes/event/index.md similarity index 87% rename from wowchemy/archetypes/talk/index.md rename to wowchemy/archetypes/event/index.md index 0e33781c..868bc0ab 100644 --- a/wowchemy/archetypes/talk/index.md +++ b/wowchemy/archetypes/event/index.md @@ -20,13 +20,13 @@ date: {{ .Date }} date_end: {{ .Date }} all_day: false -# Schedule page publish date (NOT talk date). +# Schedule page publish date (NOT event date). publishDate: {{ .Date }} authors: [] tags: [] -# Is this a featured talk? (true/false) +# Is this a featured event? (true/false) featured: false # Featured image @@ -45,7 +45,7 @@ image: # icon_pack: fab # icon: twitter -# Optional filename of your slides within your talk's folder or a URL. +# Optional filename of your slides within your event's folder or a URL. url_slides: url_code: @@ -53,7 +53,7 @@ url_pdf: url_video: # Markdown Slides (optional). -# Associate this talk with Markdown slides. +# Associate this event with Markdown slides. # Simply enter your slide deck's filename without extension. # E.g. `slides = "example-slides"` references `content/slides/example-slides.md`. # Otherwise, set `slides = ""`. diff --git a/wowchemy/assets/js/wowchemy-search.js b/wowchemy/assets/js/wowchemy-search.js index fe583d62..0fecc003 100644 --- a/wowchemy/assets/js/wowchemy-search.js +++ b/wowchemy/assets/js/wowchemy-search.js @@ -90,7 +90,7 @@ function parseResults(query, results) { let snippetHighlights = []; // Show abstract in results for content types where the abstract is often the primary content. - if (["publication", "talk"].includes(content_key)) { + if (["publication", "event"].includes(content_key)) { content = value.item.summary; } else { content = value.item.content; diff --git a/wowchemy/i18n/en.yaml b/wowchemy/i18n/en.yaml index 1e39f86d..eece784e 100644 --- a/wowchemy/i18n/en.yaml +++ b/wowchemy/i18n/en.yaml @@ -114,7 +114,7 @@ translation: See all posts - id: more_talks - translation: See all talks + translation: See all events - id: more_publications translation: See all publications @@ -136,7 +136,7 @@ - id: book_appointment translation: Book an appointment -# Publication/Talk details +# Publication/Event details - id: abstract translation: Abstract @@ -200,7 +200,7 @@ translation: Publications - id: talks - translation: Talks + translation: Events - id: projects translation: Projects diff --git a/wowchemy/layouts/talk/single.html b/wowchemy/layouts/event/single.html similarity index 100% rename from wowchemy/layouts/talk/single.html rename to wowchemy/layouts/event/single.html diff --git a/wowchemy/layouts/partials/jsonld/main.html b/wowchemy/layouts/partials/jsonld/main.html index aafaed4d..c6a96640 100644 --- a/wowchemy/layouts/partials/jsonld/main.html +++ b/wowchemy/layouts/partials/jsonld/main.html @@ -16,7 +16,7 @@ {{ partial "jsonld/article.html" (dict "page" $page "summary" $summary) }} {{ end }} - {{ if eq $page.Type "talk" }} + {{ if eq $page.Type "event" }} {{ partial "jsonld/event.html" (dict "page" $page "summary" $summary) }} {{ end }} diff --git a/wowchemy/layouts/partials/li_card.html b/wowchemy/layouts/partials/li_card.html index fc1b375a..f6795c63 100644 --- a/wowchemy/layouts/partials/li_card.html +++ b/wowchemy/layouts/partials/li_card.html @@ -3,7 +3,7 @@ {{/* Dynamic view adjusts to content type. */}} {{ $show_buttons := false }} -{{ if eq $item.Type "talk" }} +{{ if eq $item.Type "event" }} {{ $show_buttons = true }} {{ else if eq $item.Type "publication" }} {{ $show_buttons = true }} @@ -21,7 +21,7 @@
- {{ if eq $item.Type "talk" }} + {{ if eq $item.Type "event" }}