https://micahmount.com - A Hugo site
I wanted a personal website; somewhere to showcase my personal projects, as well as a blog where I could publish all the fun little projects I putter around with.
The site is built with Hugo, the Quick start guide stays up to date, but in general once Hugo is installed (see below), simply run hugo server in the root directory to compile and start.
Hugo only requires git and Hugo to get up and running.
I added a set of tools to automate syncing blog posts between Obsidian and Hugo. This automation handles both content synchronization and image management.
This toolset provides two main functions:
- Syncs blog posts from Obsidian to Hugo using rsync
- Processes image attachments:
- Finds image references in blog posts
- Copies images from Obsidian attachments to Hugo static directory
- Updates image links in blog posts to use Hugo's format
- Python 3.x
- rsync
- Bash shell
- Obsidian vault with blog posts
- Hugo blog setup
- Clone this repository to your local machine
- Update the paths in both
images.pyandimport_posts.sh:
In images.py:
python posts_dir = "/path/to/hugo/blog/" # Your Hugo blog posts directory attachments_dir = "/path/to/obsidian/attachments/" # Your Obsidian attachments directory static_images_dir = "/path/to/hugo/static/img/" # Your Hugo static images directory
In import_posts.sh:
bash ObsidianPostsPath="/path/to/obsidian/blog/" # Your Obsidian blog posts directory HugoPostsPath="/path/to/hugo/blog/" # Your Hugo blog posts directory
Run the import script from the terminal:
./import_posts.shThis will:
- Sync all blog posts from Obsidian to Hugo
- Process any image links in the posts
- Copy referenced images to Hugo's static directory
import_posts.sh- Main bash script that orchestrates the sync processimages.py- Python script that handles image processing and link updates
The script looks for Obsidian-style image links ([[image.png]]) and converts them to Hugo-compatible Markdown links ([Image Description](/img/image.png)).
- The sync is one-way (Obsidian → Hugo)
- The script uses
rsyncwith the--deleteflag, so files removed from Obsidian will also be removed from Hugo - Make sure to backup your Hugo blog content before first use
Based on Network Chuck's blog automation system, modified to separate the sync and publish steps.