我是Clojure的新手。我的问题是关于塞尔默模板库。
我想要做的是为下面的方式应用一个变量。但它不起作用;
{% include {{right-page}} %} ------- X(在这里,右页是对目标文件名的级联连接)
发布于 2016-02-10 11:09:05
如果右页是您要传递到该页的有效字符串,我认为这将适用于您。
{% include right-page %}
发布于 2017-04-10 08:29:27
在selmer编译模板时,当前必须知道包含在selmer中的任何目标,而模板不需要传递数据。这意味着,根据模板:
template.html_template:
{% include right-page %}和code代码:
(selmer/render-file template.html_template
{right-page "some/other/template/file.html_template})你可以期待一个例外。至于周围的工作,你可以考虑
(selmer/render-file template.html_template
{right-page (selmer/render-file
"some/other/template/file.html_template {})})或者类似的东西。
当然,您必须更新template.html以包含已呈现的文本,并禁用转义,如下所示:
template.html_template:
{{right-page|safe}}https://stackoverflow.com/questions/35285822
复制相似问题