hexo 添加標籤和分類

整個過程分類標籤 極其類似,只需要將對應的categories換成了tags 即可

創建頁面

新建一個頁面命名爲categories

$ hexo new page categories     #tags

編輯頁面

編輯新建的頁面source/categories/index.md

---
title: 分類
date: 2018-04-25 22:34:08
type: "categories"
---
---
title: 標籤
date: 2018-04-25 22:34:08
type: "tags"
---

編輯菜單

在菜單中增加鏈接,編輯主題下的_config.yml, 將menu中的categories: /categories註釋去掉:

menu:
  home: / || home
  categories: /categories/ || th
  archives: /archives/ || archive
  tags: /tags/ || tags

實際使用

在文章中添加分類

在文章的頭中增加categories描述

title: hexo 添加標籤和分類
date: 2018-04-27 23:00:34
categories:
- hexo
tags:
- linux

配置別名

在配置中更新別名

其中: 以前的是正式的名稱,以後的是訪問的路徑

category_map:
        hexo:hexo
        ubuntu:ubuntu
        computer vision: computer-vision
tag_map:
        linux:linux
        ubuntu:ubuntu
        vim:vim
        tmux:tmux
        hexo:hexo
        yolo:yolo
        opencv:opencv
        computer vision:computer-vision

部署生效

一定要記得先clean在生成

$ hexo clean
$ hexo g
$ hexo d

更多更及時的博客更新請戳—> KingRumn

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章