Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Process Obsidian notes to publish them with Hugo. Supports transformation of Obsidian wiki links into Hugo shortcodes for internal linking.
Obsidian To Hugo is a lightweight, zero-dependency Python CLI that converts an Obsidian vault into Hugo content by transforming wiki links and highlights into Hugo shortcodes and HTML marks.
Obsidian To Hugo is an open-source command-line tool written in Python, installable via pip install obsidian-to-hugo. It takes exactly two arguments: the path to an Obsidian vault (--obsidian-vault-dir) and the path to a Hugo content directory (--hugo-content-dir). The tool clears the target content directory, copies all vault files, removes the .obsidian folder, and rewrites Obsidian's [[wikilink]] syntax into Hugo shortcode links such as [wikilink]({{< ref "wikilink" >}}). It also converts Obsidian's ==highlight== syntax into HTML <mark> tags. The package exposes both a command-line interface and a Python API with a run() method.
[[...]] links into Hugo {{< ref >}} shortcodes, including links with custom text, heading anchors, and _index pages.==important== text with <mark>important</mark> HTML tags..obsidian folder is stripped immediately after copying, keeping local configuration out of the published site.filters argument; each function receives the file path and contents and returns True to copy the file or False to skip it.processors argument; each function takes file contents as a string and returns a processed string, applied after the default transformations.{{< ref >}} shortcodes that resolve cross references at build time.hugo to build the site.Run python -m obsidian_to_hugo --obsidian-vault-dir=<path> --hugo-content-dir=<path> from the terminal. The tool then clears the content directory, copies all vault files, removes .obsidian, and applies the link and highlight replacements. The Python API works the same way: instantiate ObsidianToHugo with the two directory paths and call run().
[[...]] is converted — workarounds like inserting an invisible space are not recommended by the author.Yes. You can pass a list of processor functions to the ObsidianToHugo constructor. Each processor receives the file contents as a string and returns the processed string; custom processors run after the default conversions.
Add a filter function to the filters argument. The function is called for each file with its path and contents; returning False causes the file to be skipped and not copied into the Hugo content directory.
.obsidian folder during conversion?The .obsidian directory is removed immediately after copying the vault contents, so your local Obsidian settings are never published with the site.
Install it from PyPI with pip install obsidian-to-hugo, then run it either as a module with python -m obsidian_to_hugo or through the Python API.
The tool only transforms the content directory; it doesn't affect Hugo theme compatibility. Because it converts links to standard Hugo {{< ref >}} shortcodes, any theme that uses Hugo's built-in shortcode handling will work.
