[hexo series] 02.hexo and obsidian achieve silky notes

hexo theme

hexo theme collection

cd blog
git clone https://github.com/yelog/hexo-theme-3-hexo.git themes/3-hexo

This is to download the 3-hexo theme to the 3-hexo folder under the themes theme in the blog directory.

Open the _config.yml configuration file in the blog directory and modify the theme to 3-hexo

hexo clean
hexo g
hexo d

The effect is as follows:
(Modified some configuration data, not written in the blog)

advanced hexo

hexo plugin: Automatically generate directories

want to automatically generate a directory

The original article directory format is as follows, and the original data of the article is as follows

npm install hexo-auto-category --save

Configure Hexo_config.yml

# Generate categories from directory-tree
# Dependencies: https://github.com/xu-song/hexo-auto-category
# depth: the max_depth of directory-tree you want to generate, should > 0
auto_category:
 enable: true
 depth:
# 本地预览
hexo clean && hexo g && hexo s
# github
hexo clean && hexo g && hexo d

You can see that the categories directory has been automatically added

hexo plugin: Automatically generate directory serial number (optional)

Configure Hexo_config.yml

# 插件 hexo-heading-index 自动生成标题序号
heading_index:
  enable: true
  index_styles: "{1} {1} {1} {1} {1} {1}"
  connector: "."
  global_prefix: ""
  global_suffix: ". "
  start_level: 1
  allow_html: false

obsidian plugin: templater

install plugin

Open the plug-in
settings in the lower left corner --> third-party plug-ins --> community plug-in market, search: templater

image.png

Click Install, then Enable.

configure plugin

Create a new folder under the warehouse, name it whatever you want

image.png

In the configuration of the plug-in, fill in the folder just now.

image.png

custom template

Customize a hexo metadata template

image.png

---
title: <% tp.file.title %>
author: ningan123
date: <% tp.file.creation_date() %>
updated: <% tp.file.last_modified_date() %>
tags:
---

new note

Here, select a note created before, click on the template on the left template, and select the template hexo just created

image.png

image.png

It can be seen that the template data has been dynamically generated. The
reason why you want to choose a note that was created before is because you want to reflect the difference between the creation_date and last_modified_date of the plugin.
image.png

You can also customize other data you want, and you can go to Templater to view the generation of other grammars.

With the plug-in that hexo dynamically generates the directory just now, metadata automation can be realized, isn't it cool~—

References

# hexo-auto-category
hexo-heading-index
Templater

Guess you like

Origin blog.csdn.net/weixin_42072280/article/details/128277828