Replies: 2 comments 2 replies
-
Hi @exialin , thank you for reaching out here! Please refer to https://docs.halo.run/developer-guide/theme/annotations to obtain annotations. |
Beta Was this translation helpful? Give feedback.
0 replies
-
最后通过这种方式计算
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我在尝试基于theme-ocean开发主题的过程中,参考元数据表单定义给Post增加了一个字段,用于控制是否展示侧边栏:
接着修改
https://github.com/f2ccloud/theme-ocean/blob/master/templates/post.html
第5行最后的isSidebar
变量:但这里有一个问题,对于存量的文章,由于没有这个属性,访问的时候会报错,后台日志:
一种方法是修改所有文章的设置,将“是否显示侧边栏”改为“否”,但更好的方法是判断
show_sidebar
属性是否存在。由于我对Thymeleaf不熟,想问下有没有什么比较好的方法?另外,新创建的文章有一个问题,必须点击“设置”并保存一次,文章才会有
show_sidebar
属性,否则访问报错,请问这个又应该如何解决?Beta Was this translation helpful? Give feedback.
All reactions