Git Product home page Git Product logo

hexo-theme-cactus's Introduction

Cactus

A responsive, clean and simple Hexo theme for a personal website.

🌵 Demo

screenshot

Summary

General

  • Version : 3.0
  • Compatibility : Hexo 3 or later

Features

  • Fully responsive
  • Multiple color schemes
  • Pick your own code highlighting scheme
  • Configurable navigation menu
  • Support for local search
  • Projects list
  • I18n support
  • Disqus / Utterances
  • Google analytics / Baidu Tongji / Umami Analytics
  • Font Awesome icons
  • Simplicity

Prerequisites

  1. In order to use this theme you must have installed hexo.

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

    $ hexo init my-blog
  3. Navigate into the new directory:

    $ cd my-blog

Install

  1. In the root directory:

    $ git clone https://github.com/probberechts/hexo-theme-cactus.git themes/cactus
  2. Change the theme property in the _config.yml file.

    # 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:

    $ hexo new page about

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

    $ hexo new post "hello world"

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

  4. Run: hexo generate and hexo server

  5. Publish your blog!

Configuration

You can (and should) modify a couple of settings. An overview of all settings can be found in _config.yml. The most important ones are discussed below.

There are two possible methods to override the defaults. As a first option, you could fork the theme and maintain a custom branch with your settings. Alternatively, you can configure it from your site's primary configuration file. Therefore, define your custom settings under the theme_config variable. For example:

# _config.yml
theme_config:
  colorscheme: white
# 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, light, white and classic. Set your preferred color scheme in the _config.yml file.

colorscheme: light

Alternatively, you can easily create your own color scheme by creating a new file in source/css/_colors.

Navigation

Set up the navigation menu in the _config.yml:

nav:
  home: /
  about: /about/
  articles: /archives/
  projects: http://github.com/probberechts
  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)

    posts_overview:
      show_all_posts: false
      post_count: 5
  • Show all posts

    posts_overview:
      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.

