New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: conditionally render comment for theme #4271
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4271 +/- ##
============================================
- Coverage 60.71% 60.62% -0.09%
- Complexity 2489 2498 +9
============================================
Files 369 370 +1
Lines 12994 13047 +53
Branches 933 935 +2
============================================
+ Hits 7889 7910 +21
- Misses 4645 4678 +33
+ Partials 460 459 -1
|
application/src/main/java/run/halo/app/theme/dialect/CommentElementTagProcessor.java
Outdated
Show resolved
Hide resolved
/lgtm |
Note: 此 PR 合并后需要添加主题使用评论的文档 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ruibaby The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
修改评论功能是否可用的判断方式。 see halo-dev/halo#4271 /kind improvement ```release-note 修改评论功能是否可用的判断方式。 ```
从 Halo 2.9 开始,判断评论组件是否显示的条件不再只是单纯的判断评论插件是否安装。 see halo-dev/halo#4271 /kind documentation ```release-note None ```
What type of PR is this?
/kind improvement
/area core
/milestone 2.8.x
/area theme
What this PR does / why we need it:
按条件渲染评论组件以简化主题端对评论组件是否显示的条件控制
使用了评论标签的模板页面都能直接使用
${haloCommentEnabled}
取值能得到评论组件是否可见的结果为true/false
用于在需要级联条件渲染的组件上使用,如:how to test it?
在主题端未加渲染条件时:
${haloCommentEnabled}
结果是否正确Which issue(s) this PR fixes:
Fixes #4137
Does this PR introduce a user-facing change?