|
Adds code from Hugo's built-in render-image hook
and modifies it slightly to support relative image
paths in markdown files.
Previously, we'd have to spell the absolute path
from root of the hugo site or make directories for
each individual post which is what Hugo recommend.
But this was very inefficient. This change allows
us to use editors like Obsidian, VSCode and have
them render the images correctly. It also supports
Hugo's page bundles for rendering images as a
result. Based on the order, I believe page bundles
are given priority so that works out.
i.e, if you have the following tree:
```
content
└── posts
├── _index.md
├── hello.md
├── images
│ └── test.png
└── test.png
```
You can now include images in `hello.md` in the
following ways:
```




```
|