基于Pacman主题的Hexo修改

前言

Hexo就不用多做介绍了,经过简单的基础配置即可使用,当然默认主题也未必适合所有人,我自己采用的Theme是 Pacman ,下面将具体分享自己的修改经验。

Pacman是一款为Hexo打造的一款扁平化,有着响应式设计的主题。

更新历史

2014年12月09日 - 撰写初稿

阅读原文 - http://wsgzao.github.io/post/hexo-pacman/

扩展阅读

主题安装

设置很简单,请参考原文中文说明

http://yangjian.me/pacman/hello/introducing-pacman-theme/

配置yml

这是我自己的真实配置文件,请参考原文注释做修改

全局yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

# Hexo Configuration

## Docs: http://hexo.io/docs/configuration.html

## Source: https://github.com/tommy351/hexo/

# Site

title: HelloDog

subtitle: Keep Calm and Carry On

description: HelloDog是一个基于Github和Hexo的静态Blog,希望用简单而清晰的写作方式Markdown分享自己的心得体会。

author: wsgzao

email: 644273006@qq.com

language: zh-CN

# URL

## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'

url: http://wsgzao.github.io/

root: /

permalink: post/:title/

tag_dir: tags

archive_dir: archives

category_dir: categories

code_dir: downloads/code

# Directory

source_dir: source

public_dir: public

# Writing

new _post_ name: :title.md # File name of new posts

default_layout: post

auto_spacing: false # Add spaces between asian characters and western characters

titlecase: false # Transform title into titlecase

external_link: true # Open external links in new tab

max _open_ file: 100

multi_thread: true

filename_case: 0

render_drafts: false

post _asset_ folder: false

highlight:

enable: true

line_number: true

tab_replace:

# Category & Tag

default_category: uncategorized

category_map:

tag_map:

# Archives

## 2: Enable pagination

## 1: Disable pagination

## 0: Fully Disable

archive: 1

category: 1

tag: 1

# Server

## Hexo uses Connect as a server

## You can customize the logger format as defined in

## http://www.senchalabs.org/connect/logger.html

port: 4000

server_ip: 0.0.0.0

logger: false

logger_format:

# Date / Time format

## Hexo uses Moment.js to parse and display date

## You can customize the date format as defined in

## http://momentjs.com/docs/#/displaying/format/

date_format: YYYY年MM月DD日

time_format: H:mm:ss

# Pagination

per_page: 5

pagination_dir: page

# Disqus

disqus_shortname:

# Extensions

## Plugins: https://github.com/tommy351/hexo/wiki/Plugins

## Themes: https://github.com/tommy351/hexo/wiki/Themes

theme: pacman

exclude_generator:

# Deployment

## Docs: http://hexo.io/docs/deployment.html

deploy:

plugins:

- hexo-generator-feed

- hexo-generator-sitemap

主题yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

##### Menu

menu:

主页 | Home: /

索引 | Index: /index

归档 | Archives: /archives

简介 | About: /about

## you can create `tags` and `categories` folders in `../source`.

## And create a `index.md` file in each of them.

## set `front-matter`as

## layout: tags (or categories)

## title: tags (or categories)

## ---

#### Widgets

widgets:

- category

- tag

- archive

- links

- rss

## provide six widgets:category,tag,rss,archive,tagcloud,links.

## modify links in `/layout/_widget/links.ejs`.

#### RSS

rss: /atom.xml

#### Image

imglogo:

enable: true ## display image logo true/false.

src: img/logo.png ## `.svg` and `.png` are recommended,please put image into the theme folder `/pacman/source/img` .

favicon: img/favicon.png ## size:32px*32px, `.ico` is recommended,please put image into the theme folder `/pacman/source/img` .

apple_icon: img/iDog.jpg ## size:114px*114px,please put image into the theme folder `/pacman/source/img` .

#### Author Avatar Picture

author _img_ enable: true ## display author avatar picture

dataURI: false

## if the picture's format is dataURI please set the value to true,otherwise set the value to false.

## convert an image into base 64 data URIs http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/ .

author _img_ data: ''

## paste the dataURI in ONE LINE and included it by ''.

author_img: img/author.jpg ## size:220px*220px.

## if the picture's format is `.png` or `.jpg` instead of dataURI,you should set the `dataURI` value to false.

#### Font

ShowCustomFont: true

## you can change custom font in `variable.styl` and `font.styl` which in the theme folder `/pacman/source/css`.

#### Toc

toc:

article: true ## show contents in article.

aside: true ## show contents in aside.

## you can set both of the value to true of neither of them.

## if you don't want display contents in a specified post,you can modify `front-matter` and add `toc: false`.

#### Fancybox

fancybox: true

## if you use gallery post or want use fancybox please set the value to true.

## if you want use fancybox in ANY post please copy the file `fancybox.js`.

## in theme folder `/pacman/scripts` to your hexo blog folder `../scritps`.

#### Author information

author:

google_plus: ## eg:116338260303228776998 for https://plus.google.com/u/0/116338260303228776998

intro_line1: "Hello, I'm OX. This is my blog on GitHub." ## eg: "Hello ,I'm Larry Page in Google."

intro_line2: "Try to do better." ## eg: "This is my blog,believe it or not."

weibo: wsgzao ## e.g. 436062867 for http://weibo.com/436062867

twitter: wsgzao ## e.g. yangjiansky for https://twitter.com/yangjiansky

github: wsgzao ## e.g. A-limon for https://github.com/A-limon

facebook: wsgzao ## e.g. yangjian for https://favebook.com/yangjian

tsina: wsgzao ## e.g. 1664838973 Your weibo ID,It will be used in share button.

linkedin: in/aowang ##?e.g. in/jeffweiner08 for https://www.linkedin.com/in/jeffweiner08

#### Comment

duoshuo:

enable: true ## duoshuo.com

short_name: wsgzao ## duoshuo short name.

#### Share button

jiathis:

enable: false ## if you use jiathis as your share tool,the built-in share tool won't be display.

id: 1503875 ## e.g. 1501277 your jiathis ID.

tsina: wsgzao ## e.g. 1664838973 Your weibo id,It will be used in share button.

#### Baidu Analytics

baidu_analytics: true

#### Analytics

google_analytics:

enable: false

id: ## e.g. UA-1766729-8 your google analytics ID.

site: ## e.g. yangjian.me your google analytics site or set the value as auto.

## You MUST upgrade to Universal Analytics first!

## https://developers.google.com/analytics/devguides/collection/upgrade/?hl=zh_CN

#### Custom Search

google_cse:

enable: false

cx: ## e.g. 018294693190868310296:abnhpuysycw your Custom Search ID.

## https://www.google.com/cse/

## To enable the custom search You must create a "search" folder in '/source' and a "index.md" file

## set the 'front-matter' as

## layout: search

## title: search

## ---

baidu_search: ## http://zn.baidu.com/

enable: true

id: 1945364396832125023 ## e.g. "783281470518440642" for your baidu search id

site: http://zhannei.baidu.com/cse/search ## your can change to your site instead of the default site

其它修改

我来评几句
登录后评论

已发表评论数()

相关站点

+订阅
热门文章