fan-lv / Fan

hexo-theme
159 stars 36 forks source link

404页面问题 #26

Closed Jiaoding closed 3 years ago

Jiaoding commented 4 years ago

hexo new page 404后添加title: Page Not Found,permalink: /404,页面的确转跳404,但是标题是menu.Page Not Found

如图

fan-lv commented 3 years ago

404的md文件中有写上title吗

---
title: 分类
type: "categories"
---
Jiaoding commented 3 years ago

title为Page Not Found,显示的是menu.Page Not Found 没有title时,显示的是menu. 404的md没有加type @fan-lv

fan-lv commented 3 years ago

image 需要在语言的文件下面配置 image

Jiaoding commented 3 years ago

404目录在主目录下面的source目录下,404目录下的index.md填写的是:

---
title: 页面无法显示
type: "commonweal"
permalink: /404
---

zh-Hans.yml填的是:

menu:
  home: 首页
  archives: 归档
  categories: 分类
  tags: 标签
  about: 关于
  search: 搜索
  schedule: 日程表
  sitemap: 站点地图
  commonweal: 页面无法显示
  friendlink: 友链

页面结果是: 如同我提问附上的图片一样,menu.页面无法显示 @fan-lv

fan-lv commented 3 years ago

按照你说的如果在404页面title写成:

---
title: 页面无法显示
type: "commonweal"
permalink: /404
---

则需要在zh-Hans.yml填写:

menu:
  home: 首页
  archives: 归档
  categories: 分类
  tags: 标签
  about: 关于
  search: 搜索
  schedule: 日程表
  sitemap: 站点地图
  commonweal: 页面无法显示
  friendlink: 友链
  页面无法显示:页面无法显示

同理,可以把404页面的title写成:

---
title: 404
type: "commonweal"
permalink: /404
---

在zh-Hans.yml填写:

menu:
  home: 首页
  archives: 归档
  categories: 分类
  tags: 标签
  about: 关于
  search: 搜索
  schedule: 日程表
  sitemap: 站点地图
  commonweal: 页面无法显示
  friendlink: 友链
  404:页面无法显示
Jiaoding commented 3 years ago

完美解决!