Ryan Wang 👍
明白了
我用的是hsan主题,然后分类中的默认分类create_time
、update_time
字段为null
刚刚查看后台的日志看到的报错段大概是这样
freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> category.createTime [in template "common/web/sitemap_xml.ftl" at line 20, column 32]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${category.createTime?iso_local} [in template "common/web/sitemap_xml.ftl" at line 20, column 30]
- Reached through: @categoryTag method="list" [in template "common/web/sitemap_xml.ftl" at line 15, column 5]
----
于是我就去数据库随便填充了这两个字段目前结果正常了,刚刚以为是主题有问题是因为看到hsan的示例站点也没有sitemap.xml可访问~
总之解决了 感谢!