Convert obsidian images to hugo

Obsidan uses the following markup for images

1
![[image_name]]

On the other hand hugo uses a different markup, as long as the images are in the static folder, the markup should look like the following:

1
![](/image_name)

We can use a simple regex to convert obsidian images to hugo format. You can use it either find and replace option, with regex option enabled in any modern IDE like VS code.

1
2
Find !\[\[(.*)\]\]
Replace ![](/$1)

You can also run it from the command line, for example, with sed command

1
sed -i  -e 's/!\[\[\(.*\)\]\]/![](\/\1\)/g' convert-obsidian-images-to-hugo.md
updatedupdated2024-01-172024-01-17