• 请求帮助
  • 大家是如何对自己博客进行 SEO 优化的?

Ryan Wang 👍

明白了
我用的是hsan主题,然后分类中的默认分类create_timeupdate_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可访问~

总之解决了 感谢!

    Ryan Wang 👍
    是的之前有自己修改过数据库 因为是从wordpress迁过来的,当时是写的脚本迁入halo_db 所以这个字段当时没有留意到~

    7 个月 后
    3 个月 后

    hoeking 不是,这里说的静态化是渲染的 html 页面,但目前还没有做 html 页面缓存,后续会做。

    23 天 后
    15 天 后