为什么重复点击hexo博客的标签(tags)按钮会报错?

发布于 2022-09-11 19:16:00 字数 3498 浏览 15 评论 0

为什么点击hexo博客的标签(tags)按钮进入到/tags页面,
再点击标签按钮会进入到/tags/tags页面报错这样子?
错误如图
图片描述
图片描述
用的主题是next

next文件夹内的_config.yml文件中关于menue的代码如下

# ---------------------------------------------------------------
# Menu Settings
# ---------------------------------------------------------------

# When running the site in a subdirectory (e.g. domain.tld/blog), remove the leading slash from link value (/archives -> archives).
# Usage: `Key: /link/ || icon`
# Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-senstive.
# Value before `||` delimeter is the target link.
# Value after `||` delimeter is the name of FontAwesome icon. If icon (with or without delimeter) is not specified, question icon will be loaded.
# External url should start with http:// or https://
menu:
  home: http://www.zintown.top/ || home
  about: about/ || user
  tags: tags/ || tags
  categories: categories/ || th
  archives: archives/ || archive
  schedule: schedule/ || calendar
  reading: books/ || book
  #sitemap: /sitemap.xml || sitemap
  #commonweal: /404/ || heartbeat

# Enable / Disable menu icons / item badges.
menu_settings:
  icons: true
  badges: true

根目录的_config.yml代码如下


# Site
title: Zintown
subtitle: Stay hungry.Stay foolish.
description: 
keywords:
author: tong ouyang
language:
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://zintown.top/
root: /
permalink: posts/:category/:year-:month-:day-:title.html
permalink_defaults:

# 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: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: true
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  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: categorized
category_map:
tag_map:

# 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

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

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

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repository: https://github.com/zintown/zintown.github.io.git
  branch: master

已经hexo new page tags & categores
tags&categores文件夹内的index.md也均设置过了
检查了tags大小写是一致的

tags文件夹的index.md 代码如下

title: tags
date: 2019-04-17 23:04:53
type: "tags"

搞了一晚上实在是没招了,希望老哥们能帮忙解答一下。。。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ゝ偶尔ゞ 2022-09-18 19:16:00

把博客目录文件夹删掉了,重新安装一遍next主题,再重新sudo hexo init就好了,具体的错误原因还是没找到。。。

兔姬 2022-09-18 19:16:00

虽然好像不是这个问题,但是你试试把next的主题配置文件_config.yml中做以下修改?

menu:
  home: http://www.zintown.top/ || home
  about: about/ || user
  tags: tags/ || tags
  categories: categories/ || th
  archives: archives/ || archive
  schedule: schedule/ || calendar
  reading: books/ || book

把这种前面都加上个/变成下面这样:

menu:
  home: http://www.zintown.top/ || home
  about: /about/ || user
  tags: /tags/ || tags
  categories: /categories/ || th
  archives: /archives/ || archive
  schedule: /schedule/ || calendar
  reading: /books/ || book
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文