SukkaW / hexo-theme-suka

🎨Modern, powerful and simple theme for Hexo.
https://theme-suka.skk.moe
GNU General Public License v3.0
609 stars 49 forks source link

Valine的阅读量数字无法在首页显示 #131

Open time-todie opened 4 years ago

time-todie commented 4 years ago

我确认我已经查看了 (选择时请使用 "x" 取代方括号中的空格)


Node.js and NPM Information

Node.js 和 NPM 的相关信息

node v10.16.3 npm -v6.9.0


Package dependencies Information

依赖包相关信息

站点目录下的package.json:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "hexo": "^4.2.0",
    "hexo-blog-encrypt": "^3.0.12",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^2.2.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-hide-posts": "^0.1.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0"
  }
}

主题目录下package.json:

{
  "name": "hexo-theme-suka",
  "version": "1.3.3",
  "description": "Modern, powerful and simple theme for Hexo",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "setup": "npm cache clean && npm install",
    "lint": "bash lint.sh"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/SukkaW/hexo-theme-suka.git"
  },
  "keywords": [
    "hexo",
    "hexo-theme",
    "suka",
    "sukkaw"
  ],
  "author": "SukkaW",
  "license": "GPL-3.0",
  "bugs": {
    "url": "https://github.com/SukkaW/hexo-theme-suka/issues"
  },
  "homepage": "https://github.com/SukkaW/hexo-theme-suka#readme",
  "devDependencies": {
    "ejs-lint": "0.3.0",
    "eslint": "6.5.1",
    "gulp": "4.0.2",
    "gulp-autoprefixer": "7.0.1",
    "gulp-clean-css": "4.2.0",
    "gulp-rename": "1.4.0",
    "gulp-uglify": "3.0.2",
    "sass-lint": "1.13.1"
  },
  "dependencies": {
    "node-prismjs": "0.1.2",
    "prismjs": "1.17.1",
    "qr-image": "3.2.0"
  }
}

Hexo version

Hexo 版本号

INFO Checking dependencies INFO Loading Suka Theme Plugins

hexo: 4.2.0
hexo-cli: 3.1.0
os: Windows_NT 10.0.17763 win32 x64
http_parser: 2.8.0
node: 10.16.3
v8: 6.8.275.32-node.54
uv: 1.28.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 64
nghttp2: 1.39.2
napi: 4
openssl: 1.1.1c
icu: 64.2
unicode: 12.1
cldr: 35.1
tz: 2019a

Hexo & Theme Configuration

站点配置文件和主题配置文件

全部站点配置文件:

