Set up submodule
add the theme as a submodule
git submodule add https://github.com/volantis-x/hexo-theme-volantis.git themes/volantis |
Multiplayer collaboration
The default author information is set in the theme configuration file:
# Article layout |
Volantis supports multiple authors, other author information needs to be written in the data file, for example:
Jon: |
Just add ʻauthor` to the front-matter of the article:
--- |
Speed up the website
Loading speed
Reduce unnecessary js plugins, such as word count, dynamic background.
Find and solve the slow down resources, take Chrome browser as an example:
- Right-click on the page and select "Check".
- In the right window, "Network" tab, and check "Disable cache".
- Refresh the web page to view resources that load slowly.
3.1. For slow loading pictures, CDN is recommended.
3.2. It is recommended to discard the js plugins that load slowly and do not need to.
3.3. The js plug-in that is slow to load but must be used is recommended to download and upload to jsdelivr.
Running speed
- When visiting a website with dynamic special effects backgrounds (such as snowflakes, particles, etc.), the phone will soon become hot and get stuck, the notebook will soon fan out and the browser prompts to close this page. If you want the website to have a good experience, please try not to install such plug-ins.
Optimize SEO
seo: |
In front-matter, you can set keywords
, description
, robots
and seo_title
. Among them, seo_title
is only used as the title of the webpage and has a higher priority than title
.
Do not use H1 headings inside articles.
Check and delete the inaccessible links through the dead link detection tool.
Install SEO optimization plugin:
Don't pile up keywords on the page and don't change the path frequently.
Use CDN
For most users who deploy blogs to GitHub, it is relatively slow to load local resources directly. You can use the CDN service provided by jsdelivr for open source projects.
For the 4.1.4+
version, the JS file uses the CDN compressed version of https://unpkg.com/hexo-theme-volantis/source/js/ by default.
For example: https://unpkg.com/hexo-theme-volantis@4.1.4/source/js/app.min.js
How to open
use_cdn: true |
important:
- Developers note that ʻuse_cdn
is set to
false`. - Pay attention to the version number of the CDN file:
blog/_config.volantis.yml info:
theme_version: '4.1.4' # This is theme's version. - Only JS files provide CDN by default.
- About CSS file CDN:
blog/_config.volantis.yml info:
theme_name: Volantis # This is theme's name.
theme_version: '4.1.4' # This is theme's version.
theme_docs: https://volantis.js.org/ # This is theme's URL.
theme_repo: https://github.com/volantis-x/hexo-theme-volantis
cdn:
js: # The default is https://unpkg.com/hexo-theme-volantis@4.1.4/source/js/app.min.js
css:
first: # CDN is not provided by default. First.css is the style rendered for the first screen, and contains the style of cover navbar search.
style: # CDN is not provided by default, and style.css is a delayed loading style.
if you need to DIY the style
Custom CDN
If you upload the corresponding file to your CDN server, you can change the corresponding link to your own CDN link.
Try Terser to compress ES6
Install compression tool
npm install -g gulp |
gulp configuration file
var gulp = require('gulp'); |
Run compression
gulp |
Install Service Worker Service
# Global import |
Create the sw.js
file in blog/source
.
The content is as follows:
importScripts('https://unpkg.com/workbox-cdn@5.1.3/workbox/workbox-sw.js'); |
after modifying the static file
Install the "Related Articles" plugin
Install the plugin
npm i -S hexo-related-popular-posts
Custom configuration method of plug-in:
If you use a header image, you can add the following settings in the site configuration file to make related articles display the correct article header image:
popularPosts: |
note
You need to upgrade to 5.0.1 and above to support custom header images, see #29
Analysis and Statistics
By default, the visit statistics of Bu Suanzi are supported. You can add Baidu statistics and Google Analytics by yourself.
Word count and reading time
- Install the following plugins:
npm i --save hexo-wordcount
- Modify the configuration file and open the
wordcount
pluginblog/_config.volantis.yml plugins:
...
# The word count of the article, the reading time, and the plug-in needs to be installed: npm i --save hexo-wordcount
wordcount:
enable: #true - Then modify the configuration file to write
wordcount
into the meta location that needs to be displayed:blog/_config.volantis.yml # Article layout
article:
...
# The layout scheme of the article card body on the article details page
body:
# Top of article information
# Take from meta_library
top_meta: [..., wordcount, ...]
...
# Information at the bottom of the article
# Take from meta_library
bottom_meta: [..., wordcount, ...]
CNZZ Statistics
Please refer to this tutorial by ZYMIN:
More advanced gameplay
For details, please refer to this blog of @TRHX:
Hexo blog topic personalization
https://www.itrhx.com/2018/08/27/A04-Hexo-blog-topic-personalization/
Contains a variety of detailed tutorials such as translucent cards, adding cartoon characters, custom mouse styles, mouse special effects, firework special effects, color scrolling fonts, website running time, dynamic browser titles, and snowflakes falling special effects.