关于前端:基于-Hexo-从零开始搭建个人博客四

4次阅读

共计 3513 个字符,预计需要花费 9 分钟才能阅读完成。

有些成果无奈在这儿体现,如果想看残缺的成果,请移步集体站点。

原文链接:基于 Hexo 从零开始搭建集体博客(四)

浏览本篇前,请先浏览前几篇文章:
基于 Hexo 从零开始搭建集体博客(一)
基于 Hexo 从零开始搭建集体博客(二)
基于 Hexo 从零开始搭建集体博客(三)

前言

  1. 博客搭建过程遇到任何问题,优先在本页面搜寻,查看是否曾经有该配置教程。
  2. 遇到问题能够优先在文章评论区留言,留神留言时请填写正确的邮箱以确保能收到站长的回复。
  3. 切实解决不了的问题可增加站长 Wechat,增加好友时请备注本人的姓名 + 业余,如 张三 计算机科学与技术。

Front-matter

Front-mattermarkdown 文件最上方以 --- 分隔的区域,用于指定个别档案的变数。

  • Page Front-matter 用于页面配置
  • Post Front-matter 用于文章页配置

{% note pink no-icon flat %}
如果标注可选的参数,可依据本人须要增加,不必全副都写在 markdown 里
{% endnote %}

Page Front-matter

---
title:
date:
updated:
type:
comments:
description:
keywords:
top_img:
mathjax:
katex:
aside:
aplayer:
highlight_shrink:
---
写法 解释
title 【必须】页面题目
date 【必须】页面创立日期
type 【必须】标籤、分类和友情链接三个页面须要配置
updated 【可选】页面更新日期
description 【可选】页面形容
keywords 【可选】页面关键字
comments 【可选】显示页面评论模块(默认 true)
top_img 【可选】页面顶部图片
mathjax 【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才须要配置,默认 false)
katex 【可选】显示 katex(当设置 katex 的 per_page: false 时,才须要配置,默认 false)
aside 【可选】显示侧边栏 (默认 true)
aplayer 【可选】在须要的页面加载 aplayer 的 js 和 css, 请参考文章上面的音乐 配置
highlight_shrink 【可选】配置代码框是否开展(true/false)(默认为设置中 highlight_shrink 的配置)

Post Front-matter

---
title:
date:
updated:
tags:
categories:
keywords:
description:
top_img:
comments:
cover:
toc:
toc_number:
toc_style_simple:
copyright:
copyright_author:
copyright_author_href:
copyright_url:
copyright_info:
mathjax:
katex:
aplayer:
highlight_shrink:
aside:
---
写法 解释
title 【必须】文章题目
date 【必须】文章创立日期
updated 【可选】文章更新日期
tags 【可选】文章标籤
categories 【可选】文章分类
keywords 【可选】文章关键字
description 【可选】文章形容
top_img 【可选】文章顶部图片
cover 【可选】文章缩略图(如果没有设置 top_img, 文章页顶部将显示缩略图,可设为 false/ 图片地址 / 留空)
comments 【可选】显示文章评论模块(默认 true)
toc 【可选】显示文章 TOC(默认为设置中 toc 的 enable 配置)
toc_number 【可选】显示 toc_number(默认为设置中 toc 的 number 配置)
toc_style_simple 【可选】显示 toc 简洁模式
copyright 【可选】显示文章版权模块(默认为设置中 post_copyright 的 enable 配置)
copyright_author 【可选】文章版权模块的文章作者
copyright_author_href 【可选】文章版权模块的文章作者链接
copyright_url 【可选】文章版权模块的文章连结链接
copyright_info 【可选】文章版权模块的版权申明文字
mathjax 【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才须要配置,默认 false)
katex 【可选】显示 katex(当设置 katex 的 per_page: false 时,才须要配置,默认 false)
aplayer 【可选】在须要的页面加载 aplayer 的 js 和 css, 请参考文章上面的音乐 配置
highlight_shrink 【可选】配置代码框是否开展(true/false)(默认为设置中 highlight_shrink 的配置)
aside 【可选】显示侧边栏 (默认 true)

留神:我的博客根目录门路为【G:/hexo-blog/blog-demo】,下文所说的根目录都是此门路,将用 [BlogRoot] 代替。如果不分明根目录门路,请回到教程 基于 Hexo 从零开始搭建集体博客(二),查看你执行 hexo init xxx 这条命令时所抉择的门路,例如我抉择的门路是【G:/hexo-blog】,我的博客根目录即为【G:/hexo-blog/xxx】。

标签页

  1. 返回你的 Hexo 博客根目录,关上 cmd 命令窗口执行hexo new page tags
  2. 在【BlogRoot/source/】会生成一个含有 index.md 文件的 tags 文件夹。
  3. 批改【BlogRoot/source/tags/index.md】,增加type: "tags"

    ---
    title: tags
    date: 2022-05-29 21:42:56
    type: "tags"
    ---

分类页

  1. 返回你的 Hexo 博客根目录,关上 cmd 命令窗口执行hexo new page categories
  2. 在【BlogRoot/source/】会生成一个含有 index.md 文件的 categories 文件夹。
    {% image https://bu.dusays.com/2022/05… %}
  3. 批改【BlogRoot/source/categories/index.md】,增加type: "categories"

    ---
    title: categories
    date: 2022-05-29 21:57:07
    type: "categories"
    ---

友情链接

创立友情链接页面

  1. 返回你的 Hexo 博客根目录,关上 cmd 命令窗口执行hexo new page link
  2. 在【BlogRoot/source/】会生成一个含有 index.md 文件的 link 文件夹。
  3. 批改【BlogRoot/source/link/index.md】,增加type: "link"

    ---
    title: link
    date: 2022-05-29 22:03:35
    type: "link"
    ---

友情链接页面增加友链信息

返回 Hexo 博客目录(【BlogRoot/source/_data】)创立一个文件link.yml(如果沒有 _data 文件夹,请自行创立)。

- class_name: 友情链接
  class_desc: 那些人,那些事
  link_list:
    - name: 唐志远の博客
      link: https://tzy1997.com/
      avatar: https://bu.dusays.com/2022/01/14/cd5ffd485f867.jpg
      descr: 古今之成小事者,不惟有超世之才,亦必有坚忍不拔之志。- class_name: 网站
  class_desc: 值得举荐的网站
  link_list:
    - name: Twitter
      link: https://twitter.com/
      avatar: https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png
      descr: 社交分享平台

class_nameclass_desc 反对 html 格局,如不须要,也能够留空。

如果你想设置老本站友链页的成果,请参考教程:基于 Butterfly 的外挂标签引入。

图库

该成果无奈展示,请浏览原文。

原文链接:基于 Hexo 从零开始搭建集体博客(四)

子页面

该成果无奈展示,请浏览原文。

原文链接:基于 Hexo 从零开始搭建集体博客(四)

404 页面

主題內置了一个简略的 404 页面,可在设置中凋谢。

如需本地预览,请拜访 http://localhost:4000/404.html

# A simple 404 page
error_404:
  enable: true
  subtitle: "页面沒有找到"
  background: 
正文完
 0