更换hexo主题

前言

趁热打铁,写完上一篇,赶紧马不停蹄再来一篇,万一没激情就只不定哪天才能写了。

环境准备

在这挑一款好看的主题,我选的是这个,很简洁。

主题更换

其实每一个主题作者都写了步骤,按照步骤来准没错。

切换到hexo主题目录

1
cd themes

安装

1
git clone https://github.com/esappear/hexo-theme-clover clover

以下为原作者教程,没啥可说的,每个人配置都不一样。

Clover

Preview

preview

Prerequisite

You got a blog project built by Hexo. Your project directory should like this:

1
_config.yml  node_modules  package.json  public  scaffolds  source  themes

Installation

  • Clone the repository.

    1
    git clone https://github.com/esappear/hexo-theme-clover themes/clover
  • Set theme in _config.yml file of the project root:

    1
    theme: clover
  • Add hexo-renderer-sass

    1
    npm install hexo-renderer-sass --save

Features

Free home page.

You can set posts of specific categories or tags in home page.

1
2
3
4
5
6
7
8
9
home:
# set card style of home page
# card: project-card
category: Projects
tag:
- js
- css
except_category: Something
except_tag: 'someTag'

Post which belongs to category or tag and don’t belongs to except_category or except_tag will be filtered.

Page excerpt and photos

You can set an excerpt or photos in Front-matter.

1
2
3
4
5
6
---
layout: post
title: my_post_title
excerpt: my_post_excerpt
photos: [my_photo_url]
---

Tags page.

  • Create a page named tags

    1
    hexo new page "tags"
  • Edit tags page, set page layout to tag.

    1
    2
    3
    4
    5
    ---
    layout: tag
    title: tags
    date: 2018-10-05 12:12:53
    ---

Categories page.

  • Create a page named categories

    1
    hexo new page "categories"
  • Edit categories page, set page layout to category.

    1
    2
    3
    4
    5
    ---
    layout: category
    title: categories
    date: 2018-10-05 12:12:53
    ---

About page.

  • Create a page named about

    1
    hexo new page "about"
  • Edit categories page, set page layout to about.

    1
    2
    3
    4
    5
    ---
    layout: about
    title: about
    date: 2018-10-05 12:12:53
    ---

Social Media

1
2
3
4
5
6
social:
GitHub: your-url
Dribbble: your-url
Behance: your-url
Lofter: your-url
Instagram: your-url

Custom Menu

1
2
3
4
5
menu:
Project: /
Stuffs: /tags/Stuffs
Archive: /archives
About: /about

Card Style

Two kinds of card style: project-card and article-card. (Never mind the name.)

1
2
3
4
5
card_style:
home: project-card
archive: article-card
tag: article-card
category: article-card

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×