【发布时间】:2023-02-20 16:27:42
【问题描述】:
我在我的服务器上运行一个开源评论引擎,我想将其集成到我的 Hugo 站点。
完成下面列出的所有操作后,评论部分不可见,只有标题出现。
这和错误的可能原因是什么,我该如何解决?
所以我创建了一个部分文件为此,在single.hmtl中添加了一些代码并相应地编辑了我的config.toml。
这是我名为 commento.html 的部分文件中的内容:
<div id="commento"></div>
<script defer src="{{ .Site.Params.CommentoURL }}/js/commento.js"></script>
<noscript>Please enable JavaScript to load the comments.</noscript>
这是我的 single.html 文件中的内容:
{{ if and .Site.Params.CommentoURL (and (not .Site.BuildDrafts) (not .Site.IsServer)) -}}
<h2>Comments</h2>
{{ partial "commento.html" . }}
{{- end }}
我在 config.toml 文件中添加了 commentoURL 参数,如下所示:
CommentoURL = "http://qwerty.abc:8080"
【问题讨论】:
标签: hugo partials hugo-theme