Skip to content
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

hide the comment_count in post-meta of post (隐藏在文章头部标签的评论数) #1469

Open
3 tasks done
yangxyo opened this issue Apr 16, 2020 · 3 comments · May be fixed by #1493
Open
3 tasks done

hide the comment_count in post-meta of post (隐藏在文章头部标签的评论数) #1469

yangxyo opened this issue Apr 16, 2020 · 3 comments · May be fixed by #1493

Comments

@yangxyo
Copy link

yangxyo commented Apr 16, 2020

Please follow this Issue template to provide relevant information, such as source code repositories, blog links, and screenshots, which will help us investigate.
请按照此 Issue 模版提供相关信息,例如源码仓库、博客链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist

  • I am using the latest version of NexT.
  • I have read the relevant documents of Hexo and NexT.
  • I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me.

Expected behavior

I hope to hide the comment_count in post-meta of post.
(我希望能够隐藏文章前面的评论数)

Actual behavior

comment count only can be hidden in home page.
(只能够隐藏主页的评论数)

  • Links to demo site with this feature: N/A
    This is my blog:
    (这是我的博客地址)
    [https: blog.xyang.xin](https: blog.xyang.xin)

Steps to reproduce the behavior

All are the latest.
(全部都是最新的)
No other comments plugins such as Disqus.
没有安装其他类似于 Disqus 的评论插件,只开启了 valine。

valine:
  enable: true
  appid: XXX
  appkey: XXX
  notify: true # Mail notifier
  verify: false # Verification code
  placeholder: Just go go # Comment box placeholder
  avatar: mm # Gravatar style
  guest_info: nick,mail,link # Custom comment header
  pageSize: 10 # Pagination size
  language: # Language, available values: en, zh-cn
  visitor: false # Article reading statistic
  comment_count: false # If false, comment count will only be displayed in post page, not in home page
  recordIP: false # Whether to record the commenter IP
  serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in)
  #post_meta_order: 0

Although there is custom_file that is the #postMeta: source/_data/post-meta.swig,
I don't know how to use it.
I only can use code below to realize hide it...
(我不知道source/_data/post-meta.swig文件怎么用,我只能通过下面的代码去隐藏它)

.post-meta span:nth-child(3) {
  color: transparent;
  background: transparent;
}

However, it not only waste a little bit performance, but also the update time spanand create time span cann't be centered.
(不仅浪费了一点性能,发表时间和更新时间两个span还不能居中)

Other Information

image
image

I hope to add an option for it or give me some better ways to solve it.
It looks a bit redundant and Cumbersome to me.
Thanks!
(我希望增加一个选项或者能给我一些更好的方法去解决这个问题,它对我而言看起来有点多余且繁琐,谢谢!)

@welcome
Copy link

welcome bot commented Apr 16, 2020

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@sli1989
Copy link
Collaborator

sli1989 commented Apr 17, 2020

can check replace this

{% if post.comments and (is_post() or theme.valine.comment_count) %}

by

{% if post.comments and (is_post() and theme.valine.comment_count) %}

@sli1989
Copy link
Collaborator

sli1989 commented Apr 17, 2020

this feature refers to the change of every comment system's option. maybe in process later.

@799953468 799953468 linked a pull request May 6, 2020 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants