NexT主題爬坑記

官方文檔

一、設(shè)置文章底部版權(quán)信息

打開主題配置文件_config.yml,找到creative_commons

creative_commons:
  license: by-nc-sa
  sidebar: false
  post: true #設(shè)置為true
  language:

Creative commons協(xié)議,這個(gè)就是設(shè)置版權(quán)聲明

二、添加標(biāo)簽頁

  • 新建頁面:
    前面通過修改next主題下的_config.yml文件中的menu選項(xiàng),可以在主頁面的菜單欄添加標(biāo)簽選項(xiàng),但是此時(shí)點(diǎn)擊標(biāo)簽,跳轉(zhuǎn)的頁面會(huì)顯示page not found。
hexo new page tags    #新建標(biāo)簽頁面

輸入命令后,在根目錄/source會(huì)生成一個(gè)tags文件夾,其中有個(gè)index.md文件。

  • 設(shè)置頁面類型:
    修改index.md,添加type:tags
---
title: tags
date: 2016-11-15 19:10:05
type:  tags
---  
  • 設(shè)置文章的標(biāo)簽:
    當(dāng)要為某篇文章添加標(biāo)簽時(shí),只需在文章開頭設(shè)置相應(yīng)標(biāo)簽即可。
---
title: test1    #文章標(biāo)簽
date: 2017-09-20 13:29:11
tags:         #標(biāo)簽
  - test1
  - one
  - two
categories: 測(cè)試     #分類
---   
ps:注意這是在新建文章里添加標(biāo)簽  

三、添加分類、關(guān)于頁面

hexo new page categories/about 

根目錄/source生成文件夾的中修改index.md文件中type類型分別為categories和about即可

  • 文章添加分類
---
title: test1
date: 2017-09-20 13:29:11
tags:
  - test1
  - one
  - two
categories: 測(cè)試     #添加為測(cè)試類
---  
ps:注意這是在新建文章里添加分類
  • 添加關(guān)于我
---
title: 關(guān)于我
date: 2017-09-17 10:22:54  
type: about 
comments: false
---
一只快樂的小菜鳥,歡迎分享知識(shí)。
ps:注意這是在about文件夾里修改index.md文件

四、添加公益404

新建 404.html 頁面,放到主題的 source 目錄下,內(nèi)容如下:

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="robots" content="all" />
  <meta name="robots" content="index,follow"/>
  <link rel="stylesheet" type="text/css" >
</head>
<body>
  <script type="text/plain" src="http://www.qq.com/404/search_children.js"
          charset="utf-8" homePageUrl="/"
          homePageName="回到我的主頁">
  </script>
  <script src="https://qzone.qq.com/gy/404/data.js" charset="utf-8"></script>
  <script src="https://qzone.qq.com/gy/404/page.js" charset="utf-8"></script>
</body>
</html>

效果如下 http://www.ixirong.com/404.html

五、添加搜索

  • 安裝 hexo-generator-searchdb,在站點(diǎn)的根目錄下執(zhí)行以下命令:
npm install hexo-generator-searchdb --save 
  • 編輯 站點(diǎn)配置文件,新增以下內(nèi)容到任意位置:
search:
  path: search.xml
  field: post
  format: html
  limit: 10000 
  • 編輯 主題配置文件,啟用本地搜索功能:
# Local search
local_search:
  enable: true    #true開啟

六、添加文章字?jǐn)?shù)統(tǒng)計(jì)和閱讀時(shí)長

  • 根目錄命令運(yùn)行
npm install hexo-symbols-count-time --save
  • 根目錄配置文件_config.yml底部添加如下內(nèi)容:
symbols_count_time:
  #文章內(nèi)是否顯示
  symbols: true
  time: true
  #網(wǎng)頁底部是否顯示
  total_symbols: true
  total_time: true

更多主題配置,點(diǎn)擊這里
博客搭建高級(jí)應(yīng)用,點(diǎn)擊這里
官方主題文檔,點(diǎn)擊這里
官方三方服務(wù)文檔,點(diǎn)擊這里

多看官方文檔、多看官方文檔、多看官方文檔

持續(xù)更新中...

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容