Hexo theme: NexT
install
1 | git clone https://github.com/next-theme/hexo-theme-next themes/next |
upgrade
1 | git pull origin master # (inside the next folder) |
configuration
In _config.yml under the root folder
- change theme to NexT: change
theme:themein _config.yml totheme: next
In _config.yml under next folder
Scheme Settings
- change NexT theme:
1 | # Schemes |
- darkmode:
darkmode: true
Site Information Settings
icon: put icon under source/custom_folder
1
2
3
4
5
6favicon:
small: /custom_folder/favicon-16x16.png
medium: /custom_folder/favicon-32x32.png
apple_touch_icon: /custom_folder/apple-touch-icon.png
# safari_pinned_tab: /images/logo.svg
# android_manifest: /manifest.json
one can use this site to generate icons
Menu Settings
1 | menu: |
Except for home and archives, all custom pages under the menu section need to be created manually
- Adding tags
hexo n page tags- add
type: tagsto front matter - edit custom-name/index.md to change content
- Adding categories: similar to tags
- Adding Google Canlendar: check here
- Adding 404 page:
hexo n page 404- set
relative_link: falsein root/_config.yml
- Adding others
hexo n pagecustom-name- edit front matter
- edit custom-name/index.md to change content (can also use index.html instead of index.md)
icons are from Font Awesome
You can display/hide icons and badges by setting the followings:
1 | menu_settings: |
Sidebar Settings
avatar:
avatar: url: /NexT_icon/avatar.pngsocial: name: link || icon
1
2
3social:
GitHub: https://github.com/yourname || fab fa-github
E-Mail: mailto:yourname@gmail.com || fa fa-envelope
footer
- since year: display year to the current year
- icon:
- name: link to Font Awesome
- animated
- color: in HEX code
- copyright: if none, will use the author's name
- powered: whether to show "Powered by Hexo & NexT"
post
preamble text
- write to break article manually
- enable
excerpt_description: trueand have adescriptionfield in front matter to display the excerpt - without the previous two, the whole post will be considered as a preamble and displayed
tag_icon: true: use tag icon instead of #donate
1
2
3
4
5
6
7reward_settings:
enable: true
reward:
wechatpay: /NexT_icon/wechatpay.jpg
alipay: /NexT_icon/alipay.jpg
paypal: /NexT_icon/paypal.pngfollow me (self-explanatory)
post_edit: enable editing source code (if one pushes source code to GitHub)post_navigation: left: older post is on the left
misc
preconnect: true: Initiating an early connectionmobile_layout_economy: true: reduce margin on device with narrow widthcodeblock.copy_button.enable: true: enable copy buttonback2top: enable: true: enable back to top button
font setting (self-explanatory)
search engine optimization (SEO)
- go to verification methods and choose HTML Tag
- get
<meta name="verification" content="XXXXXXXXXXXXXXXXXXXXXXX"> - copy
XXXXXXXXXXXXXXXXXXXXXXXto the verification field
Third-party services
Math Equations
Setting
every_page: false: will not render page unless the front matter hasmathjax: truemathjax: more powerful than thekatexoption but slowerenable: true: enable mathjaxtags: ams: automatic equaiton numbering if surround by\begin{xxx} ... \end{xxx}block
prerequisite
install pandoc
install hexo-renderer-pandoc:
1
2
3
4
5# inside the hexo blog folder
$ npm un hexo-renderer-marked
$ npm i hexo-renderer-pandoc
$ hexo clean
$ hexo g
Examples
Equation without ams: \[ x = {-b \pm \sqrt{b^2-4ac} \over 2a} \]
Equation with ams: \[\begin{equation} x = {-b \pm \sqrt{b^2-4ac} \over 2a} \end{equation}\]
Equaiton with tag \[ x = {-b \pm \sqrt{b^2-4ac} \over 2a} \tag{custom tag}\]
Equation with label (must have either ams or tag): \[\begin{equation} \label{eq1}
x = {-b \pm \sqrt{b^2-4ac} \over 2a}
\end{equation}\] and then use $\eqref{label_name}$
to reference the equation \(\eqref{eq1}\)
Multi-line equation with one ams: \[\begin{equation} \label{eq2} \begin{aligned} x &= +{-b \pm \sqrt{b^2-4ac} \over 2a} \\ &= -{-b \pm \sqrt{b^2-4ac} \over 2a} \end{aligned} \end{equation}\]
Multi-line equation with multiple ams: \[\begin{align} x &= +{-b \pm \sqrt{b^2-4ac} \over 2a} \\ &= -{-b \pm \sqrt{b^2-4ac} \over 2a} \end{align}\]
Multi-line equation with multiple ams and certain line without number: \[\begin{align} x &= +{-b \pm \sqrt{b^2-4ac} \over 2a} \nonumber \\ &= -{-b \pm \sqrt{b^2-4ac} \over 2a} \end{align}\]
Comment Systems
lazyload: true: don't load the comment system until needed- disable comments on certain posts: in the front matter, include
comments: false
Disqus (directly quoted from here)
Disqus is a global comment system that improves discussion on websites and connects conversations across the web.
Create an account and log into Disqus. Once logged in, click the
GET STARTEDbutton on the homepage, then selectI want to install Disqus on my siteoption and you will see theCreate a new siteinterface.Enter your
Website Name, which will serve as your Disqus shortname, and select a Category from the drop-down menu. Then clickCreate Sitebutton.Choose
I don't see my platform listed, install manually with Universal Code, configure Disqus for your site, and clickComplete Setupbutton.Set the value
enabletotrue, add the obtained Disqus shortname (shortname), and edit other configurations indisqussection in the NexT config file as following:1
2
3
4disqus:
enable: false
shortname: your-short-disqus-name
count: true
Analytics
make sure you config the
urlin the hexo _config.yml fileGoogle Analytics:
- create an account
- edit tracking_id field, fill with
MEASUREMENT ID - others are similar
Search Services
$ npm install hexo-generator-searchdbedit hexo _config.yml file and add the followings
1
2
3
4
5search:
path: search.xml
field: post
content: true
format: htmledit next _config.yml file
local_search.enable: true: enable local searchlocal_search.top_n_per_article: -1: show all results per article
Chat Services
Chatra
- Visit Chatra and create an account
- edit
chatra.enable: trueand fill in yourchatra.idin Chatra -> Settings -> Preferences -> Public key
External Libraries
- Pjax delivers a fast browsing experience
- Fancybox/Medium Zoom allows image zoom in, while Fancybox also supports videos
- lazyload will not load the image until needed. Run
hexo cleanonce change this setting - Quicklink enables preloading and speeds up subsequent page-loads
- motion allows animation, disable it to run faster. Check all effects here
Tag Plugins
NexT has its own tag plugins beside Hexo