A bridge from Obsidian to Hugo for Static Website Generation (including ForeverLinks redirect support for Netlify).
GPL-2.0 License
A converter/bridge from Obsidian to Hugo for Static Website Generation, including foreverlinks redirects for Netlify.
This is super-niche but if you are going to use Obsidian + Hugo + Netlify, this will save you so much time you'll want to hug me ;)
This is like a v0.1-alpha version but it already handles all of the following...
index.md
(but in different folders of course) but this makes itindex.md
thing again)*/old_slug
or */old_slug/
to current_canoncial_URL
)Run ..path.to../obsigo.sh
from your hugo directory.
Obsigo will read a content source directory (typically content_src
but could be any location you are managing
with Obsidian) and write to a destination directory (typically content
) that hugo
will then process to
generate a static site.
Obsigo will also generate foreverlinks, typically by writing redirects to static/_redirects
(those redirects are
in the format expected by Netlify)
Obsigo will do the following actions:
aliases:
, slug:
, the filename.md
or the folder_name/index.md
_redirects
file_redirects_base.txt
(if it exists)/xyz/pagename.md
to hugo /xyz/pagename/index.md
/xyz/leaf-node/leaf-node.md
to hugo /xyz/leaf-node/index.md
slug:
to frontmatter (base on filename or foldername)/cat/oldname.md
becomes /cat/newname.md
, obsigo will detect it because theslug:
will still be oldname
. At that point, obsigo will add oldname
to the frontmatter aliases:
slug:
to newname
. (This will, as any alias, generate a foreverlink from */oldname
to /cat/newname
.index.md
to slug.md
so that your source files are easier to identify in search results..../xyz/index.md
-> .../xyz/
.../xyz/leaf-node/leaf-node.md
-> .../xyz/leaf-node/
![TED Talk](https://www.youtube.com/watch?v=M0yhHKWUa0g)
-> {{< youtube M0yhHKWUa0g >}}
![TED Talk](https://youtu.be/M0yhHKWUa0g)
-> {{< youtube M0yhHKWUa0g >}}