diff options
author | zzossig <zzossig@gmail.com> | 2020-06-30 17:22:41 +0300 |
---|---|---|
committer | zzossig <zzossig@gmail.com> | 2020-06-30 17:22:41 +0300 |
commit | 6229f7fe2040f107b6365129838b03296a4439bd (patch) | |
tree | da4473dcc8110866b9897e8aaf7db268303e6c50 | |
parent | 1afed103cc9f76ff754505a1ebc5b4b84b698ee9 (diff) |
[bug fix] cite.bib not found
fix #293 fix #295
-rw-r--r-- | layouts/partials/head/meta_json_ld.html | 4 | ||||
-rw-r--r-- | layouts/partials/publication/pub-links.html | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/layouts/partials/head/meta_json_ld.html b/layouts/partials/head/meta_json_ld.html index 41d3d67..105dc02 100644 --- a/layouts/partials/head/meta_json_ld.html +++ b/layouts/partials/head/meta_json_ld.html @@ -7,7 +7,7 @@ "datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }}, "dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}, "url" : {{ .Permalink }}, - "description": "{{ with (.Description | default (replaceRE "\n" " " (.Summary | truncate 170))) }}{{ . }}{{ end }}", + "description": {{ with (.Description | default (replaceRE "\n" " " (.Summary | truncate 170))) }}{{ . }}{{ else }}""{{ end }}, {{ with .Params.tags -}} "keywords": {{ . }}, {{ end -}} @@ -16,7 +16,7 @@ "url" : {{ .Permalink }}, "name": {{ .Title }}, {{ with $.Param "description" -}} - "description": "{{ . }}", + "description": {{ . }}, {{ end -}} {{ end -}} {{ with $.Param "image" -}} diff --git a/layouts/partials/publication/pub-links.html b/layouts/partials/publication/pub-links.html index f6bdd55..5201cc8 100644 --- a/layouts/partials/publication/pub-links.html +++ b/layouts/partials/publication/pub-links.html @@ -18,8 +18,10 @@ <div class="modal__icon modal__toolbar--close" title="Close" aria-label="Close Button" data-micromodal-close> {{ partial "svgs/etc/close.svg" (dict "width" 25 "height" 25) }} </div> + {{ $langprefix := $.Site.Language.Lang }} + {{ $folderPathWithoutLangPrefix := replace .RelPermalink (print "/" $langprefix "/") "/" }} + {{ $filePath := print "/content/" $langprefix $folderPathWithoutLangPrefix "cite.bib" }} <main class="modal__cite"> - {{ $filePath := print "/content" (print .Permalink "cite.bib" | relURL) }} {{ if fileExists $filePath }} <div class="modal__cite--exist" id="citeContents"> {{ readFile $filePath | markdownify }} @@ -30,9 +32,11 @@ </div> {{ end }} </main> - <button id="copyBtn" class="button modal__copy" data-color="default" aria-label="Cite Copy Button" data-clipboard-target="#citeContents"> - {{ i18n "copy" | default "Copy"}} - </button> + {{ if fileExists $filePath }} + <button id="copyBtn" class="button modal__copy" data-color="default" aria-label="Cite Copy Button" data-clipboard-target="#citeContents"> + {{ i18n "copy" | default "Copy"}} + </button> + {{ end }} </div> </div> </div> |