Hi there,
I’m using a partial to insert Cusdis comments in templates.
Here is the code, which works fine as a partial:
{{ if .Site.Params.CommentsCusdisID }}
<h2>Discussion:</h2>
<div id="cusdis_thread" data-host="https://cusdis.com"
data-app-id="{{ .Site.Params.CommentsCusdisID }}"
data-page-id="{{ .File.UniqueID }}"
data-page-url="{{ .Permalink }}"
data-page-title="{{ .Title }}">
</div>
<script defer src="https://cusdis.com/js/widget/lang/fr.js"></script>
<script async defer src="https://cusdis.com/js/cusdis.es.js"></script>
{{end}}
I would like to turn this into a shortocode, to insert the form exactly where I want to.
Unfortunately, moving the very same code to layouts/shortcodes/cusdis.html
gives the following error:
failed to process shortcode: [...]
execute of template failed at <.File.UniqueID>: can’t evaluate field File in type *hugolib.ShortcodeWithPage
Any hint?