mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 22:14:08 +00:00
Fix error if static/files/citations/ folder doesn't exist (Fix #329)
* Require Hugo 0.30.2+
This commit is contained in:
1 parent
41d0123b54
commit
3b76068360
2 files changed
+3
-4
No files matched your search
@@ -11,10 +11,9 @@
|
||||
{{ i18n "btn_pdf" }}
|
||||
</a>
|
||||
{{ 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 }}
|
||||
<button type="button" class="btn btn-primary btn-outline{{ if $is_list }} btn-xs{{end}} js-cite-modal"
|
||||
data-filename="{{ printf "files/citations/%s.bib" $.File.TranslationBaseName | relURL }}">
|
||||
{{ i18n "btn_cite" }}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ license = "MIT"
|
||||
licenselink = "https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md"
|
||||
description = "Easily create beautifully simple academic or personal sites"
|
||||
homepage = "https://github.com/gcushen/hugo-academic"
|
||||
min_version = 0.27
|
||||
min_version = "0.30.2"
|
||||
tags = ["academic",
|
||||
"portfolio",
|
||||
"responsive",
|
||||
|
||||
Reference in new issue
Block a user