# Are "assets" and "static" folders interchangeable?

**URL:** <https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778>\
**Category:** support\
**Tags:** assets\
**Created:** [January 26, 2022, 12:33am UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778 "2022-01-26T00:33:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bev](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bev](https://discourse.gohugo.io/u/bev)\
**Post date:** [January 26, 2022, 12:33am UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778/1 "2022-01-26T00:33:12Z")

</div>

I have both defined as static directories. CSS and JS are in the assets folder (no SASS or SCSS) and everything else (images, \_headers file, etc) are in the static folder. Can I use either to house static files or is it better to keep them separate?

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [January 26, 2022, 11:19am UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778/2 "2022-01-26T11:19:00Z")

</div>

> [@bev](#):
>
> Can I use either to house static files or is it better to keep them separate?

Project organization is up to you. If you have mounted both assets and static as the `staticDir` then you can use them both ways.

---

<div class="post-metadata">

**Author:** ![bev](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bev](https://discourse.gohugo.io/u/bev)\
**Post date:** [January 26, 2022, 11:48am UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778/3 "2022-01-26T11:48:12Z")

</div>

I read in the Hugo Documentation that assets is for Hugo Pipes and thus split both directories.

~~I just noticed putting any other thing other than CSS and JS in the assets folder is not copied over to the public folder.~~

---

<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:** [January 26, 2022, 12:41pm UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778/4 "2022-01-26T12:41:19Z")

</div>

In my rough understanding, files in `static` are always pulled on a build, where `assets` only when needed/requested by the code/function/module/shortcode etc.

You may have 10 versions of a file in `assets` and call for 1 only in code, then folder on the build website will serve only 1 file (links to 9 others will results in file not found)

When you got 10 versions of a file in `static` on the build you will have all 10 files served (accessible).

---

<div class="post-metadata">

**Author:** ![bev](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@bev](https://discourse.gohugo.io/u/bev)\
**Post date:** [January 26, 2022, 12:47pm UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778/5 "2022-01-26T12:47:03Z")

</div>

> [@idarek](#):
>
> You may have 10 versions of a file in `assets` and call for 1 only in code, then folder on the build website will serve only 1 file (links to 9 others will results in file not found)

@idarek interesting. I see the others are being put in the public folder locally while inside the assets folder. Perhaps that is a recent Hugo thing.

---

<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:** [January 28, 2022, 12:47pm UTC](https://discourse.gohugo.io/t/are-assets-and-static-folders-interchangeable/36778/6 "2022-01-28T12:47:53Z")

</div>

Closed on January 28, 2022, 12:47pm UTC

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