hexo的jacman主题配置

获得更多资料欢迎进入我的网站或者 csdn或者博客园

这是在我搭建博客时用的主题,这个主题时基于pacman修改的,同时我也是借助于wuchong同时他还在一直更新。一下时我的一些基本配置;

相关文章请点击:

使用github和hexo搭建静态博客
hexo的jacman主题配置
hexo博客的相关配置

1安装jacman

在你的博客目录下打开终端执行如下命令即可:

如果你用的是windows,打开git bash.同时jacman要求有hexo版本在2.7以上。

git clone https://github.com/wuchong/jacman.git themes/jacman

2修改你的主题为jacman

修改你的博客根目录下的_config.yml配置文件中的theme属性,将其设置为jacman。

theme: jacman

3博客主目录下config的配置

注意:每一个‘:’都根着一个空格。不然会出错
如果想直接拿我的配置用,请记得将我的部分改成你的。
下面的直接复制可用:

# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site title subtitle description author email 这里的是都可以改成你的部分
title: rlovep
subtitle: Coder,Machine learning
description: peace's blog android | java | html | python |machine learning
author: Peace
language: zh-CN
email: w_peace12@163.com #联系邮箱

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://rlovep.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
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
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  tab_replace:

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# 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: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: http://hexo.io/plugins/
plugins:
- hexo-generator-feed
- hexo-generator-baidu-sitemap

## Themes: http://hexo.io/themes/此去我用的主题是jacman
theme: jacman
stylus:
  compress: true

# Deployment
## Docs: http://hexo.io/docs/deployment.html这里时最重要的部分,对于博客的正常建立
deploy:
  type: git
  repository: git@github.com:wpeace1212/wpeace1212.github.io.git
  branch: master

4主题目录下config的配置

这里的可以直接复制可用,可以跟着注释进行修改;
注意:这里的必须用英文格式编写,尤其时#号要注意用英文格式的;

##### 菜单 
menu:
  主页 | Home: /
  归档 | 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)
## ---

#### 右边显示部分,按着排序进行排序,我用到了分类,标签,友情链接,微博,rss
widgets: 
- category
- tag
- links
- weibo
- rss

#返回顶部按钮,totop。在博客右下脚显示一件返回顶部按钮
totop: true           ## if you want to scroll to top in every post set the value to true
#### RSS 地址
rss: /atom.xml ## RSS address.

#### Image 图片。包括各种图片,可以在jacman主题下source下img文件下找到各种图片,想要换成你的直接换就ok,当然名字扩展名最好用一样的
imglogo:
  enable: true             ## display image logo true/false.
  src: img/logo.png        ## `.svg` and `.png` are recommended,please put image into the theme folder `/jacman/source/img`.
favicon: img/favicon.ico   ## size:32px*32px,`.ico` is recommended,please put image into the theme folder `/jacman/source/img`.     
apple_icon: img/jacman.jpg ## size:114px*114px,please put image into the theme folder `/jacman/source/img`.
author_img: img/author.jpg ## size:220px*220px.display author avatar picture.if don't want to display,please don't set this.
banner_img: #img/banner.jpg ## size:1920px*200px+. Banner Picture
### Theme Color 
theme_color:
    theme: '#2ca6cb'    ##the defaut theme color is blue

# 代码高亮主题
# available: default | night
highlight_theme: default

####首页文章是否展开。默认为展开式,显示 Read More。
index:
  expand: true           ## default is unexpanding,so you can only see the short description of each post.
  excerpt_link: Read More  
###是否在文章页面自动关闭侧边栏

close_aside: false  #close sidebar in post page if true
mathjax: false      #enable mathjax if true

### Creative Commons License Support, see http://creativecommons.org/ 
### you can choose: by , by-nc , by-nc-nd , by-nc-sa , by-nd , by-sa , zero
creative_commons: none