[
    {
       "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 can automatically add links to your social media accounts. Therefore, update the theme's _config.yml:

social_links:
  -
    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, and LABEL is an optional value used as a title attribute on the link (NAME value is used if LABEL is missing).

Copyright years

By default, Cactus will use current year in your copyright year information. If there is a need to customize, please update _config.yml:

copyright:
  start_year: 2016
  end_year:

Language configuration

If you are new to Hexo and internationalization (i18n), please read Hexo documentation - internationalization (i18n) section

Currently, the theme is delivered with support for:

  • English (en), default
  • Arabic (ar)
  • Brazilian Portuguese (pt-BR)
  • Catalan (ca)
  • Chinese (Simplified, PRC) (zh-CN)
  • Dutch (nl)
  • French (fr)
  • German (de)
  • Italian (it)
  • Korean (kr)
  • Persian (fa)
  • Polish (pl)
  • Russian (ru)
  • Spanish (es)
  • Taiwanese (Taiwanese Mandarin) (zh-TW)
  • Turkish (tr)
  • Ukrainian (ua)
  • Vietnamese (vi)

If you would like to use one the languages listed above, simply set language to the desired language (e.g., fr) in _config.yml. Otherwise, you can follow the steps below (E.g., to add a Japanese (ja) translation):

  1. Set language to ja in Hexo configuration file _config.yml
  2. Create a ja.yml file in the themes/cactus/languages/ folder
  3. Copy the content of themes/cactus/languages/default.yml and paste it it into the ja.yml file
  4. Replace all English strings by their Japanese translation

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, which is a Persian font.

direction: rtl

RSS

Set the rss field in the _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 plugin.

Analytics

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

google_analytics:
  enabled: true
  id: 'UA-49627206-1'

baidu_analytics:
  enabled: true
  id: 2e6da3c375c8a87f5b664cea6d4cb29c

cloudflare_analytics:
  enabled: true
  id: 0dabb6e21848405483a237e6a7b6ed04

umami_analytics:
  enabled: false
  id: e77e68be-f6e4-4br3-9365-2b76b57cd571
  host: https://analytics.domain.com
  script_name: umami.js

CDN

Load Javascript and CSS resources from a CDN. Enabled by default, loads all resources from cdnjs.

cdn:
  enable: true
  jquery: 'url'
  clipboard: 'url'
  font_awesome: 'url'
  justified_gallery_css: 'url'
  justified_gallery_js: 'url'

Set enable: false to completely disable CDN and load all resources from your domain. If you want to disable it only for specific resource(s) then just remove the corresponding entry(s).

cdn:
  enable: true
  jquery: 'url'

Only JQuery will be loaded from the specified CDN.

Comments

Cactus supports two commenting systems: Disqus and Utterances.

Disqus

First, create a site on Disqus: https://disqus.com/admin/create/.

Next, update the _config.yml file:

disqus:
  enabled: true
  shortname: SITENAME

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

Utterances

First, follow the instructions on the oficial website to setup an issue tracker Utterances will connect to.

Next, update the _config.yml file:

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

Pick one of the available colorschemes and add it to the _config.yml:

highlight: COLORSCHEME_NAME

Tags and categories

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

title: Tags and Categories
date: 2017-12-24 23:29:53
tags:
- Foo
- Bar
categories: 
- Baz
---

This post contains 2 tags and 1 category.

You can create a page with a tag cloud by running:

$ hexo new page tags

Next, add type: tags to the front-matter of source/tags/index.md. You can also add a tag cloud to the home page by setting the tags_overview option to true.

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.

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

nav:
  tag: /tags/
  category: /categories/

Local search

First, install the hexo-generate-search plugin, which will generate a search index file.

$ npm install hexo-generator-search --save

Next, create a page to display the search engine:

$ hexo new page search

and put type: search in the front-matter.

title: Search
type: search
---

Finally, edit the _config.yml and add a link to the navigation menu.

nav:
  search: /search/

License

MIT

hexo-theme-cactus's People

Contributors

7696122 avatar alexmufatti avatar arkark avatar azonti avatar bumb7ebee avatar coolzjy avatar crowandcat avatar csy54 avatar deckon avatar destornillador avatar dharfr avatar diegofcornejo avatar duboiss avatar fbaierl avatar foxb612 avatar hamzakat avatar maaaaarco avatar mehrad77 avatar metters-senacor avatar monkeywzr avatar mstuttgart avatar nella17 avatar probberechts avatar qianbinbin avatar sacgov avatar shanehh avatar shejialuo avatar veraposeidon avatar windfallw avatar yusanshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexo-theme-cactus's Issues

about search

Document description: put "search: true" in the front-matter. However, I don't understand which file "search: true" .

Not all post show up in archive?

So, I was trying out cactus-dark but there seem to be a strange problem that not all post show up in archive page, although if I use the url from generate log I can access the pages. How can I fix this?

A question about layout

Hello,I found that the value of "Writing" of the nav in the _config.yml is "archives",but when I click it, the page will jump to archive.ejs.(why not archives.ejs ). I don't know how it works.
nav:
Home: /
About: /about/
Writing: /archives/

Projects: http://github.com/probberechts

Forthermore, after creating a about.ejs in the "\themes\cactus-dark\layout", the blog's page will prompt that the file does not exis instead of jumping to the page of about.ejs when clicking "About" .

I hope to receive your reply soon, thank you very much~!~

Social media links often blocked by adblocker

Using even the non-aggressive settings in uBlock Origin, a lot of the social media links get display: none;.

The two main triggers I'm seeing are having the ID of "sociallinks" and the title attributes on the links (at least for Twitter).

I was able to resolve this locally by removing the title attribute and changing the ID to something like "socialinfo". I can open a PR for this later.

About Image Title

It seems that image title can not be shown in the page
I used both way

![](test.jpg "test title") 
{% asset_img "test.jpg" "test title" %}

and all it can just show the image itself, and nothing about the title.
Is there a way to show title?

Anyway, thank you for the theme. I like it very much.

TypeError on layout.ejs

Every time I run "hexo server" with this theme installed and I try to render the page, I get this error:

Unhandled rejection TypeError: /home/gigavinyl/Projects/blog/themes/cactus-dark/layout/layout.ejs:3
    1| <!DOCTYPE html>
    2| <html<%= config.language ? " lang=" + config.language.substring(0, 2) : ""%>>
 >> 3| <%- partial('_partial/head') %>
    4| <body>
    5|     <% if (is_post()) { %>
    6|       <%- partial('_partial/header_post') %>

/home/gigavinyl/Projects/blog/themes/cactus-dark/layout/_partial/head.ejs:38
    36|     <% } %>
    37|     <% if (theme.rss) { %>
 >> 38|       <link rel="alternate" href="<%= url_for(theme.rss) %>" title="<%= config.title %>" type="application/atom+xml" />
    39|     <% } %>
    40|     <!-- jquery -->
    41|     <%- js('lib/jquery/jquery.min') %>

path.substring is not a function
    at Object.urlForHelper (/home/gigavinyl/Projects/blog/node_modules/hexo/lib/plugins/helper/url_for.js:9:31)
    at Object.wrapper [as url_for] (/home/gigavinyl/Projects/blog/node_modules/lodash/lodash.js:4994:19)
    at eval (eval at exports.compile (/home/gigavinyl/Projects/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:36:1735)
    at eval (eval at exports.compile (/home/gigavinyl/Projects/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:36:1991)
    at /home/gigavinyl/Projects/blog/node_modules/ejs/lib/ejs.js:255:15
    at Theme._View.View._compiledSync (/home/gigavinyl/Projects/blog/node_modules/hexo/lib/theme/view.js:122:20)
    at Theme._View.View.View.renderSync (/home/gigavinyl/Projects/blog/node_modules/hexo/lib/theme/view.js:50:21)
    at Object.partial (/home/gigavinyl/Projects/blog/node_modules/hexo/lib/plugins/helper/partial.js:42:17)
    at Object.wrapper [as partial] (/home/gigavinyl/Projects/blog/node_modules/lodash/lodash.js:4994:19)
    at eval (eval at exports.compile (/home/gigavinyl/Projects/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:160)
    at eval (eval at exports.compile (/home/gigavinyl/Projects/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:796)
    at /home/gigavinyl/Projects/blog/node_modules/ejs/lib/ejs.js:255:15
    at Theme._View.View._compiled (/home/gigavinyl/Projects/blog/node_modules/hexo/lib/theme/view.js:127:30)
    at Theme._View.View.View.render (/home/gigavinyl/Projects/blog/node_modules/hexo/lib/theme/view.js:29:15)
    at /home/gigavinyl/Projects/blog/node_modules/hexo/lib/theme/view.js:40:23
    at tryCatcher (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/home/gigavinyl/Projects/blog/node_modules/bluebird/js/release/async.js:148:10)

A Question about 'Fenced Code Blocks'

My markdown:

` ` `
hello
world
` ` `
` ` `
It would be generate code blcoks with sequence:
1 hello
2 world   
Maybe the sequence is line number, but I don't need it.
What can I do?
Thanks.

Share setting

How to set article share info? eg. Setting url when share with FB.

Pagination for long posts

Hi. Great theme!

I have some very long posts which I would like to be paginated in a similar way to the way you recently added pagination to the archives page.

I have tried using the "******" and "‐‐‐‐‐‐" markdown syntax which is sometimes used for page breaks, but this only produces a horizontal rule.

Please can you advise whether this is possible with the theme - if not, would you consider adding it.

Thanks

'on scroll' script firing at the wrong place

hi there I'm testing Cactus and found that the on scroll listener here assume a "post" layout (having a nested #menu > #nav). that is not the case for the home nor for pages.

behaviour is testable on your own demo, open the dev tool, reduce browser height and trigger a scroll to see the errors in console.

I made a fork with a simple fix, but i think making this post menu available in pages would be even better, isn't it?

Can I show more than 5 articles on my homepage?

thank for your effort first.

I'm not well in English,please forgive.

my blog have more than 5 articles,but the homepage can only show latest five posts.

can show more articles?

or can set Pagination to show more articles?

thanks a lot.

Page Layout slightly off-centre

Hi,
I have setup the about page, and i have discovered that the layout has shifted slightly to the right on these pages. But it is perfect on the main page.
Im unsure how this has happened or what i can do to correct it.

the only change i made was to rename it from Writings to archives
screenshot from 2016-11-17 16-31-30

thank you

Another Page like Writting

Hi,

Firstly thanks for your theme, I want to create a page like the page Writting, where it appears automatically article, but with only special tag or categories, not all articles, can you help me please ?

how to navigate the next article when use cellphone?

in web browser, there is a menu button, and trigger navigation buttons(<, >, ^, share) show or hidden, but when visit in mobile browser, the these buttons has gone away, and there's no way to go to the next/prev article.

besides, I can show only 10 (configured in _config.yaml) articles in every archive page (including home page), and can't find a way to show them all or enable the pagination

No way to display previous posts

There seems to be no way to view previous posts from the homepage. Only the latest 5 posts show up. Is there any way to view past posts as well?

what are difference between "page.post.sort()" and "site.post.sort()"?

I found that why the archive page can't view all my post pages just because the difference between the flowing codes。

<% site.posts.sort('date', 'desc').limit(theme.customize.post_count || 5).each(function(post, i){ %>

and

<% page.posts.sort('date', 'desc').each(function(post) { %>

you can see "page" and "site" at the beginning.

share menu has some problems

Hi.
I found cactus-dark doesn't work very well on Firefox 53.0.3:

  • On mobile view, the share menu doesn't shown after click.
  • On desktop view, some share item lost its icon.

Thanks for all and waiting your reply :-D.

Theme incompatible with autonofollow Hexo plugin

Hi

When using the autonofollow plugin from the Hexo plugin homepage, this theme becomes broken. Is there any way you can reformat your HTML output to not get broken by this plugin?

Compare the following HTML produced by hexo with the plugin disabled and then enabled:

With autonofollow disabled:

<li>
  <a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');">
    <i class="fa fa-chevron-up" aria-hidden="true" onmouseover='$("#i-top").toggle();' onmouseout='$("#i-top").toggle();'></i>
  </a>
</li>

In the above example, the web page/theme works properly.

With autofollow enabled:

<li>
  <a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');">
    <i class="fa fa-chevron-up" aria-hidden="true" onmouseover="$(" #i-top").toggle();"="" onmouseout="$("></i>
  </a>
</li>

In the above example, autofollow has been enabled in the hexo configuration, and now the web page/theme is broken. Single quotes have been changed to double quotes, and the contents of the onmouseout attribute has been mangled.

This bug is repeatable by installing hexo, activating the cactus-dark theme, and toggling the autonofollow plugin on/off.

How to enable toc?

I don't konw why i don't have a toc until I use the hexo-toc.
But as I saw in issues, others's cactus-dark theme has toc naturally.
So I want to ask for some help.
There's my version infomation.

hexo: 3.2.2
hexo-cli: 1.0.4
os: Linux 4.4.0-101-generic linux x64
http_parser: 2.5.0
node: 4.2.6
v8: 4.5.103.35
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 55.1
modules: 46
openssl: 1.0.2g-fips

New page doesn't create index.html

Using the command example:
hexo new page 'notes'

Creates a directory under source 'notes' containing index.md. After editing the markdown and generating the 'notes' directory is created under public, but instead of the expected index.html the index.md file is on the generated site.

Disable greyed out logo?

Hello. Thanks for the wonderful theme! I was just wondering if there is an option to allow the logo to always be coloured instead of greyed out until you hover over it.

Thanks!

TOC disappear if there's heading level 1 in the page content

In source\css\_partial\post\actions_desktop.styl, there's a rule setting #header-post #toc .toc-level-1 to display: none.
This means that not only are first-level-headings invisible in TOC, but also their descendants in the nested list are gone.

If first-level-headings are hidden in purpose, maybe just hide .toc-level-1 > .toc-link could be considered.

This issue also applies to #footer-post #toc-footer .toc-level-1, which is set to display: none in actions_mobile.styl.

<% if (config.description) { %>

In the index.ejs file this statement is on line 2

I would like to know what file i need to add where to get the description text to render in this location on the index page like in your demo.

I presume its done in a similar way to how the projects bit is done.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.