本文的博客搭建採用了靜態博客技術 。html
Hexo 是一個快速、簡潔且高效的博客框架。Hexo 使用 Markdown(或其餘渲染引擎)解析文章,在幾秒內,便可利用靚麗的主題生成靜態網頁。node
參考網站:https://hexo.io/zh-cn/docs/index.htmlgit
sudo yum install git-core程序員
Wget:github
$ wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh
安裝完成後,重啓終端並執行下列命令便可安裝 Node.js。面試
$ nvm install stable
安裝 Hexo
全部必備的應用程序安裝完成後,便可使用 npm 安裝 Hexo。npm
$ npm install -g hexo-clibash
1.新建repo微信
2.設置名字爲username.github.iohexo
3.點擊setting,選擇launch automatic page generater,而後點擊continue to layouts,開通pages
hexo init folder
cd folder
npm install
_config文件裏面包含了配置信息
基本的配置信息介紹
參數 描述
title 網站標題
subtitle 網站副標題
description 網站描述
author 您的名字
language 網站使用的語言
timezone 網站時區。Hexo 默認使用您電腦的時區。時區列表。好比說:America/New_York, Japan, 和 UTC 。
參數 描述 默認值
url 網址
root 網站根目錄
permalink 文章的 永久連接 格式 :year/:month/:day/:title/
permalink_default 永久連接中各部分的默認值
網站存放在子目錄
若是您的網站存放在子目錄中,例如 http://yoursite.com/blog,則請將您的 url 設爲 http://yoursite.com/blog 並把 root 設爲 /blog/。
參數 描述 默認值
source_dir 資源文件夾,這個文件夾用來存放內容。 source
public_dir 公共文件夾,這個文件夾用於存放生成的站點文件。 public
tag_dir 標籤文件夾 tags
archive_dir 歸檔文件夾 archives
category_dir 分類文件夾 categories
code_dir Include code 文件夾 downloads/code
i18n_dir 國際化(i18n)文件夾 :lang
skip_render 跳過指定文件的渲染,您可以使用 glob 表達式來匹配路徑。
hexo g # 或者hexo generate
hexo s # 或者hexo server,能夠在http://localhost:4000/ 查看
npm install hexo-deployer-git --save
cd
$ git clone clone地址連接
fengsehng.github.io是個人項目名字
#!/bin/bash # This is our first script. hexo generate cp -R public/* fengsehng.github.io cd fengsehng.github.io git add . git commit -m 「update」 git push origin master
hexo技巧:
=======
在工程目錄下添加插件
添加sitemap和feed插件
npm install hexo-generator-feed
npm install hexo-generator-sitemap
修改_config.yml,增長如下內容
# Extensions Plugins: - hexo-generator-feed - hexo-generator-sitemap #Feed Atom feed: type: atom path: atom.xml limit: 20 #sitemap sitemap: path: sitemap.xml
hexo new "postName" 新建文章
hexo new page "pageName" 新建頁面
參考:
http://jiji262.github.io/2016/04/15/2016-04-15-hexo-github-pages-blog/
http://www.jianshu.com/p/05289a4bc8b2
https://hexo.io/zh-cn/docs/configuration.html
歡迎關注《IT面試題彙總》微信訂閱號。天天推送經典面試題和麪試心得技巧
===============================