Hugo Narrow support import local resources such as images with three methods:

  • Page Bundles (markdown folder)
  • Global Resources (assets folder)
  • Static Resources (static folder)

Page Bundles

Page Bundles refer to resource files located in the same directory as the Markdown file. This is the most recommended method for managing image resources.

BASH
 1content/
 2└── posts/
 3    ├── post-1.md
 4    ├── post-1.zh-cn.md
 5    └── post-2/
 6        ├── index.md
 7        ├── index.zh-cn.md
 8        ├── featured.jpg
 9        └── gallery/
10            ├── image-1.jpg
11            └── image-2.jpg
Click to expand and view more

Use in Markdown:

MARKDOWN
1![](featured.jpg)
2![](gallery/image-1.jpg)
3![](gallery/image-2.jpg)
Click to expand and view more

Global Resources

Global resources are placed in the assets folder at the root directory of the site: ~/assets/. Resources placed in this folder will be processed by Hugo during the build.

BASH
1my-site/
2├── assets/
3│   └── images/
4│       └── hero.jpg
5├── content/
6└── themes/
7    └── hugo-narrow/
Click to expand and view more

Use in Markdown:

MARKDOWN
1![](images/hero.jpg)
Click to expand and view more

Static Resources

Static resources are placed in the assets folder at the root directory of the site: ~/static/. Resources placed in this folder will NOT be processed by Hugo during the build.

BASH
1my-site/
2├── static/
3│   └── images/
4│       └── hero.jpg
5├── content/
6└── themes/
7    └── hugo-narrow/
Click to expand and view more

Use in Markdown:

MARKDOWN
1![](/images/hero.jpg)
Click to expand and view more

Different

LocationUse
Page Bundles~/content/posts/post-1/featured.jpgfeatured.jpg
Global Resources~/assets/images/featured.jpgimages/featured.jpg
Static Resources~/static/images/featured.jpg/images/featured.jpg

Copyright Notice

Author: Hugo Narrow

Link: https://hugo-narrow-docs.vercel.app/docs/local-resources/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut