Skip to content
Simon Ma edited this page Jan 13, 2018 · 11 revisions

站点配置

编辑站点配置文件,hexo/_config.yml。

启用主题

theme: tomotoes

基本配置

为了得到更好的使用体验,以下内容请务必填写完整,因为这些内容会在主题中得到展示。更多

title: your title
subtitle: your subtitle
description: your description
keywords: your keywords
author: your name
email: your email
url: your site url

feed配置

参考hexo-generator-feed

feed:
  type: atom
  path: atom.xml
  limit: 0

jsonContent配置

为了节约资源,可以对 jsonContent 插件生成的数据字段进行配置。参考 hexo-generator-json-content

jsonContent:
  meta: false
  pages: false
  posts:
    title: true
    date: true
    path: true
    text: true
    raw: false
    content: false
    slug: false
    updated: false
    comments: false
    link: false
    permalink: false
    excerpt: false
    categories: false
    tags: true

abbrlink配置

有利于seo,主题脚本对其有依赖,需要覆盖原有信息

# URL
url: http://tomotoes.com/
root: /
permalink: /posts/:abbrlink/  # **一定要配置好这里,非常重要**
permalink_defaults:

# abbrlink config
abbrlink:
  alg: crc32  # 算法:crc16(default) and crc32
  rep: hex    # 进制:dec(default) and hex

Emoji配置

具体可参照此文档 我的配置如下,使用时参考 Emoji表,如果我想:sunglasses: ,在文章中键入 :sunglasses:即可

githubEmojis:
  enable: true
  className: github-emoji
  unicode: false
  styles:
  localEmojis:

主题配置

编辑主题配置文件,themes/tomotoes/_config.yml。

主菜单

# 例子
# home 就是图标的标识 从这里挑选http://fontawesome.io/icons/ 图标,把图标下面的文字替换即可使用
#   text :显示文本
#   url : 链接
#   target: 链接的锚点 是否在本站中打开链接

# 主菜单
menu:
  home:
    text: 主 页
    url: /
  archives:
    text: 归 档
    url: /archives
  th-list:
    text: 分 类
    url: /categories
  tags:
    text: 标 签
    url: /tags
  smile-o:
    text: 关 于
    url: /about

小图标菜单

# 图标菜单
# 如果您没有微信公众号 您完全可以更改为 其他的链接 比如微博
menu2:
  envelope-o:
    text: Email
    url: mailto:1755811882@qq.com
    target: _parent
  github:
    text: Github
    url: https://github.com/tomotoes
    target: _blank
  weibo:
    text: 微博
    url: https://weibo.com/u/6179399347
    target: _blank

必备图片

# 你的头像url
avatar: /img/avatar.jpg
# avatar link
avatar_link: /
# favicon
favicon: /img/favicon.ico
# 微信公众号
wechat: /img/wechat.jpg

座右铭

# 座右铭
# mymotto:  关闭一言
#  content: 用此内容代替一言
mymotto: false
# content: 我的座右铭

网站开启时间

# 网站开启时间
startime: 2017/10/11

页面标题

# 首页副标题
homesubtitle: 在Web全栈的道路上努力前行...

# 归档页标题
archivestitle: 路漫漫其修远兮

# 标签页标题
tagstitle: 不积小流无以成江海

# 分类页标题
categoriestitle: 不积跬步无以至千里

# 关于页标题
aboutitle: 一个坏掉的番茄 

tags_title: 标签
archives_title: 归档
categories_title: 分类

评论插件

# 是否使用 gitment,https://github.com/imsun/gitment
gitment: false
# owner: xxx
# repo: xxx
# client_id: xxx
# client_secret: xxx

gitalk: 
  owner: xxx
  repo: xxx
  client_id: xxx
  client_secret: xxx

# Valine Comment system. https://valine.js.org
valine:
  enable: false # 如果你想使用valine,请将值设置为 true
  appId:  # your leancloud appId
  appKey:  # your leancloud appKey
  notify: false # Mail notify
  verify: false # Verify code
  avatar: mm # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
  placeholder: Just go go # Comment Box placeholder
  guest_info: nick,mail,link # Comment header info
  pageSize: 10 # comment list page size

文章截断

excerpt_render: true
excerpt_length: 175
excerpt_link: 阅读全文 »
mathjax: false
archive_yearly: true

打赏

# 是否开启打赏,关闭 reward: false
reward:
  title: 感谢您的鼓励支持!     #打赏回馈话语
  wechat: /img/wechat.png     #微信,关闭设为 false
  alipay: /img/alipay.png     #支付宝,关闭设为 false
  wechatalipay: /img/dog.png  #点击打赏时显示的图片

导航菜单

# 是否大屏幕下文章页隐藏导航
hideMenu: true

分享

# 是否开启分享
share: true

动画特效配置

tomotoes\layout_partial\switch.ejs文件,您可以在这里进行动画的舍取

if(window.innerWidth > 600){
    /* 3D标题 */
    $('.content-header').on('mousemove', threedee);

    /* 底部追随鼠标 */
    $(".footer").hover(2);

    /* gotop键的涟漪 */
    $("#gotop").hover(1);

    /* 赞赏的粒子雨 */
    $("#reward").hover(3);

    /* 微信公众号的底部渲染 */
    $("#wechat").hover(4);
}

/* 名字跳动 */
$('#name').bumpyText();


/* 网站运行时间 */
setInterval(function () {
    setTime('<%- theme.startime %>')
}, 1000);

/* 文章块的淡出 */
postshow();

/* 座右铭 */
<% if(theme.mymotto) { %>
    elasticText({
        id: 'mymotto',
        duration: 100,
        effact: 'easeOut',
        content: '<%- theme.mymotto.content %>'
    });
<% } else {%>
   get_hitokoto();
<% } %>


/* 粘贴提示 */
G($('.post-content'), location.href, '<%- config.author %>');


/* 控制台 */
if (window.console && window.console.log) {
    setTimeout(function () {
        console.log('\n %c 一个坏掉的番茄 %c  © Simon Ma  http://tomotoes.com \n\n', 'color:#FFFFFB;background:#1abc9c;padding:5px 0;border-radius:.5rem 0 0 .5rem;', 'color:#FFFFFB;background:#080808;padding:5px 0;border-radius:0 .5rem .5rem 0;');
    }, 0);
}