Skip to content

Commit

Permalink
FEATURE(Theme): Inited a theme "cactus-light"
Browse files Browse the repository at this point in the history
  • Loading branch information
SuneBear committed Jan 11, 2018
1 parent 5d70afb commit f132856
Show file tree
Hide file tree
Showing 122 changed files with 9,658 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ db.json
node_modules/
public/
.deploy*/
package-lock.json
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@ Yet another website in Yet Another Hole. See: http://yetanotherhole.com

## Introduction

The website is built based on Hexo, and it is used to publish news, products and profiles of YAH, supporting i18n and responsive design.
The website is static built with Hexo, and it is used to publish news, products and profiles of YAH, supporting i18n and responsive design.

## Commands

Expand Down
27 changes: 20 additions & 7 deletions _config.yml
Expand Up @@ -7,22 +7,21 @@ title: Yet Another Hole
subtitle:
description:
author:
language:
timezone:

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

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
archive_dir: blog
tag_dir: blog/tags
category_dir: blog/categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:
Expand Down Expand Up @@ -69,10 +68,24 @@ time_format: HH:mm:ss
per_page: 5
pagination_dir: page

# I18n
language:
- zh-hans
- en
i18n:
type: [page, post]
generator: [index, tag, archive, feed]

# Feed:
feed:
type: atom
path: atom.xml
limit: 20

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: phantom
theme: cactus-light

# Deployment
## Docs: https://hexo.io/docs/deployment.html
Expand Down
16 changes: 14 additions & 2 deletions package.json
Expand Up @@ -4,17 +4,29 @@
"hexo": {
"version": "3.4.4"
},
"scripts": {
"start": "hexo server",
"build": "rm -rf public && hexo generate --debug",
"lint": "standard themes/**/*.js --fix",
"deploy": "npm run build && hexo deploy"
},
"dependencies": {
"hexo": "^3.2.0",
"hexo-deployer-git": "^0.3.1",
"hexo-generator-archive": "^0.1.4",
"hexo-generator-category": "^0.1.3",
"hexo-generator-index": "^0.2.0",
"hexo-generator-feed": "^1.2.2",
"hexo-generator-index": "^0.2.1",
"hexo-generator-tag": "^0.2.0",
"hexo-pagination": "^0.1.0",
"hexo-renderer-ejs": "^0.3.0",
"hexo-renderer-marked": "^0.3.0",
"hexo-renderer-scss": "^1.1.0",
"hexo-renderer-stylus": "^0.3.1",
"hexo-server": "^0.2.0"
"hexo-server": "^0.2.0",
"lodash": "^4.17.4"
},
"devDependencies": {
"standard": "^10.0.3"
}
}
5 changes: 5 additions & 0 deletions source/_data/languages.yml
@@ -0,0 +1,5 @@
zh-hans:
name: 简体中文
disqus_lang: zh
en: English
# zh-tw:
6 changes: 5 additions & 1 deletion source/_posts/about.md
@@ -1,3 +1,7 @@
---
title: About YAH
---
permalink: test
tags:
-
-
---
9 changes: 9 additions & 0 deletions source/_posts/en/about.md
@@ -0,0 +1,9 @@
---
title: About YAH
permalink: test
tags:
- One
- Two
---

asdfasdfasdf
5 changes: 5 additions & 0 deletions source/about/index.md
@@ -0,0 +1,5 @@
---
title: 关于
---

123
5 changes: 5 additions & 0 deletions source/en/about/index.md
@@ -0,0 +1,5 @@
---
title: About
---

456
22 changes: 22 additions & 0 deletions themes/cactus-light/LICENSE
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2016 Pieter Robberechts
Copyright (c) 2017 Gabriela Thumé

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
157 changes: 157 additions & 0 deletions themes/cactus-light/README.md
@@ -0,0 +1,157 @@
# Cactus Light

