Blog Writing Notes
This is some notes during my blog-writing procedure. I will keep some interesting tricks, plugins, or tools inside this notes.
Post Templates
Bulma
Tag Plugins
Tag plugins should not be wrapped inside Markdown syntax, e.g. is not supported.
Some Usage of Basic Tags
Refer to Other Posts
Use the {% post_link filename [title] [escape] %}
tag to refer to other posts as the document describes.
Basic usage:
{% post_link blog-writing-notes 'Link with escape' %}
, which looks like Link <b>with</b> escape.{% post_link blog-writing-notes 'Link Without escape' false %}
, which looks like Link Without escape.{% post_path blog-writing-notes %}
, which gives the path rather than the hyperlink of post like /2022/09/08/blog-writing-notes/<a href="{% post_path blog-writing-notes %}#Refer-to-Other-Posts">Link with anchor</a>
, which allows you to refer to some particular anchor of your post like Link with anchor
Include a PDF file
This is an additional hexo plugin hexo-pdf, which could be installed by npm install --save hexo-pdf
.
It supports both external links and relative file path with the pdf file placed locally.
Basic usage:
{% pdf https://blablabla/test.pdf %}
{% pdf https://drive.google.com/file/d/xxxx/preview %}
{% pdf /
/test.pdf %}
Note that when referring to a local pdf file, the root directory for its path is the same as the root directory of the markdown file.
For example, when referring to a PDF file placed in /source/files/test.pdf
in /source/_posts/test.md
, the correct tag should be {% pdf ../files/test.pdf %}
rather than {% pdf ./files/test.pdf %}
Adding Emoji
I write a hexo tag for adding emojis conveniently, by inserting {% emoji EMOJI_NAME %}
to the post.
Check out the details here!
For even more convenience, set a VSCode key biding like this.
More specifically, go to File - Preferences - User snippets - markdown.json
, and add the following lines:
1 | "Add hexo user tag of emoji": { |
The $0
means the cursor will stop at this position after inserting it.
Then, navigate to File - Preferences - Keyboard shortcuts
, and add the following:
1 | { |
Now, entering ctrl + alt + E
will insert {% emoji %}
for you!
Blog Writing Notes