From 0fafa0b98dab344e5b002c3b50811f75bb3fade0 Mon Sep 17 00:00:00 2001
From: George Cushen
Date: Mon, 2 Jan 2017 14:35:50 +0000
Subject: [PATCH] Improve talks
- improves format of simple lists (`detailed_list = false`) for Talks widget
- fixes date to use user defined date format from `config.toml`
- hides 'Links' row if no `url_...` params are set in talk front matter
- introduces optional `location` param for event location
- adds `event_url` which if defined, turns event name into a link on talk detail page
---
archetypes/talk.md | 2 ++
exampleSite/content/home/talks.md | 5 ++--
exampleSite/content/talk/example-talk.md | 6 +++--
i18n/en.yaml | 3 +++
layouts/partials/talk_li_simple.html | 10 ++++----
layouts/talk/single.html | 32 +++++++++++++++++++-----
6 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/archetypes/talk.md b/archetypes/talk.md
index ddc5ffc5..d254c2df 100644
--- a/archetypes/talk.md
+++ b/archetypes/talk.md
@@ -4,6 +4,8 @@ title = ""
abstract = ""
abstract_short = ""
event = ""
+event_url = ""
+location = ""
selected = false
url_pdf = ""
url_slides = ""
diff --git a/exampleSite/content/home/talks.md b/exampleSite/content/home/talks.md
index be34468d..487fdf29 100644
--- a/exampleSite/content/home/talks.md
+++ b/exampleSite/content/home/talks.md
@@ -1,11 +1,10 @@
+++
-# Recent Talks widget.
-# Note: this widget will only display if `content/talk/` contains talks.
+# Recent and Upcoming Talks widget.
date = "2016-04-20T00:00:00"
draft = false
-title = "Recent Talks"
+title = "Recent & Upcoming Talks"
subtitle = ""
widget = "talks"
diff --git a/exampleSite/content/talk/example-talk.md b/exampleSite/content/talk/example-talk.md
index 8c1c7b6f..aa396dd9 100644
--- a/exampleSite/content/talk/example-talk.md
+++ b/exampleSite/content/talk/example-talk.md
@@ -1,14 +1,16 @@
+++
-date = "2016-12-22T00:00:00"
+date = "2017-01-01T00:00:00"
math = true
title = "Example Talk"
abstract = ""
abstract_short = ""
event = "Hugo Academic Theme Conference"
+event_url = "https://example.org"
+location = "London, United Kingdom"
selected = false
url_pdf = ""
url_slides = ""
url_video = ""
+++
-More detail can easily be written here using *Markdown* and $\rm \LaTeX$ math code.
+Embed your slides or video here using [shortcodes](https://gcushen.github.io/hugo-academic-demo/post/writing-markdown-latex/). Further details can easily be added using *Markdown* and $\rm \LaTeX$ math code.
diff --git a/i18n/en.yaml b/i18n/en.yaml
index 29b6bedd..6c3f4411 100644
--- a/i18n/en.yaml
+++ b/i18n/en.yaml
@@ -69,6 +69,9 @@
- id: event
translation: Event
+- id: location
+ translation: Location
+
# Project details
- id: open_project_site
diff --git a/layouts/partials/talk_li_simple.html b/layouts/partials/talk_li_simple.html
index 4d602a90..f470f6a5 100644
--- a/layouts/partials/talk_li_simple.html
+++ b/layouts/partials/talk_li_simple.html
@@ -1,12 +1,12 @@
-
- {{ .Title }}
-
+
+
{{ .Title }}
+
+ {{ .Date.Format $.Site.Params.date_format }},
{{ if .Params.event_short }}
{{ .Params.event_short | markdownify }}
{{ else if .Params.event }}
{{ .Params.event | markdownify }}
{{ end }}
-
- {{ partial "talk_links" (dict "content" . "is_list" 1) }}
+
diff --git a/layouts/talk/single.html b/layouts/talk/single.html
index fb1e4cf3..e20a9e59 100644
--- a/layouts/talk/single.html
+++ b/layouts/talk/single.html
@@ -30,8 +30,10 @@
-
{{ i18n "event" }}
-
{{ .Params.event | markdownify }}
+
{{ i18n "date" }}
+
+ {{ .Date.Format $.Site.Params.date_format }}
+
@@ -42,9 +44,11 @@
-
{{ i18n "date" }}
-
- {{ .Date.Format "January, 2006" }}
+
{{ i18n "event" }}
+
@@ -52,6 +56,21 @@
+ {{ with .Params.location }}
+
+
+
+
+
{{ i18n "location" }}
+
{{ . | markdownify }}
+
+
+
+
+
+ {{ end }}
+
+ {{ if .Params.url_pdf | or .Params.url_slides | or .Params.url_video | or .Params.url_custom }}
@@ -59,7 +78,7 @@
{{ i18n "links" }}
- {{ partial "publication_links" (dict "content" . "is_list" 0) }}
+ {{ partial "talk_links" (dict "content" . "is_list" 0) }}
@@ -67,6 +86,7 @@
+ {{ end }}