# Site
title: ****
subtitle: ''
description: ''
keywords: 
author: *****
language: zh-CN
timezone: ''

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://********.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: suka 

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
    type: git
    repo: git@github.com:*****/*****.github.io.git
    branch: master

# Suka Theme config
# Documents: https://theme-suka.skk.moe/docs/
suka_theme:
  search:
    path: search.json
    field: post # Page | Post | All. Default post
  prism:
    line_number: true
    theme: default

feed:
  type: atom
  path: atom.xml
  limit: 20
  hub:
  content:
  content_limit: 140
  content_limit_delim: ' '
  order_by: -date
  icon: icon.png
  autodiscovery: true
  template:

 # hexo-hide-posts
hide_posts:
  # 可以改成其他你喜欢的名字
  filter: hide
  # 指定你想要传递隐藏文章的 generator,比如让所有隐藏文章在存档页面可见
  # 常见的 generators 有:index, tag, category, archive, sitemap, feed, etc.
  public_generators: []
  # 为隐藏的文章添加 noindex meta 标签,阻止搜索引擎收录
  noindex: true 

全部主题配置文件:

head:
  # Favicon
  #   Put your favicons into `hexo-site/source/` directory.
  #   To get or check favicons visit: https://realfavicongenerator.net
  favicon:
    # You should use a image/x-icon type icon and configure it here.
    ico: /img/home.ico
    # 16x16 png
    small:
    # 32x32 png
    medium: # /img/suka-favicon.png
    # 180x180 png
    apple_touch_icon:
    # 192x192 png
    large:
    # svg icon
    safari_pinned_tab:
  # Color
  #   It will defined color below:
  #     Android Chrome Color
  #     Safari Pinned Tab
  color:
  # PWA
  #   You can setup your blog as pwa with a manifest.
  #   https://app-manifest.firebaseapp.com where you can generate a manifest quickly
  #   Leave it blank if you don't have one
  pwa_manifest:
  # Open search
  #   Fill in your opensearch xml file here.
  #   Leave it blank if you don't have one
  open_search: 
  # Keywords
  #   Define meta keywords tag
  #   split with ','
  keywords: 
  # Site Verification
  site_verification:
    google:
    baidu:

footer:
  # Copyright Since
  # Specify the date when the site was setup.
  # For example, if you set it as 2015, then footer will show something like '© 2015 - 2018'
  # If you just want to show something like '© 2018' only, simly leave it blank.
  copyright_since: 2019
  # Footer Text
  # You can specify the text you want to show in footer, HTML tag is supported.
  # For example, you can setup ICP license number as:
  #   custom_text: '<a href="http://www.miitbeian.gov.cn" rel="nofollow noopener noreferrer">某ICP备xxxxxxxx号-x</a>'
  # Another example, you can setup 'Hosted on Coding Pages' as:
  #   custom_text: 'Hosted on <a href="https://pages.coding.me" rel="nofollow noopener noreferrer">Coding Pages</a>'
  # Muilt line footer text is supported.
  custom_text:

# ---------------------------------------------------------------
# Customize Settings
# ---------------------------------------------------------------
uiux:
  # Muilt line slogan is supported.
  slogan: 
  # For most link color except post color
  link_color:
  primary_color:
  # Background color
  bg_color:

img:
  avatar: '/img/default_avatar.png'

# ---------------------------------------------------------------
# Menu Settings
# ---------------------------------------------------------------
# Nav settings
# Used to choose which
nav:
  home:
    use: true
  archives:
    use: true
  share:
    use: false
  search:
    use: true
    link: /search
  pages:
    关于:
      link: /about/
    友链:
      link: /links/
  rss:
    use: true

# SNS Share Switch
# Used to choose which items will be displayed in share menu.
sns_share:
  weibo: false
  facebook: true
  twitter: false
  telegram: false
  googleplus: false
  linkedin: false
  qq: true

# Qrcode which will show in share menu, for redirect to other device
qrcode:
  index_share: true
  post_share: true

# ---------------------------------------------------------------
# Post Settings
# ---------------------------------------------------------------
post:
  # Default Excerpt
  # Please use <!-- more --> in the post to control excerpt accurately and will override the configuration here.
  entry_excerpt: 120
  # Notify on expire of the page
  # To let the visitor know if the post hasn't been update for long.
  expire: true
  share: true
  # Post License
  # You can specify the text you want to show in the end of your posts and pages, HTML tag is supported.
  #   For example, you can setup a CC license as:
  #       license: 'This blog is under a <a href="/creativecommons.html" target="_blank">CC BY-NC-SA 3.0 Unported License</a>'
  # You can also use Front-Matter `license` to override this setting
  # or use Front-Matter `hide_license: true` to hide license on spefic post
  license:

# Table Of Contents which will be show on right side of the post
toc:
  # You can still disable toc for each single post by setting their front-matter with 'toc: false'
  enable: true
  # Show line number for each toc list-item or not. Default is true.
  line_number: true

# ---------------------------------------------------------------
# Integrated Services
# ---------------------------------------------------------------
# Comment Systems
# Available value of "use":
#     disqus | disqusjs | disqus_click | changyan | livere | gitment | gitalk | valine | facebook
# If you want to use DisqusJS for better disqus exprience in China, please read https://github.com/SukkaW/DisqusJS#readme
# If you want to use gitment or gitalk, you should get the client_id and client_secret form https://github.com/settings/applications/new
# If you want to use valine, you should get the app_id and app_key form https://leancloud.cn , more setting please see https://valine.js.org
comment: 
  use: valine
  disqus:
    shortname: # disqus shortname
  disqusjs:
    shortname:
    siteName:
    api:
    apikey:
    admin:
    adminLabel:
  changyan:
    appid:
    conf:
    thread_key_type: path # id | path. Only when you generate static id for each post before you using 'id'
  livere:
    data_uid:
  gitment:
    repo:
    owner:
    client_id:
    client_secret:
  gitalk:
    repo:
    owner:
    client_id:
    client_secret:
  valine:
    leancloud_appId: ***********  # leancloud application app id
    leancloud_appKey: ************  # leancloud application app key
    notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki
    verify: false # valine verify code (true/false)
    pageSize: 10 # comment list page size
    avatar: identicon # gravatar style https://valine.js.org/#/avatar
    lang: zh-cn # i18n
    placeholder: ***********。 # valine comment input placeholder(like: Please leave your footprints )
    guest_info: nick,mail,link #valine comment header info
  wildfire:
    database_provider: firebase # firebase or wilddog
    wilddog_site_id:
    firebase_api_key:
    firebase_auth_domain:
    firebase_database_url:
    firebase_project_id:
    firebase_storage_bucket:
    firebase_messaging_sender_id:
    theme: light # light or dark
    locale: en # en or zh-CN
  facebook:
    colorschme: light # light | dark
    numposts: 10
    orderby: social # social | reverse_time | time
    # You can only fill in one of them below when configuring.
    # If you fill in both of them then appid method will be used.
    # Read facebook developer documents for more info:
    # https://developers.facebook.com/docs/plugins/comments/#moderation-setup-instructions
    admin_fb_appid:
    admin_fb_username: # Currently "Suka" don't support more than one admin. You can open a new issue if you really need one.

# Site Analytics
# Suka theme has a built in Baidu's, Google's website analytics and CNZZ's analytics service
analytics:
  google_site_id: 
  gtags_site_id:
  baidu_site_id:
  cnzz_site_id:
  tencent_site_id:
  tencent_mta_id:

# Views Analytics
# Busuanzi
# The counter by https://busuanzi.ibruce.info
busuanzi:
  enable: false
  # Site views analytics support either pv or uv
  # will be show at footer
  site_uv:
    enable: true
    before: # html tag support
    after: Viewers # html tag support
    divider: '|' # html tag supported, something like '|' ',' '·' even '<br>', if you dont want any divider simply leave it blank,
    offset: 0
  site_pv:
    enable: false
    before: # html tag support
    after: Views # html tag support
    divider: # html tag supported, something like '|' ',' '·' even '<br>', if you dont want any divider simply leave it blank,
    offset: 0
  # Post views analytics
  # will be show at post header info
  post_pv:
    enable: true
    before: # html tag support
    after: Views # html tag support

# The counter by https://valine.js.org/visitor.html
valine_counter:
  # ATTENTION! You should use valine comment system to enable this feature!
  enable: true
  # By use config.url as id to count all site pv
  site_pv:
    enable: false
    before: # html tag supported
    after: # html tag supported
    divider: # html tag supported, something like '|' ',' '·' even '<br>', if you dont want any divider simply leave it blank,
  # Show pv for each post on index (Exprimental)
  index_post_pv:
    enable: true
    before: 阅读: # html tag supported
    after: # html tag supported
  # Show pv on post page
  post_pv:
    enable: true
    before: 阅读: # html tag supported
    after: # html tag supported

# ---------------------------------------------------------------
# Plugin Settings
# ---------------------------------------------------------------
# Search
# Available value of "use":
#     local | google | swiftype
search:
  use: local
  # Swiftype
  swiftype_key:

# Code highlight
# You can only enable one of them to avoid issues.
# Suka support hexo built in preprocess highlight.js, and Suka Theme has various theme for you to choose.
# Suka Theme has also built in those code highlight: Hanabi | Prism | Prettify , you can config below.
# Run `hexo clean` first after changing code highlight configuration.

# Hexo built in highlight
# To use hexo built in highlight, you need to disable all other highlight option.
# Then enable Hexo highlight option in site config.
#
#   highlight:
#     enable: true
#
highlight:
  theme: github
  # You can only enable the Suka built in prettify theme here. Check the /source/css/highlight directories.
  # The theme name is the css file name without `.min.css`, as [theme-name].min.css

# Hanabi (https://github.com/egoist/hanabi)
# To use hanabi, you need to disable all highlight option in hexo's site config:
#
#   highlight:
#     enable: false
#     line_number: false
#     auto_detect: false
#     tab_replace: false
#
hanabi:
  enable: false

# Prism
# To use prism, you need to disable all highlight option in hexo's site config.
#
#   highlight:
#     enable: false
#     line_number: false
#     auto_detect: false
#     tab_replace: false
#
# Then you need to disable other code hightlight first, and enable prism at site config:
#
#     suka_theme:
#       ...
#       prism:
#         enable: true
#         line_number: true # Enable line number or not
#         theme: default
#
# You can only enable the Suka built in prism theme here. Check the /source/lib/prism directories.
# The theme name is the css file name without `.min.css` and `prism-`, as prism-[theme-name].min.css

# Google Code Prettify
# To use prettify, you need to disable all highlight option in hexo's site config.
#
#   highlight:
#     enable: false
#     line_number: false
#     auto_detect: false
#     tab_replace: false
#
prettify:
  enable: false
  linenumber: true # We prefer to enable for avoiding some pretiffy's bugs.
  # Prettify Theme
  theme: github-v2 # It will not load any theme if you leave it blank
  # You can only enable the Suka built in prettify theme here. Check the /source/lib/prettify/themes directories.
  # The theme name is the css file name without `.min.css`, as [theme-name].min.css
  #
  # If you want to use other theme, you can leave that blank, and load your own theme by adding <link> tag using custom code.
  # Learn how to use custom code here: https://theme-suka.skk.moe/docs/en/expert/#Add-custom-code

# ---------------------------------------------------------------
# Expert Settings
# ---------------------------------------------------------------
# !!ATTENTION!!
# Do Not Modify Below This Line, unless you know what you are doing!
# ---------------------------------------------------------------

# Vendors
#   Set a CDN address for the vendor you want to customize.
#   Be aware that you should use the same version as internal ones to avoid potential problems.
#   We prefer you using the https protocol of CDN files whether you enable https on your site or not.
vendors:
  # hexo-theme-suka
  # https://github.com/SukkaW/hexo-theme-suka
  # You can check current the Suka Version Code at the end of theme config.
  suka:
    style_css:
    local_search_js:
    hanabi_browser_js:
    highlight_theme:
    # You can fill in any suka built in highlight.js theme you want here, and it will override the prism theme config before.
  lazyload_img:
  # Spectre.css
  # https://picturepan2.github.io/spectre/
  # Version: 0.5.3
  spectre:
    spectre_css:
  # Prism & Prism Theme
  # https://github.com/PrismJS/prism/ https://github.com/PrismJS/prism-themes
  # Prism Version: 1.15.0 | Prism Theme Version: 1.0.1
  prism:
    theme:
    # You can fill in any prism theme you want here, and it will override the prism theme config in site config.
    line_number:
  # Lazyload
  # https://github.com/verlok/lazyload
  # Version: 8.9.0
  lazyload:
  # Busuanzi
  # https://busuanzi.ibruce.info
  busuanzi:
  # Hanabi
  # https://github.com/egoist/hanabi
  # Version: 0.4.0
  hanabi:
  # Prettify Core
  # Attention! It is NOT the `run_prettify.js`!
  # Version: 0.1.0
  prettify:
  # Prettify Theme
  # You can fill in any prettify theme you want here, and it will override the prettify theme config before.
  # Personally I prefer the theme here: https://github.com/jmblog/color-themes-for-google-code-prettify
  prettify_theme:

fragment_cache: false
# Theme Version
#   localStorage cache version
verison: 1.3.3
old_verison:
  - 0.2.0
  - 0.0.1
  - 0.1.0
  - 1.0.0
  - 1.0.1
  - 1.1.0
  - 1.1.1
  - 1.2.0
  - 1.3.0
  - 1.3.2

我使用的平台,如 Android、iOS、Windows、Linux、MacOS 等

Windows 10


Which brows am I using, such as Chrome 58.0.3029.110 (64-bit)

我使用的浏览器(如 Chrome 58.0.3029.110 64 位)

chrome浏览器 版本79.0.3945.88 64位


What you are expected and what you actually get

预期结果和你的实际结果

问题一:本该在首页显示文章的阅读量统计数字,无论怎么刷新怎么点文章,首页上的数字通通锁定为0。文章内的阅读量统计数字倒是很正常,每点浏览一次就+1。输入hexo s --debug后,全程无红字报错


和 issue 有关的在线演示页面,推荐使用 JSFiddle 和 gist

问题一如图: 1