From 3b76068360559d12ddce6c3f5caf09b30bbece0e Mon Sep 17 00:00:00 2001 From: George Cushen Date: Thu, 19 Oct 2017 19:00:27 +0100 Subject: [PATCH] Fix error if `static/files/citations/` folder doesn't exist (Fix #329) * Require Hugo 0.30.2+ --- layouts/partials/publication_links.html | 5 ++--- theme.toml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/layouts/partials/publication_links.html b/layouts/partials/publication_links.html index e3d402144..fa60f4164 100644 --- a/layouts/partials/publication_links.html +++ b/layouts/partials/publication_links.html @@ -11,10 +11,9 @@ {{ i18n "btn_pdf" }} {{ end }} -{{/* TODO: After Hugo v0.30 released, use fileExists function here. */}} {{ $directory := "static/files/citations/" }} -{{ $filename := printf "%s.bib" $.File.TranslationBaseName }} -{{ if (where (readDir $directory) "Name" $filename) }} +{{ $filename := printf "%s%s.bib" $directory $.File.TranslationBaseName }} +{{ if fileExists $filename }}