Minimalistic Hexo theme helix
.
Very basic in design. A good starter template to build your own theme.
Demo: lisakov.com/en/.
- Warning
- Features
- Install and setup
- Site _config.yml
- Tag plugins
- Front-matter options
- Site structure
- layout overview
I use this repo for my personal site and change it according to my needs. Backup when updating from repo.
This theme isn't suitable for beginners. You should be able to at least
edit javascript code in theme/layout/*.ejs
files.
No setup is available in
theme/_config.yml
. Instead, edit theme/layout/*.ejs
files. It is a less
convenient, but more flexible workflow.
The theme isn't published to Hexo themes as it doesn't follow theme unit test guidelines.
- Two languages (Russian — main; English — secondary)
.less
style file- Responsive
If haven't already, install Hexo
, node.js
and git
; then
initialize Hexo:
hexo init <folder>
cd <folder>
npm install
Clone this theme to site/themes/helix/
:
cd themes/
git clone https://github.com/pozitron57/helix.git
Style file is in the .less
format. To have Hexo
convert it to .css
you need to install hexo-renderer-less
(from Hexo root directory).
npm install hexo-renderer-less --save
translated: true
comments: false
---
...Your text in main language...
translated: true
comments: false
---
...Your text in secondary language...
translated: true
comments: false
layout: page
---
...Your text about the site in main language...
translated: true
comments: false
layout: page
---
...Your text about the site in secondary language...
layout: blog
title: Журнал
lang: ru
translated: true
---
<don't write anything here, this page is generated by
themes/helix/layouts/blog.ejs>
layout: blog
title: Журнал
lang: ru
translated: true
---
<don't write anything here, this page is generated by
themes/helix/layouts/blog.ejs>
To have the custom home page generated from source/index.md
:
npm uninstall hexo-generator-index
Don't generate /archives/
, /categories/
, /tags/
pages as they are not
used in the theme.
npm uninstall hexo-generator-archive
npm uninstall hexo-generator-category
npm uninstall hexo-generator-tag
Install hexo-toc
(then you can place <!--toc-->
in your *.md files to
generate table of contents).
npm uninstall -g markdown-toc
npm install hexo-toc --save
Replace standard markdown renderer.
npm uninstall -g hexo-renderer-marked --save
npm install hexo-renderer-markdown-it --save
For server-side rendering of LaTeX syntax with MathJax
npm install hexo-filter-mathjax --save
theme: helix
title: Site title
author: Site author
language:
- ru
- en
# URL
url: https://site.com
root: /
permalink: :title/
permalink_defaults:
lang: ru
# Directories
i18n_dir: :lang
skip_render:
# Writing
new_post_name: :lang/:year-:month-:day-:title.md
default_layout: post
titlecase: false # Transform Title Into Titlecase
external_link:
enable: true # Open external links in new tab
field: site # Apply to the whole site
exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
# Code syntax highlighting
highlight:
enable: true
auto_detect: false
line_number: true
line_threshold: 0
tab_replace: ''
wrap: true
hljs: false
# Category & Tag
default_category: uncategorized
# http://momentjs.com/docs/#/displaying/format/
date_format: DD MMMM YYYY
time_format: HH:mm
# Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki
markdown:
render:
html: true
xhtmlOut: false
breaks: false
linkify: true
typographer: true
quotes: '«»‘’'
plugins:
- markdown-it-footnote
- markdown-it-sup
- markdown-it-sub
- markdown-it-abbr
anchors:
level: 1
collisionSuffix: ''
permalink: true
permalinkClass: header-anchor
permalinkSymbol: ''
# hexo-toc
toc:
maxdepth: 6
class: toc
slugify: transliteration
decodeEntities: false
anchor:
position: after
symbol: ' #'
style: header-anchor
# hexo-filter-mathjax
mathjax:
tags: ams # or 'ams' or 'all'
single_dollars: true # enable single dollar signs as in-line math delimiters
cjk_width: 0.9 # relative CJK char width
normal_width: 0.6 # relative normal (monospace) width
append_css: true # add CSS to pages rendered by MathJax
every_page: false # if true, every page will be rendered by MathJax regardless the `mathjax` setting in Front-matter
packages: # extra packages to load
extension_options:
{
inlineMath: [ ['$','$'], ['\(','\)'] ],
ams
}
# Deployment
deploy:
type: rsync
host:
user:
root:
port: 22
delete: true
args: '--exclude-from=exclude-list'
verbose: true
ignore_errors: false
In helix/scripts
there are files:
jg.js
,
comment.js
,
prompt.js
,
gif.js
for tag plugins with corresponding names, e.g.
{% jg img_path=https://site.com/images/ %}
image1.jpg
image2.jpg 'Second title'
{% endjg %}
More information on usage syntax and options with examples see in the
helix/scripts/*.js
files and in the
post.
justifiedgallery: <options>
left, center, right, justify, nojustify
If any option is given for justifiedgallery
, layout/_partial/head.ejs
loads css and js files for justifiedgallery.
layout/_partial/after_footer.ejs
initialize script as follows
<% if (page.justifiedgallery) { %>
<script>
$('.jg').justifiedGallery({
rowHeight : 130,
lastRow : '<%=page.justifiedgallery %>',
margins : 2
});
</script>
magnificpopup: <bool>
Loads css and js in <head></head>
. Also loads jquery, don't use
jquery: true
if you are already using magnificpopup: true
.
layout/_partial/after_footer.ejs
initialize magnificpopup script as
follows (see file for details).
jquery: <bool>
Loads jquery.js
in <head></head>
.
gif: <bool>
Loads gifonclick.js layout/_partisl/after_footer.ejs
. Needs jquery to
work.
mathjax: <bool>
Tells hexo-filter-mathjax
that it should render this page with mathjax.
hexo-filter-mathjax
should be installed.
Current root is site.com/
(second language root is site.com/en/
).
Archives are at site.com/blog/
(site.com/en/blog/
).
Edit scaffolds/post.md
for automatic permalink creation via hexo new post
in
the front-matter:
---
title: {{ title }}
date: {{ date }}
permalink: blog/{{ title }}/
tags:
categories:
---
No tags
or categories
pages are generated.
-
blog.ejs
generatessite.com/blog/
page. You need to createsite/source/blog/index.md
withlayout: blog
and no content. -
post.ejs
generates posts atsite.com/blog/<postname>/
or any page withlayout: post
. -
page.ejs
generates any page withlayout: page
. -
astrozone.ejs
is for /projects/astrozone/ page. You'll probably want to remove it. -
nfk.ejs
is for /projects/nfk/ page. You'll probably want to remove it. -
vpr.ejs
is for /projects/vpr/ page. You'll probably want to remove it. -
vpr-table.ejs
is for /projects/vpr/chords/ page. You'll probably want to remove it.
head.ejs
generates<head></head>
tag based on front-matter and site_config.yml
options.footer.ejs
adds simple footer (author, date).after_footer.ejs
adds scripts based on page front-matter options.comments.ejs
adds scripts needed forisso
comments. You may want to change it to your comment system or remove.navbar.ejs
generates horizontal menu (Home, Blog, About, etc.)trans.ejs
is used innavbar.ejs
to add second-language button only for translated pages (set front-matter optiontranslated: true
).