XPoet / hexo-theme-keep

:rainbow: A simple and light theme for Hexo. It makes you more focused on writing.
https://xpoet.cn
GNU Affero General Public License v3.0
1.29k stars 176 forks source link

在_config.yml文件做了配置,但是配置未生效 #321

Closed 3468998 closed 3 months ago

3468998 commented 3 months ago

Issue Checklist | Issue 检查清单

Expected behavior | 预期行为

做的配置应该能够生效,应该是一个比较完整的网站,而不是比较初始的网站

Actual behavior | 实际行为

Steps to reproduce the behavior | 重现步骤

  1. 我安装keep操作手册在keep的_config.yml文件做的配置
  2. 使用更新的命令后,网站并没有更新成功

Node.js and NPM Information | Node.js 和 NPM 信息

v20.12.2
10.5.0

Hexo Configuration | Hexo 配置

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Hexo
subtitle: ''
description: ''
keywords:
author: John Doe
language: en
timezone: ''

search:
  path: search.json
  field: post
  content: true
  format: striptags

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://example.com
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
syntax_highlighter: highlight.js
highlight:
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  preprocess: true
  line_number: true
  tab_replace: ''

# 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
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# 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: keep

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: git@github.com:3468998/3468998.github.io.git
  branch: gh-pages

Keep Configuration | Keep 配置

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

base_info:
  primary_color: "#669999"
  title: yudeyoushang
  author: Yang
  avatar: /images/avatar.svg
  logo: /images/logo.svg
  favicon: /images/logo.svg

menu:
  home: / || fa-solid fa-home                         # 首页
  archives: /archives || fa-solid fa-box-archive      # 归档
  #tags: /tags || fa-solid fa-tags                     # 标签
  categories: /categories || fa-solid fa-layer-group  # 分类
  links: /links || fa-solid fa-link                   # 链接
  about: /about || fa-solid fa-user-graduate          # 关于
  #photos: /photos || fa-solid fa-image                # 相册
  comment: true

first_screen:
  enable: true        # Option values: true | false
  background_img: https://keep.xpoet.cn/images/bg.svg
  background_img_dark: https://keep.xpoet.cn/images/bg-dark.svg
  description: 人后的苦尚且还能克服 || 人前的尊严却无比脆弱
  hitokoto: false      # Option values: true | false

social_contact:
  enable: true      # Option values: true | false
  links: https://fontawesome.com/icons/instagram?f=brands&s=solid
    #github:          # GitHub
    weixin: img | /images/wechat.png         # WeChat
    qq: img | /images/qq.png             # QQ
    #weibo:           # WeiBo
    #zhihu:           # ZhiHu
    #twitter:         # Twitter
    #x:               # X
    #facebook:        # Facebook
    email: MjQ2NzUyNDQ3OEBxcS5jb20=          # Email

# Site
title: Keep
subtitle: Hexo theme keep quick starter
description: ''
keywords:
author: Keep Team
language: en  # en | zh-CN | zh-TW
timezone: ''

home:
  announcement:
  category: true           # Option values: true | false
  tag: true                # Option values: true | false
  post_datetime: created  || fa-solid fa-home   # Option values: updated | created
  post_datetime_format: YYYY-MM-DD HH:mm:ss # Option values: ago | YYYY-MM-DD HH:mm:ss

post:
  author_badge:
    enable: true         # Option values: true | false
    level_badge: true    # Option values: true | false
    custom_badge: ["One", "Two", "Three"]
  word_count:
    wordcount: true     # Word count, one article. Option values: true | false
    min2read: true      # Time to read, one article. Option values: true | false
  datetime_format: "YYYY-MM-DD HH:mm:ss"  # Datetime format. e.g. "YYYY-MM-DD HH:mm:ss"
  copyright_info: false  # Option values: true | false
  share: true           # Option values: true | false
  reward:
    enable: true        # Option values: true | false
    img_link: /images/2.jpg           # Image link for the payment QR code
    text:  请作者喝水.              # Custom reward text, Can be null
    img_align: center

code_block:
  tools:
    enable: true             # Option values: true | false
    style: mac            # Option values: default | mac
  highlight_theme: default    # Option values: default | obsidian

website_count:
  busuanzi_count:
    enable: true     # Option values: true | false
    site_uv: true # Option values: true | false
    site_pv: true    # Option values: true | false
    page_pv: false    # Option values: true | false

local_search:
  enable: ture      # Option values: true | false
  preload: ture     # Preload the search data when the page loads

cdn:
  enable: ture       # Option values: true | false
  provider: cdnjs     # Option values: cdnjs | jsdelivr | unpkg

pjax:
  enable: ture   # Option values: true | false

footer:
  since: 2024           # The starting year of your website, Can be null
  word_count: ture     # Option values: true | false

  icp:
    enable: false                    # Option values: true | false
    record_code:                     # ICP record code of your website
    url: https://beian.miit.gov.cn   # Your ICP link url, Can be null

  site_deploy:
    enable: false        # Option values: true | false

    # Option values: github | vercel | netlify | cloudflare | gitee | aliyun | tencent_cloud | upyun
    provider: github     

    url:                 # Your deployment provider url, Can be null

  shields_style:
    enable: false        # Option values: true | false
    custom:
      - link_url:        # Your link url, Can be null
        img_url:         # Shields image url

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://example.com
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
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

# 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
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# 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: keep

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: ''

Other Information | 其它信息

Microsoft Edge win11

XPoet commented 3 months ago

你的 Keep 主题配置文件存放在哪里?

XPoet commented 3 months ago

如果你使用 NPM 安装 Keep 主题,那么需要把 node_modules/hexo-theme-keep/_config.yml 路径下的主题配置文件复制到 your-hexo/source/_data/keep.ymlyour-hexo/_config.keep.yml

3468998 commented 3 months ago

如果你使用 NPM 安装 Keep 主题,那么需要把 路径下的主题配置文件复制到 或 。node_modules/hexo-theme-keep/_config.yml``your-hexo/source/_data/keep.yml``your-hexo/_config.keep.yml

复制后但是还是没有变化啊,然后我都不能使用域名访问了,不知道咋回事,昨天晚上都可以,配置文件放在hexo目录下的

XPoet commented 3 months ago

你提供的有效信息不详情,另外也不存在修改 Keep 主题配置文件不生效的情况,你再好好检查下你的 Keep 主题配置文件存储路径是否可以被正确读取