[bug fix] cite.bib not found

fix #293 fix #295
This commit is contained in:
zzossig 2020-06-30 23:22:41 +09:00
parent 1afed103cc
commit 6229f7fe20
2 changed files with 10 additions and 6 deletions

View File

@ -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" -}}

View File

@ -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>
{{ 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>