Selaa lähdekoodia

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/"
```
George Cushen 4 vuotta sitten
vanhempi
commit
219b05cbd2

+ 4 - 4
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

+ 4 - 4
wowchemy/archetypes/talk/index.md → 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 = ""`.

+ 1 - 1
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;

+ 3 - 3
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

+ 0 - 0
wowchemy/layouts/talk/single.html → wowchemy/layouts/event/single.html


+ 1 - 1
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 }}
 

+ 2 - 2
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 @@
 
 <div class="card-simple">
 
-  {{ if eq $item.Type "talk" }}
+  {{ if eq $item.Type "event" }}
   <div class="article-metadata">
     {{ if $item.Params.authors }}
     <div>

+ 2 - 2
wowchemy/layouts/partials/li_compact.html

@@ -9,7 +9,7 @@
   {{ $link = $item.Params.external_link }}
   {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
 {{ end }}
-{{ if eq $item.Type "talk" }}
+{{ if eq $item.Type "event" }}
   {{ $show_authors_only = true }}
   {{ $show_buttons = true }}
 {{ else if eq $item.Type "publication" }}
@@ -47,7 +47,7 @@
 
     <div class="stream-meta article-metadata">
 
-      {{ if eq $item.Type "talk" }}
+      {{ if eq $item.Type "event" }}
       <div>
         <span>
           {{ partial "functions/get_event_dates" $item }}

+ 1 - 1
wowchemy/layouts/partials/page_header.html

@@ -7,7 +7,7 @@
 {{ if and (not $title) .IsNode }}
   {{ if eq .Type "post" }}
     {{ $title = i18n "posts" }}
-  {{ else if eq .Type "talk" }}
+  {{ else if eq .Type "event" }}
     {{ $title = i18n "talks" }}
   {{ else if eq .Type "publication" }}
     {{ $title = i18n "publications" }}

+ 1 - 1
wowchemy/layouts/partials/page_metadata.html

@@ -13,7 +13,7 @@
   {{ end }}
   {{ end }}
 
-  {{ if not (in (slice "talk" "page") $page.Type) }}
+  {{ if not (in (slice "event" "page") $page.Type) }}
   <span class="article-date">
     {{ $date := $page.Lastmod.Format site.Params.date_format }}
     {{ if eq $page.Type "publication" }}

+ 1 - 1
wowchemy/layouts/partials/site_js.html

@@ -60,7 +60,7 @@
         'post': {{ i18n "posts" }},
         'project': {{ i18n "projects" }},
         'publication' : {{ i18n "publications" }},
-        'talk' : {{ i18n "talks" }},
+        'event' : {{ i18n "talks" }},
         'slides' : {{ i18n "slides" | default (i18n "btn_slides") }}
         };
     </script>

+ 1 - 1
wowchemy/layouts/partials/widgets/featured.html

@@ -42,7 +42,7 @@
 {{ $i18n := "" }}
 {{ if eq $items_type "post" }}
   {{ $i18n = "more_posts" }}
-{{ else if eq $items_type "talk" }}
+{{ else if eq $items_type "event" }}
   {{ $i18n = "more_talks" }}
 {{ else if eq $items_type "publication" }}
   {{ $i18n = "more_publications" }}

+ 1 - 1
wowchemy/layouts/partials/widgets/pages.html

@@ -61,7 +61,7 @@
 {{ $i18n := "" }}
 {{ if eq $items_type "post" }}
   {{ $i18n = "more_posts" }}
-{{ else if eq $items_type "talk" }}
+{{ else if eq $items_type "event" }}
   {{ $i18n = "more_talks" }}
 {{ else if eq $items_type "publication" }}
   {{ $i18n = "more_publications" }}

+ 1 - 1
wowchemy/layouts/project/single.html

@@ -48,7 +48,7 @@
         {{ end }}
       {{ end }}
 
-      {{ $items := where (where site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
+      {{ $items := where (where site.RegularPages "Type" "event") ".Params.projects" "intersect" (slice $project) }}
       {{ $talks_len := len $items }}
       {{ if ge $talks_len 1 }}
         <h2>{{ (i18n "talks") }}</h2>