Skip to content

Commit

Permalink
更新cactus主题版本
Browse files Browse the repository at this point in the history
  • Loading branch information
tzzs committed Feb 27, 2024
1 parent 6384a82 commit f8563c6
Show file tree
Hide file tree
Showing 101 changed files with 490 additions and 9,207 deletions.
36 changes: 30 additions & 6 deletions _config.cactus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ nav:
articles: /archives/
tag: /tags/
projects: http://github.com/tzzs
Theme: https://imtzz.com/
Theme: https://tzzs.github.io
about: /about/
search: /search/


# Links to your social media accounts.
# The keys should correspond to Fontawesome icon names
# The 'icon' keys should correspond to Fontawesome icon names
# (see https://fontawesome.com/icons?d=gallery&s=brands);
# only 'mail' is an exception.
# You can optionally add a 'label' key to set the title attribute on the link.
# 'icon' value will be used as title when 'label' is missing.
social_links:
github: http://github.com/tzzs
mail: mailto:[email protected]
-
icon: github
link: http://github.com/tzzs
-
icon: mail
link: mailto:[email protected]

# Customize the overview with displaying a tagcloud on the index page.
# Options: https://hexo.io/docs/helpers.html#tagcloud
Expand Down Expand Up @@ -65,6 +71,15 @@ copyright:
start_year: 2018
end_year:

# Customize the 404 page
# Options:
# - enabled: whether to enable the 404 page (404.html).
error_404:
enabled: true
title: "404 Page Not Found"
description: "The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."


##############################################################################
# Look and Feel
##############################################################################
Expand Down Expand Up @@ -140,12 +155,20 @@ open_graph:
# Enable MathJax support for Latex
mathjax:
enabled: false

# Fill in your Disqus Comments Shortname to enable Disqus comments.
disqus:
enabled: false
shortname: cactus-1

# Fill in your Utterances data to enable Utterances comments
utterances:
enabled: false
repo: owner/githubrepo
issue_term: pathname
label: Comment
theme: github-dark

# Fill in your Google Analytics tracking ID to enable Google Analytics.
google_analytics:
enabled: false
Expand All @@ -166,6 +189,7 @@ umami_analytics:
enabled: false
id: e77e68be-f6e4-4br3-9365-2b76b57cd571
host: https://analytics.domain.com
script_name: umami.js

