Hexo X Obsidian

Its seems like a lot of time we are spending on writing notes. When we studied in the school, learning new skills, or even just randomly taking notes with new ideas when walking on the street. However, when we grow up or even just one year later, all of the notes are just disappear because we no longer remember what we are right now. Therefore, it is a good way to record what we learnt with a good system. Obsidian, is really a free software to record the note and link the notes together.

Obsidian

Quick sync method

  • using docker to link the location between the Obsidian folder as the volumes (hyperlink)
  • In docker-compose.yml:services: volumes, add the link as below

Setup the docker part

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
version: '3.8'

services:

  blog:

    # long time maintain version
    image: node:lts
    volumes:
      - .:/app
      - "[Path to real post file location (Obsidian)]:[Path to hexo blog post folder]"
      - "[Path to real post img folder location (Obsidian)]:[Path to hexo blog image folder]"
      - "C:/Users/SyncNote/img:/app/source/img"
    working_dir: /app
    command: sleep infinity
    ports:
      - "4000:4000"

Setup the Obsidian part

  • Using the extension attachment management. This is more easily to use that can exclude the folder that is link to the hexo folder. So as long as you just want to edit the markdown file, just use Obisidian, and everything will be pefect to be synced perfectly. So as long as you would like to upload the new post, just run the docker with the pulled hexo file, then the full setup is easy to be use!
  • Attachment issue

    • Solved by the function with obsidian-consistent-attachments-and-links
      • Automatically fixed the problem from the attachments and links
      • Need to disable the wiki links in the setting. Instead, using markdown links. This can avoid the backlink issue (On the other hand, we still can use backlink function, I cannot really understand the difference between markdown links and the backlink function...)
  • It's a trick to sync the post file that in the vault in Obsidian

Sync the content (for the local copy)

  • I'll just focus on the local document, no need to make things become complex.

Issue

  • Smoothly add the image based on Obsidian default setting: in the image in the attachments folder
  • Solution
    • Semi-auto function to solve the problem
    • This method needs the plugin consistent attachment and links
    • Copy the file that would like to publish to the temporary folder, so the system will monitor the link and change to the folder's name
    • Copy the folder and the file to the publish hard-link folder.
    • This can avoid the messy assets (or just images) spread everywhere.

Cheat sheet for the Hexo blog

Rules for the publication via hexo blog (or more like the template)

1
2
3
4
5
6
7
8
9
headers
# <- title, so won't use this in the article
## <- the article title
### <- sub title of the article
#### <- bullet point of the sub title

I'll just stick on using 3 level titles (H1 (#) would be the blog title, if I remember correctly. Otherwise it would be too narrow to the details and hard to focus on the topics for readers.


Fast deploy method for the hexo
https://blog.esunr.xyz/2022/06/64163235c30f.html#npm-安装

Integrate hexo and Obsidian

Reference