From 9842f517ddff61bdf2ae8f43d3bbaa35e2cb0c27 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 8 May 2018 22:31:41 +0100 Subject: [PATCH] partials: Fix case where `.Permalink` may be called on nil See #534 and #532 --- layouts/partials/publication_links.html | 10 +++++++--- layouts/partials/talk_links.html | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/layouts/partials/publication_links.html b/layouts/partials/publication_links.html index 1b21ef12..a09eb2f1 100644 --- a/layouts/partials/publication_links.html +++ b/layouts/partials/publication_links.html @@ -31,9 +31,13 @@ {{ end }} {{ if $.Params.projects }} {{ range $.Params.projects }} - - {{ i18n "btn_project" }} - + {{ with ($.Site.GetPage "page" "project" .) }} + + {{ i18n "btn_project" }} + + {{ else }} + {{ errorf "Please check that the `projects` parameter in the front matter of content in `content/publication/` refers to an existing filename (without .md extension) of a published project." }} + {{ end }} {{ end }} {{ else }} {{ with $.Params.url_project }} diff --git a/layouts/partials/talk_links.html b/layouts/partials/talk_links.html index 80ed96fb..50a05664 100644 --- a/layouts/partials/talk_links.html +++ b/layouts/partials/talk_links.html @@ -22,9 +22,13 @@ {{ end }} {{ range $.Params.projects }} - - {{ i18n "btn_project" }} - + {{ with ($.Site.GetPage "page" "project" .) }} + + {{ i18n "btn_project" }} + + {{ else }} + {{ errorf "Please check that the `projects` parameter in the front matter of content in `content/talk/` refers to an existing filename (without .md extension) of a published project." }} + {{ end }} {{ end }} {{ range $.Params.url_custom }}