Fix warning about .BaseFileName on zero object

main
Jez Cope 2 years ago
parent 8013038a72
commit 7967eb3b49

@ -1,17 +1,19 @@
<script type="text/javascript" src="/js/navbar.js"></script>
{{ $page_id := .File.BaseFileName }}
{{ if .Site.Params.comments.webmention }}
{{ $webmention_js := resources.Get "js/webmention.js" | minify }}
<script src="{{ $webmention_js.RelPermalink }}"
data-page-url="{{ .Permalink }}"
async></script>
{{ end }}
{{ with .Site.Params.comments.cactus }}
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"
data-default-homeserver-url="https://matrix.cactus.chat:8448"
data-server-name="cactus.chat"
data-site-name="{{ . }}"
data-node="#cactus-comments"
data-comment-section-id="{{ $page_id }}"></script>
{{ if .File }}
{{ $page_id := .File.BaseFileName }}
{{ if .Site.Params.comments.webmention }}
{{ $webmention_js := resources.Get "js/webmention.js" | minify }}
<script src="{{ $webmention_js.RelPermalink }}"
data-page-url="{{ .Permalink }}"
async></script>
{{ end }}
{{ with .Site.Params.comments.cactus }}
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"
data-default-homeserver-url="https://matrix.cactus.chat:8448"
data-server-name="cactus.chat"
data-site-name="{{ . }}"
data-node="#cactus-comments"
data-comment-section-id="{{ $page_id }}"></script>
{{ end }}
{{ end }}

Loading…
Cancel
Save