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

标题下​ Valine字段 显示不是中文“留言” 阅读次数: 3 Valine: 1 #360

Open
tanghk opened this issue May 2, 2021 · 2 comments
Labels

Comments

@tanghk
Copy link

tanghk commented May 2, 2021

标题下​ Valine字段 显示不是中文“留言” 阅读次数: 3 Valine: 1

https://tanghk.github.io/2021/04/16/MacBook%20Pro%20Early%202015%20%E6%9B%B4%E6%8D%A2%E5%9B%BA%E6%80%81%E7%A1%AC%E7%9B%98/#valine-comments

@XuShall
Copy link

XuShall commented Jul 2, 2021

hexo.extend.filter.register('theme_inject', injects => {
  let theme = hexo.theme.config;
  if (!theme.valine.enable || !theme.valine.appid || !theme.valine.appkey) return;

  injects.postMeta.raw('valine', `
  {% if post.comments and (is_post() or theme.valine.comment_count) %}
  <span class="post-meta-item">
    ${iconText('comment-o', '评论数')}
    <a title="valine" href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="{{ url_for(post.path) }}" itemprop="commentCount"></span>
    </a>
  </span>
  {% endif %}
  `, {}, {}, theme.valine.post_meta_order);

});

找到themes/hexo-theme-next/scripts/filters/comment/valine.js修改 ${iconText('comment-o', '评论数')}

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants