为何我会选用Hxeo来当作Blog框架?
有下面几个原因:
Markdown
语法撰写Blog,更方便、通用、容易上手CICD
工具部署於 Github
上,完全零成本首先先安装 Node.js 官网下载安装
安装完後使用CMD
node -v
npm -v
查看是否安装成功.
使用 npm
来安装 hexo (须先安装 Node.js)
npm install hexo-cli -g
因为我们之前就有建立一个Code Blog Repository.
我们使用CMD
的 CD
命令进入此资料夹目录中
在使用hexo cli
帮助我们快速建立Blog相关档案
hexo init blog # 初始化 blog
npm install # 安装相关套件
如果要把Hexo deploy到Github上面,需要先安装
npm install hexo-deployer-git --save
Hexo
是使用yml档案格式来当设定档.
hexo init blog # 初始化 blog
资料夹档案结构如下图:
当在Blog Code Repository 中建立完Hexo
资料档後会有一个_config.yml
档案,就是Hexo
的设定档案.
title: 石头的coding之路 #网站标题
subtitle:
description: 好点子没价值,有价值的是把好点子实现 #网站描述
keywords:
author: Daniel Shih #您的名字
language: zh-tw #语系
timezone: #时差
# Header
menu:
Home: /
Archives: /archives
About: /about.html
Tags: /tags
Categories: /categories
# URL
url: https://isdaniel.github.io/ #网站的网址
root: / #网站的根目录
permalink: :year/:month/:day/:title/
permalink_defaults:
# Directory
source_dir: source #原始档案资料夹,这个资料夹用於存放您的内容 预设值 source
public_dir: public #使用Hexo g 产生静态档案资料夹名称
tag_dir: tags #标签资料夹名称
archive_dir: archives #汇整资料夹名称
category_dir: categories #分类资料夹名称
code_dir: downloads/code
i18n_dir: :lang #语言资料夹名称
skip_render:
new_post_name: :title.md #新文章的档案名称
default_layout: post #预设布局资料夹
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:
index2_generator:
per_page: 10
order_by: -date
include:
- category Web
exclude:
- tag Hexo
# Date / Time format
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD #日期格式
time_format: HH:mm:ss #时间格式
# Extensions
theme: next #使用主题名称, 设为 false 表示关闭主题功能
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git #发布使用版控类别 使用git
repo: https://github.com/isdaniel/isdaniel.github.io.git #发布到哪个Repository
branch: master #发布使用的分支
# Social Accounts
instagram_url: https://www.instagram.com/dn_shih/
github_url: https://github.com/isdaniel
email_url: [email protected]
设定档可以参考我的_config.yml档案
或是也可以参考官网
Hexo有众多Theme可以选择,我们要切换使用的Theme只需要做几个步骤.
/themes/
资料夹目录下.这次想要跟大家介绍我使用的Next Theme,我会使用原因如下
/themes/
建立一个 next
资料夹并把Next Theme
所有档案copy进去._config.yml
档案,把theme
改成next
下面是我推荐大家使用的Hexo
插件,使用说明我就不一一跟大家解释了网路上很多分享文.
>>: Javascript档案中使用Django template 变数
JavaScript 语句类型可被分为陈述式与表达式,而两者差别叙述如下: 陈述式 Statemen...
今天就来谈谈字串吧。 相信以下这段程序是大家学Java第一天就会写的: class HelloWor...
都是电视剧,难看的你连一分钟都看不下去,好看的却能让你废寝忘食地去追;同样的道理也能放到简报上面。...
前言: 昨天的进度中,我们大致完成了一个由HTML建构起来的网站,只是看起来真的是太阳春了。今天我...
这篇文章算是做个纪录 把工作上遇到的问题,想到其他的解法记录下来 状况 资料因为从map取得,处理过...