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/"
```
This commit is contained in:
George Cushen 2020-12-28 23:17:43 +00:00
commit 219b05cbd2
14 changed files with 23 additions and 23 deletions

View file

@ -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

View file

@ -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 = ""`.

View file

@ -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;

View file

@ -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

View file

@ -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 }}

View file

@ -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>

View file

@ -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 }}

View file

@ -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" }}

View file

@ -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" }}

View file

@ -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>

View file

@ -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" }}

View file

@ -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" }}

View file

@ -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>