# Images: basic principles

**URL:** <https://discourse.gohugo.io/t/images-basic-principles/40272>\
**Category:** support\
**Created:** [August 30, 2022, 5:50am UTC](https://discourse.gohugo.io/t/images-basic-principles/40272 "2022-08-30T05:50:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreamoro](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/andreamoro/32/17173_2.png) [@andreamoro](https://discourse.gohugo.io/u/andreamoro)\
**Post date:** [August 30, 2022, 5:50am UTC](https://discourse.gohugo.io/t/images-basic-principles/40272/1 "2022-08-30T05:50:42Z")

</div>

Hello there,

My understanding is that all images should be stored under the /assets folder to be manipulated and picked with the resources.getMatch.

In theory this should make the /static folder redundant.

However, I just realised that images in the asset folder, if not referenced anywhere, are not get published.

In my case, I have some images being used in a .scss file, which are not pushed through.  
Are there any best practices?

Splitting images between two folders, doesn’t sound efficient when it come to managing them.  
Thnanks

---

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [August 30, 2022, 5:55am UTC](https://discourse.gohugo.io/t/images-basic-principles/40272/2 "2022-08-30T05:55:04Z")

</div>

No, the static folder is not redundant.  
Its purpose is to push static files upon build (all files that are inside) and can be used to serve non-Hugo-specific files.

As you noticed, assets are only taken upon build when they are referenced (called).  
I don’t use `assets` folder at all but instead, I specified assets folder to be a `content` folder so I got images along the content.

```auto
assetDir = "content"

```

In your case, you probably need to put them into a static folder. Files served inside CSS are not dynamic. They are not reprocessed during build hence they are static.

You need to understand the purpose of both folders.  
Use assets for the mages used in markdown and static for other parts, like website layout.

---

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [August 30, 2022, 7:30am UTC](https://discourse.gohugo.io/t/images-basic-principles/40272/3 "2022-08-30T07:30:56Z")

</div>

> [@andreamoro](#):
>
> My understanding is that all images should be stored under the /assets folder to be manipulated and picked with the resources.getMatch.

In addition to the explanation of @idarek: You can also store your images in a page bundle, e.g. those required by this page.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [September 1, 2022, 7:31am UTC](https://discourse.gohugo.io/t/images-basic-principles/40272/4 "2022-09-01T07:31:04Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
