Skip to content

Commit aee5b26

Browse files
committed
fix: 🐛 Fix issues with images not showing up
1 parent 3d6d901 commit aee5b26

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99

1010
serve:
1111
image: hugomods/hugo:exts-non-root
12-
command: server --poll 1000ms --buildDrafts --noHTTPCache --renderToMemory -p 13130
12+
command: server --poll 1000ms --buildDrafts --noHTTPCache --renderToMemory -p 13130 --baseURL http://localhost/
1313
volumes:
1414
- "./:/src"
1515
- "~/hugo_cache:/tmp/hugo_cache"

content/posts/hugo/write-a-blog-with-hugo-and-obsidian/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,26 @@ Create a new template file. Using this template, we can create a new blog post d
122122

123123
Use `Create new note from template` and select the template you've just created to write a new blog post.
124124

125-
![](/attachments/Obsidian_FakraXQdCq.png)
125+
![](attachments/Obsidian_FakraXQdCq.png)
126126

127127
Obsidian will prompt a new title. This is what `tp.system.prompt(...)` does!
128128

129-
![](/attachments/Obsidian_ZIy6HuS2Ti.png)
129+
![](attachments/Obsidian_ZIy6HuS2Ti.png)
130130

131131
Pressing enter will create a new directory and `index.md` inside.
132132

133133
> Sometimes, creating note from the template, while `serve` Hugo container is running, might not read by Hugo server. If so, just simply restart the `serve` container.
134134
135135
## 4. Attaching images
136136

137-
![](/attachments/Pasted%20image%2020250824182120.png)
137+
![](attachments/Pasted%20image%2020250824182120.png)
138138

139139
Under Obsidian settings, go to `File and links` and you will find the setting above. Changing this will create `attachments` folder inside each new blog post directory.
140140

141-
![](/attachments/Pasted%20image%2020250824182242.png)
141+
![](attachments/Pasted%20image%2020250824182242.png)
142142

143143
Also set `New link format` to `Relative path to file` so that the link to the images will be like `attachments/image_name.png`.
144144

145-
![](/attachments/MiXgu5xYnD.png)
145+
![](attachments/MiXgu5xYnD.png)
146146

147147
Attachments will be living under the same post's directory now.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<p>
2+
<img
3+
src="{{ .Page.Site.BaseURL }}{{ .Destination | safeURL }}"
4+
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
5+
{{- with .Title }} title="{{ . }}"{{ end -}}
6+
>
7+
</p>

0 commit comments

Comments
 (0)