# Fill in you Gravatar email or hash if you want to use your gravatar as the
# logo and/or favicons of you website.
Expand All @@ -182,6 +206,6 @@ cdn:
enable: true
jquery: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
clipboard: https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.7/clipboard.min.js
font_awesome: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css
font_awesome: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css
justified_gallery_css: https://cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.8.1/css/justifiedGallery.min.css
justified_gallery_js: https://cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js
1 change: 1 addition & 0 deletions themes/cactus/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
yarn.lock
package-lock.json
node_modules/
.vscode
102 changes: 77 additions & 25 deletions themes/cactus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ A responsive, clean and simple [Hexo](http://hexo.io) theme for a personal websi

![screenshot](https://user-images.githubusercontent.com/2175271/137625287-24a4ac77-fbc9-4c99-a4cd-90455d93d13c.png)


## Summary

- [General](#general)
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Configuration](#configuration)
- [License](#license)
Expand All @@ -29,44 +29,66 @@ A responsive, clean and simple [Hexo](http://hexo.io) theme for a personal websi
- Support for local search
- Projects list
- I18n support
- Disqus integration
- Disqus / Utterances
- Google analytics / Baidu Tongji / [Umami Analytics](https://umami.is)
- Font Awesome icons
- Simplicity

## Prerequisites

1. In order to use this theme you must have installed [hexo](https://hexo.io/docs/).

2. Create the `root` directory for the blog by initializing it with hexo:

```sh
$ hexo init my-blog
```

3. Navigate into the new directory:

```sh
$ cd my-blog
```

## Install

1. In the `root` directory:

```git
```sh
$ git clone https://github.com/probberechts/hexo-theme-cactus.git themes/cactus
```

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

```yml
# theme: landscape
theme: cactus
```
See below for more information on how to customize this theme.

See below for more information on how to customize this theme.

3. Create pages and articles with the `hexo new [layout] <title>` command.
For example, to create an "about me" page, run:
For example, to create an "about me" page, run:

```sh
$ hexo new page about
```
This will create a new file in `source/about/index.md`
Similary, you can create a new article with

This will create a new file in `source/about/index.md`
Similarly, you can create a new article with

```sh
$ hexo new post "hello world"
```
and add some interesting content in `source/_posts/hello-world.md`.


and add some interesting content in `source/_posts/hello-world.md`.

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

5. [Publish your blog](https://hexo.io/docs/one-command-deployment.html)!


## Configuration

You can (and should) modify a couple of settings. An overview of all settings
can be found in [_config.yml](_config.yml). The most important ones are
discussed below.
Expand All @@ -83,15 +105,13 @@ theme_config:
colorscheme: white
```

```yml
# themes/cactus/_config.yml
colorscheme: dark
```
This will override the default black colorscheme in `themes/cactus/_config.yml`.

### Color scheme
Currently, this theme is delivered with four color schemes: [dark](https://probberechts.github.io/hexo-theme-cactus/cactus-dark/public/), [light](https://probberechts.github.io/hexo-theme-cactus/cactus-light/public/),
Expand All @@ -104,10 +124,9 @@ colorscheme: light
Alternatively, you can easily create your own color scheme by creating a new
file in `source/css/_colors`.

### Navigation
Setup the navigation menu in the `_config.yml`:
Set up the navigation menu in the `_config.yml`:
```yml
nav:
Expand All @@ -118,7 +137,6 @@ nav:
LINK_NAME: URL
```

### Blog posts list on home page
You have two options for the list of blog posts on the home page:
Expand All @@ -138,7 +156,6 @@ You have two options for the list of blog posts on the home page:
show_all_posts: true
```

### Projects list
Create a projects file `source/_data/projects.json` to show a list of your projects on the index page.
Expand All @@ -158,20 +175,27 @@ Create a projects file `source/_data/projects.json` to show a list of your proje
]
```

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

```yml
social_links:
github: your-github-url
twitter: your-twitter-url
NAME: your-NAME-url
-
icon: github
link: your-github-url
-
icon: twitter
label: "@your-twitter-handle"
link: your-twitter-url
-
icon: NAME
label: LABEL
link: your-NAME-url
```

where `NAME` is the name of a [Font Awesome icon](https://fontawesome.com/icons?d=gallery&s=brands).
where `NAME` is the name of a [Font Awesome icon](https://fontawesome.com/icons?d=gallery&s=brands), and LABEL is an optional value used as a title attribute on the link (NAME value is used if LABEL is missing).

### Copyright years

Expand Down Expand Up @@ -215,6 +239,7 @@ Otherwise, you can follow the steps below (E.g., to add a Japanese (ja) translat
**Note: Cactus does not support multi-language sites.**

### RTL support

This theme support RTL languages for Persian and Arabic language.
If you would like to use RTL layout, change `direction` attribute in `_config.yml` to `rtl`.
Note that this also will change the font to [Vazir](https://github.com/rastikerdar/vazir-font), which is a Persian font.
Expand All @@ -231,7 +256,6 @@ Set the `rss` field in the `_config.yml` to one of the following values:
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, Baidu, Cloudflare or Umami Analytics `tracking_id` to the `_config.yml`.
Expand All @@ -253,6 +277,7 @@ umami_analytics:
enabled: false
id: e77e68be-f6e4-4br3-9365-2b76b57cd571
host: https://analytics.domain.com
script_name: umami.js
```

### CDN
Expand Down Expand Up @@ -281,6 +306,10 @@ Only JQuery will be loaded from the specified CDN.

### Comments

Cactus supports two commenting systems: [Disqus](https://disqus.com) and [Utterances](https://utteranc.es).

#### Disqus

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

Next, update the `_config.yml` file:
Expand All @@ -293,6 +322,27 @@ disqus:

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

#### Utterances

First, follow the instructions on the [oficial website](https://utteranc.es/) to setup an issue tracker Utterances will connect to.

Next, update the `_config.yml` file:

```yml
utterances:
enabled: true
repo: owner/githubrepo
issue_term: pathname
label: utteranc
theme: themename
```

where each of the parameters are the respective values ​​provided during the configuration of the Utterances:

* `repo`: the repository Utterances will connect to.
* `issue_term`: the mapping between blog posts and GitHub issues.
* `label`: the label that will be assigned to issues created by Utterances
* `theme`: the selected Utterances theme.

### Code Highlighting

Expand All @@ -303,6 +353,7 @@ highlight: COLORSCHEME_NAME
```

### Tags and categories

Tags and categories can be included in the front-matter of your posts. For example:

```markdown
Expand Down Expand Up @@ -343,7 +394,6 @@ nav:
category: /categories/
```

### Local search
First, install the [hexo-generate-search](https://www.npmjs.com/package/hexo-generator-search)
Expand All @@ -358,6 +408,7 @@ Next, create a page to display the search engine:
```sh
$ hexo new page search
```
and put `type: search` in the front-matter.
```markdown
Expand All @@ -374,4 +425,5 @@ nav:
```
## License
MIT
Loading

0 comments on commit f8563c6

Please sign in to comment.