#### 作者信息,显示在网站底部。主要包括,文字介绍,以及图片。还有各种你的链接包括微博等等。换成你id就行;
author:
  intro_line1:  "Hello ,I'm onePeace Page in csdn."    ## your introduction on the bottom of the page
  intro_line2:  " Stay hungary,stay foolish."  ## the 2nd line
  weibo: 2026326475     ## e.g. wuchong1014 or 2176287895 for http://weibo.com/2176287895
  weibo_verifier: 039d33aa  ## e.g. b3593ceb Your weibo-show widget verifier ,if you use weibo-show it is needed.
  tsina: 2026326475     ## e.g. 2176287895  Your weibo ID,It will be used in share button.
  douban:     ## e.g. wuchong1014 or your id for https://www.douban.com/people/wuchong1014
  zhihu: wang-he-ping-78     ## e.g. jark  for http://www.zhihu.com/people/jark
  email: w_peace12@163.com     ## e.g. imjark@gmail.com
  twitter:  wpeace1212  ## e.g. jarkwu for https://twitter.com/jarkwu
  github: wpeace1212    ## e.g. wuchong for https://github.com/wuchong
  facebook:  100006871362068  ## e.g. imjark for https://facebook.com/100006871362068
  linkedin: wpeace1212   ## e.g. wuchong1014 for https://www.linkedin.com/in/wuchong1014
  google_plus: wpeace1212   ## e.g. "111190881341800841449" for https://plus.google.com/u/0/111190881341800841449, the "" is needed!
  stackoverflow:  ## e.g. 3222790 for http://stackoverflow.com/users/3222790/jark
## if you set them, the corresponding  share button will show on the footer

#### 目录,是否在文章中显示目录。显示在侧边栏;
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`.

#### 友情链接
links:
  开发者头条: http://toutiao.io/
  peace in csdn: http://blog.csdn.net/peace1213
  博客园: http://www.cnblogs.com/onepeace/


#### 评论 国内用多说很好。注册账号,写在这里就ok
duoshuo_shortname: rlovep   ## e.g. wuchong   your duoshuo short name.
disqus_shortname:     ## e.g. wuchong   your disqus short name.

#### 主题自带分享,这里用了false
jiathis:
  enable: false ## if you use jiathis as your share tool,the built-in share tool won't be display.
  id:    ## e.g. 1889330 your jiathis ID. 
  tsina: ## e.g. 2176287895 Your weibo id,It will be used in share button.

####网站统计,我用的时cnzz统计
google_analytics:
  enable: false
  id:            ## google analytics ID.
  site:          ## 网站地址.
## You MUST upgrade to Universal Analytics first!
## https://developers.google.com/analytics/devguides/collection/upgrade/?hl=zh_CN
baidu_tongji:
  enable: false
  sitecode: 140e36c412afe791813036c83f602b ## e.g. e6d1f421bbc9962127a50488f9ed37d1 your baidu tongji site code
cnzz_tongji:
  enable: true
  siteid: 1255712369   ## e.g. 1253575964 your cnzz tongji site id

#### Miscellaneous
ShowCustomFont: true  ## you can change custom font in `variable.styl` and `font.styl` which in the theme folder `/jacman/source/css`.
fancybox: true        ## if you use gallery post or want use fancybox please set the value to true.



#### 自定义搜索,我用的时百度搜索
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: 16217304412639601221   ## 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
  
tinysou_search:     ## http://tinysou.com/
  enable: false
  id:  ## e.g. "4ac092ad8d749fdc6293" for your tiny search id


5一些其他的详细介绍

微博秀

如果要启用微博秀,您必须填上author属性下tsina和weibo_verifier的值,前者是您微博ID,后者是您微博秀的验证码,访问 http://app.weibo.com/tool/weiboshow 在如下图位置,可以获得您的 verifier,如:我的是039d33aa 。
微博秀代码

作者信息

作者信息,建议尽量填写完整。其中tsina是你的新浪微博ID,不同于用户名或微博主页地址。启用这个属性后,其他用户在微博上分享你文章的同时会自动@你。同时它和weibo_verifier一起作用生成微博秀。intro_line1和intro_line2是网站底部的个人介绍。weibo、twitter、facebook等是用来显示网站右下角的社交按钮的

toc

是否启用在文章中或侧边栏中的目录功能。二者可以都为true或都为false。同时,如果你希望在特定的某一篇文章中关闭目录功能你可以在文章文件开头中的front-matter中加上一行toc: false。如果希望在某一篇文章中关闭目录自动编号功能你可以在文章文件开头的front-matter中加上一行list_number: false。另外 hexo 2.5.2 开始支持中文目录,想获得更好的体验请升级你的 Hexo 版本。

评论框

填写duoshuo_shortname多说的用户名,启用多说评论系统。在大陆地区更好用的评论系统。

原文地址:https://www.cnblogs.com/onepeace/p/4668780.html