A responsive, light and simple [Hexo](http://hexo.io) theme for a personal website. Based on the original [Cactus Dark](https://github.com/probberechts/cactus-dark) theme by [Pieter Robberechts](https://github.com/probberechts).

:cactus: [Demo](http://gabithu.me)

![cactus-light](https://cloud.githubusercontent.com/assets/2175271/19885143/62e9269c-a01d-11e6-8e26-e36a36201d88.png)

## Summary

- [General](#general)
- [Features](#features)
- [Install](#install)
- [Configuration](#configuration)
- [License](#license)

## General

- **Version** : 2.0
- **Compatibility** : Hexo 3 or later

## Features

- Fully responsive
- Disqus
- Googe analytics
- Font Awesome icons
- Pick your own code highlighting scheme
- Configurable navigation menu
- Projects list
- Simplicity

## Install
1. In the `root` directory:

```git
$ git clone https://github.com/gabithume/cactus-light.git themes/cactus-light
$ npm install hexo-pagination --save
```

2. Change the `theme` property in the `config.yml` file.

```yml
# theme: landscape
theme: cactus-light
```

3. Run: `hexo generate` and `hexo server`

## Configuration

### Navigation

Setup the navigation menu in the theme's `_config.yml`:

```
nav:
Home: /
About: /about/
Writing: /archives/
Projects: http://github.com/gabithume
LINK_NAME: URL
```

### Blog posts list on home page

You have two options for the list of blog posts on the home page:

- Show only the 5 most recent posts (default)

```
customize:
show_all_posts: false
post_count: 5
```

- Show all posts

```
customize:
show_all_posts: true
```

### Projects list

Create a projects file `source/_data/projects.json`.

```json
[
{
"name":"Hexo",
"url":"https://hexo.io/",
"desc":"A fast, simple & powerful blog framework"
},
{
"name":"Font Awesome",
"url":"http://fontawesome.io/",
"desc":"The iconic font and CSS toolkit"
}
]
```

### Social media links

Cactus Light can automatically add links to your social media accounts. Therefore, update the theme's `_config.yml`:

```
customize:
social_links:
github: your-github-url
twitter: your-twitter-url
NAME: your-NAME-url
```

where `NAME` is the name of a [Font Awesome icon](http://fontawesome.io/icons/#brand).

### RSS

Set the `rss` field in the theme's `_config.yml` to one of the following values:

1. `rss: false` will totally disable rss (default).
2. `rss: atom.xml` sets a specific feed link.
3. `rss:`leave empty to use the [hexo-generator-feed](https://github.com/hexojs/hexo-generator-feed) plugin.

### Analytics

Add you Google Analytics `tracking_id` to the theme's `_config.yml`.

```
plugins:
gooogle_analytics: 'UA-49627206-1' # Format: UA-xxxxxx-xx
```

### Comments

First, create a site on Disqus: [https://disqus.com/admin/create/](http://disqus.com/admin/create/).

Next, update the theme's `_config.yml` file:

```
plugins:
disqus_shortname: SITENAME
```

where `SITENAME` is the name you gave your site on Disqus.

### Code Highlighting

Pick one of [the available colorschemes](https://github.com/gabithume/cactus-light/tree/master/source/css/_highlight) and add it to the theme's `_config.yml`:

```
customize:
highlight: COLORSCHEME_NAME
```

## License
MIT
51 changes: 51 additions & 0 deletions themes/cactus-light/_config.yml
@@ -0,0 +1,51 @@
nav:
Home: /
Writing: /blog/
About: /about/

projects_url:

customize:
gravatar:
email:
logo:
enabled: true
width: 50
height: 50
url: /images/logo-circle.png
gravatar: false
favicon:
# eg. generate with http://realfavicongenerator.net/
desktop:
url: /images/favicon.ico
gravatar: false
android:
url: /images/favicon-192x192.png
gravator: false
apple:
url: /images/apple-touch-icon.png
gravator: false
social_links:
github: /
twitter: /
facebook: /
linkedin: /
show_all_posts: false
post_count: 5
highlight: monokai

# Rss
rss: ''

# Plugins
plugins:
disqus_shortname: # Disqus Comments Shortname
google_analytics: UA-76776888-2 # enter the tracking ID for your Google Analytics

# Miscellaneous
miscellaneous:
open_graph: # see http://ogp.me
fb_app_id:
fb_admins:
twitter_id:
google_plus:
13 changes: 13 additions & 0 deletions themes/cactus-light/languages/en.yml
@@ -0,0 +1,13 @@
Home: Home
About: About
Writing: Writing
Projects: Projects
Search: Search
Previous post: Previous post
Next post: Next post
Back to top: Back to top
Share post: Share post
TOC: TOC
Share: Share
Top: Top
Menu: Menu
13 changes: 13 additions & 0 deletions themes/cactus-light/languages/zh-hans.yml
@@ -0,0 +1,13 @@
Home: 首页
About: 关于
Writing: 写作
Projects: 项目
Search: 搜索
Previous post: 上一篇
Next post: 下一篇
Back to top: 回到顶部
Share post: 分享文章
TOC: 目录
Share: 分享
Top: 回到顶部
Menu: 菜单

0 comments on commit f132856

Please sign in to comment.