Hexo Tutorial

Hexo

Installation

Hexo
Hexo Docs
nvm-sh
Resolving EACCES permissions errors when installing packages globally
Downloading and installing Node.js and npm


Install npm manager

nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell.

1
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

Copy and paste the following code to your profile file

1
2
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Load .zshrc into system

1
source ~/.zshrc

To verify that nvm has been installed, do:

1
command -v nvm

Install npm

1
nvm install node

Update


Check hexo version

1
hexo version

Update hexo-cli

1
npm i hexo-cli -g

NexT

NexT 教程
精细操控文本或图片
数学公式

Hexo

Categories & Tags

Tags: 单纯给文章打标签, 没有顺序和层级.
Categories: 可以用来将文章分类, 拥有层级.

tags:

  • tag_1
  • tag_2

categories: 同级标签

  • [category_1]
  • [category_2]

categories: 父级标签

  • category_A
  • category_a

categories: 同级标签 & 父级标签

  • [category_A, category_a]
  • [category_B, category_b]

top_img: source/img/post/Markdown-Tutor-bg.jpg
toc_number: true # or false
layout: slides # 默认关
slide:
theme: night
separator: ===
separator_vertical: ==
top: true # 文章置顶

Hexo 资源文件夹

Music Player

Aplayer

Usage

1
{% aplayer title author url [picture_url, narrow, autoplay, width:xxx, lrc:xxx] %}

Option
title : music title
author: music author
url: music file url
picture_url: optional, music picture url
narrow: optional, narrow style
autoplay: optional, autoplay music, not supported by mobile browsers
width:xxx: optional, prefix width:, player’s width (default: 100%)
lrc:xxx: optional, prefix lrc:, LRC file url

Example

1
{% aplayer "穏ヤカナ眠リ" "岡部啓一" "/music/穏ヤカナ眠リ - 岡部啓一.m4a" "https://raw.githubusercontent.com/ZacksAmber/PicGo/master/img/20191017171342.png" "narrow" "autoplay" %}
1
{% aplayer "穏ヤカナ眠リ" "岡部啓一" "/music/穏ヤカナ眠リ - 岡部啓一.m4a" "https://raw.githubusercontent.com/ZacksAmber/PicGo/master/img/20191017171342.png" %}

PDF

Usage

1
2
3
4
5
pdf.js
{% pdf url [height] %}

[url] : Relative path to PDF file.
[height] : Optional. Height of the PDF display element, e.g. 800px.

Example

1
2
{% pdf https://example.com/sample.pdf %}
{% pdf /path/to/your/file.pdf 600px %}

隐藏文章

https://github.com/printempw/hexo-hide-posts