Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ A responsive, clean and simple [Hexo](http://hexo.io) theme for a personal websi
- Projects list
- I18n support
- Disqus / Utterances
- Google analytics / Baidu Tongji / [Umami Analytics](https://umami.is)
- Google analytics / Baidu Tongji / [Umami Analytics](https://umami.is)
- Web-App manifests
- Font Awesome icons
- Simplicity

Expand Down Expand Up @@ -64,23 +65,23 @@ A responsive, clean and simple [Hexo](http://hexo.io) theme for a personal websi
# theme: landscape
theme: cactus
```

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:

```sh
$ hexo new page about
```

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`.

4. Run: `hexo generate` and `hexo server`
Expand Down Expand Up @@ -258,7 +259,7 @@ Set the `rss` field in the `_config.yml` to one of the following values:

### Analytics

Add you Google, Baidu, Cloudflare or Umami Analytics `tracking_id` to the `_config.yml`.
Add your Google, Baidu, Cloudflare or Umami Analytics `tracking_id` to the `_config.yml`.

```yml
google_analytics:
Expand All @@ -280,6 +281,40 @@ umami_analytics:
script_name: umami.js
```

### Web-App Manifests

Cactus supports [Web-App Manifests](https://developer.mozilla.org/en-US/docs/Web/Manifest). Add an entry like this to the `_config.yml`:

```yml
manifest:
url: /manifest.json
```

This will tell Cactus to insert a manifest link into generated HTML files.

```html
<link rel="manifest" href="/meta/manifest.json">
```

Example of a simple `manifest.json` file:

```json
{
"name": "MyApp",
"short_name": "MyApp",
"theme_color": "#323232",
"background_color":"#323232",
"display":"standalone",
"icons": [
{
"src": "/images/my-app-icon-128x128.png",
"sizes": "128x128",
"type":"image/png"
}
]
}
```

### CDN

Load Javascript and CSS resources from a CDN. Enabled by default, loads all resources from [cdnjs](https://cdnjs.com/).
Expand Down Expand Up @@ -362,7 +397,7 @@ date: 2017-12-24 23:29:53
tags:
- Foo
- Bar
categories:
categories:
- Baz
---

Expand All @@ -384,7 +419,7 @@ Similarly, you can create a page with an overview of all categories by running:
$ hexo new page categories
```

and adding `type: categories` to the front-matter of `source/categories/index.md`.
and adding `type: categories` to the front-matter of `source/categories/index.md`.

Finally, don't forget to create a link to these pages, for example in the navigation menu:

Expand Down
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nav:
# 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.
# 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:
-
Expand Down Expand Up @@ -131,6 +131,11 @@ favicon:
url: /images/apple-touch-icon.png
gravatar: false

# Inserts a <link> to a web-app manifest file.
#
# manifest:
# url: /manifest.json

# The color scheme that should be used to highlight codeblocks.
# See source/css/_highlight for a list of all available color schemes.
# highlight: rainbow
Expand Down
6 changes: 6 additions & 0 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
google_plus: theme.open_graph.google_plus,
}) %>
<%- meta(page) %>

<% if (theme.manifest) { %>
<% if (theme.manifest.url) { %>
<link rel="manifest" href="<%= url_for(theme.manifest.url) %>">
<% } %>
<% } %>
<% if (theme.favicon) { %>
<% if (theme.favicon.desktop) { %>
<% if (theme.gravatar && (theme.gravatar.email || theme.gravatar.hash) && theme.favicon.desktop.gravatar) { %>
Expand Down