-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
What version of Hugo are you using (hugo version
)?
$ hugo version
hugo v0.150.0-3f5473b7d4e7377e807290c3acc89feeef1aaa71+extended linux/amd64 BuildDate=2025-09-08T13:01:12Z VendorInfo=snap:0.150.0
Version v0.150.0
Does this issue reproduce with the latest release?
Yes
Issue Description
When building localized draft content, resources (e.g. an image) still get built.
TL;DR Example
I have a draft content content/my-blog-post/
. This contains the following files:
- Content markdown file
content/my-blog-post/index.it.md
- An image
content/my-blog-post/gfx/red.jpg
---
title: "Test Localized Draft"
draft: true
---
# Localized Draft (IT)
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

If I build the website, I can clearly see that under public/
there's not the HTML page for my-blog-post
, as expected. However, the image is present at public/my-blog-post/gfx/red.jpg
.
Below is a more complete example to reproduce the issue.
Example (MRE)
-
Setup quickstart:
hugo new site .
-
Clone a theme:
git clone https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
-
Update
hugo.yaml
:baseURL: "/" languageCode: en-us theme: "ananke" params: defaultContentLanguage: "en" languagesDir: "i18n" languages: en: {} it: {}
-
Write some draft content, placing an image under
gfx/
(such as this:red.jpg
:-
Draft content in default language:
-
content/test-en-draft/gfx/red.jpg
-
content/test-en-draft/index.md
:--- title: "Test English Draft" draft: true --- # English Draft Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
-
-
Draft content in a secondary language (e.g.
it
):-
content/test-it-draft/gfx/red.jpg
-
content/test-it-draft/index.it.md
:--- title: "Test Italian Draft" draft: true --- # Italian Draft Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
-
-
Draft content with multiple languages (e.g. default and
it
):-
content/test-multi-draft/gfx/red.jpg
-
content/test-multi-draft/index.md
:--- title: "Test MultiLanguage Draft (EN)" draft: true --- # MultiLanguage Draft (EN) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
-
content/test-multi-draft/index.it.md
:--- title: "Test MultiLanguage Draft (IT)" draft: true --- # MultiLanguage Draft (IT) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
-
-
-
Run Hugo:
hugo server --disableFastRender --cleanDestinationDir --gc --ignoreCache
-
Have a look at the generated pages:
tree public public ├── 404.html ├── ananke │ └── css │ ├── main.css.map │ └── main.min.css ├── categories │ ├── index.html │ └── index.xml ├── en │ ├── index.html │ └── sitemap.xml ├── images │ └── gohugo-default-sample-hero-image.jpg ├── index.html ├── index.xml ├── it │ ├── 404.html │ ├── categories │ │ ├── index.html │ │ └── index.xml │ ├── index.html │ ├── index.xml │ ├── sitemap.xml │ └── tags │ ├── index.html │ └── index.xml ├── sitemap.xml ├── tags │ ├── index.html │ └── index.xml └── test-it-draft └── gfx └── red.jpg <-- Why? 12 directories, 22 files
Question
Is this behaviour intended/expected? Am I missing something or configuring localization wrongly?