惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
量子位
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
Jina AI
Jina AI
L
LangChain Blog
M
MIT News - Artificial intelligence
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学

Chivier's Blog

Agentic Coding 2025 AI 使用总结 27 lines of code for LLM inference Tiling in AI Compilation - From Theory to Hardware Acceleration Comprehensive Cerebras Note 1 - Go From A Simple Example WaferLLM:分布式 AI 系统的循环与突破 Breaking the GPU Paradigm - A Systems Thinker's Guide to Wafer Scale Computing Breaking the GPU Paradigm - A Systems Thinker's Guide to Wafer Scale Computing AI Industry Comprehensive Analysis - June 2025 State of Development Modern LLM and VLM Training Methods - Comprehensive 2025 Guide Tenstorrent GraySkull Note Lanno Version 1 Lanno 正式版本发布 深深梦几许,猎猎青云中 —— DeepSeek 和无意义的变革 大道求索,无问西东 - 从 DeepSeek 看 MLSys 的 2025 DeepRead 开发笔记 Brief AI Accelerator History 2D Mesh QA Fake empty data generator 从 2024 Google IO 看下一场竞争
O2H auto publish
Chivier Humber · 2024-08-13 · via Chivier's Blog

Yet Another Obsidian Publish 1 (Github Page)

In this article, I will show something impressive. As an old Obsidian user, I have been living Obsidian for more than 2 years. When Obsidian became an important part of my life, I have a small trouble with publishing articles. I know I can export my notes to HTML and publish them, but I want a better way to do it. After searching for a while, using Obsidian’s Publish from Vault feature is an available solution, but I would like to share my article on some Blog platform. On one hand, my blog might have higher priority on Google search result. And on the other hand, I enjoy discussing with others by blog comments, so I would not give up using my own blog website.

So, here I would like to share my method of using Obsidian with a blog. With the help of GitHub pages and Hexo, I can easily publish my articles from Obsidian. Since Hexo is a static website generator, it is not hard to understand why it can be integrated with Obsidian. The process is simple:

  1. Export your notes from Obsidian to Markdown format.
  2. Use Hexo to generate a complete HTML page for each note and upload them to your Github repository.
  3. Wait till GitHub page generating action is finished.
  4. Enjoy.

Sounds good, but it would take a period time to publish one single article. In the first step, you have to replace image references in Obsidian to standard Markdown syntax. Meanwhile, in hexo, you have to edit the meta data like date, tags, categories for each markdown file. In order to solve these problems, I build a python script to solve them automatically.

Generate common Markdown file

Package Install

Chivier/obsidian2hexo (github.com)

H2O2H(Hexo-to-Obsidian & Obsidian-to-Hexo, but currently I only build obsidian to hexo), is the package.

The install method is simple:

1
pip install o2h

Usage

The usage is also simple,

image_1

In Hexo, you can set a category for your post by adding the following code to the post’s front-matter:

1
categories: [Category1, Category2]

You can also use tags to further classify and organise posts. To assign tags to a post, add the following code to the post’s front-matter:

1
tags: [Tag1, Tag2]

So, I build this CLI tool, it can find all tags in the Obsidian markdown file, and write them to the meta data of Hexo markdown file. The default output dir is /tmp/o2houtput, and you can set this to any other place if you like.

In addition, Github repository’s space is limited, so I provided an optional argument. If -p is added, obs2hexo will auto upload all pictures by using picgo upload1.

Example

Here are some examples:

1
# translate a.md to standard markdown# the category is "Skill"# all the picture are copied to a new folder named 'a' in current directoryobs2hexo -o $PWD -c Skill a.md# translate b.md to /tmp/o2houtput, all the picture are uploaded by picgoobs2hexo -c Develop -p b.md

Obsidian Upload Script

Install Shell Commands

After a CLI tool is built, the next step is to bind it into obsidian for easier use. The best method is to develop a new plugin, but I prefer to use python script for flexible modification. Another reason is that I have not resolved all the links in Obsidian. As is known, obsidian can use Wikilinks to reference other notes. And I will build a database to record all the published notes.

image_2

Anyway, my current solution is not so perfect and I would like to keep improving my current solution. After I take all possible situation into consideration, I will build a plugin then.

So, you might ask me, how to improve the user experience without build an obsidian plugin? Ans the key is Obsidian Shell Commands[²].

image_3

You can find it in Community Plugins. After installing and enabling the plugin, the plugin settings can be edit in the Obsidian setting panel.

image_4

Config the Shell commands

Here is my example of how to build a shell script to publish my article:

image_5

On the script above, I introduce the $HOME/.pyenv/shims and $HOME/.yarn/bin. As I use pyenv to manage my Python virtual environment, and the path should be $HOME/.local/bin if you just use system python. And I use picgo to upload pictures, so I introduced .yarn and .nvm path into the $PATH variable.

And then, there are some other variables in shell commands plugin, like {{date:YYYY}} and {{_category}}. Most variables can be found after you typed in {{`. Shell commands provide something like auto completion, `{{_category}} is a special variable we set in the command preaction panel.

image_6

image_7

You can also build preactions here:

image_8

I set up a new field called category, so every time I run the command, it will promptly ask me to give a specific category for my aritcle.

image_9

After all configurations are successfully set, we can call the commands in obsidian easily:

image_10

Reference

[¹]: PicGo/PicGo-Core: A tool for pictures uploading. Both CLI & API supports. (github.com)

[²]: Taitava/obsidian-shellcommands: Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links. (github.com)