# Posts not listed on home page in production build

**URL:** <https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284>\
**Category:** support\
**Created:** [February 14, 2024, 12:16pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284 "2024-02-14T12:16:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leah123](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@Leah123](https://discourse.gohugo.io/u/Leah123)\
**Post date:** [February 14, 2024, 12:16pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/1 "2024-02-14T12:16:29Z")

</div>

I’m about to deploy my new hugo site. I have two blog posts ready to go. When I run hugo on my local computer in dev mode, both posts are listed on the home page. However, when I ran

> hugo server -e production

to test what it would look like in production, hugo has created a home page with only a link to one of the two blog posts. I’m not sure if this is a theme level issue or a hugo issue.

I’m very limited in my choice of themes (I believe) because I couldn’t get CGO on my windows computer to build the themes that require it.

Any suggestions about how to get all blog posts listed on the home page?

Incidentially, I am using the mini theme.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 14, 2024, 12:26pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/2 "2024-02-14T12:26:38Z")

</div>

Is draft set to true on either of the posts? Is one of the dates in the future?

[https://gohugo.io/troubleshooting/faq/#why-is-a-given-page-not-published](https://gohugo.io/troubleshooting/faq/#why-is-a-given-page-not-published)

If you need additional assistance, please post a link to the public repository for your project.

See [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132).

> Let us see your code
> 
> Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

---

<div class="post-metadata">

**Author:** ![Leah123](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@Leah123](https://discourse.gohugo.io/u/Leah123)\
**Post date:** [February 14, 2024, 1:06pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/3 "2024-02-14T13:06:19Z")

</div>

Thank you for your response. Draft is set to ‘false’ on both posts.

I pushed my site to github for you to take a look. Thank you

[MikeMitchellWebDev/hugoblog (github.com)](https://github.com/MikeMitchellWebDev/hugoblog)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 14, 2024, 1:10pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/4 "2024-02-14T13:10:59Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/6/2/620cf951a1fb81603d10597be898b1ee298b1ec1.png)

That says `draft = true`.

---

<div class="post-metadata">

**Author:** ![Leah123](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@Leah123](https://discourse.gohugo.io/u/Leah123)\
**Post date:** [February 14, 2024, 1:14pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/5 "2024-02-14T13:14:31Z")

</div>

![blog_screenshot](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/a/9/a90d8d76d4fd6e7554344a8b6d698a40a7718640.png)  
that says draft = false

can you explain the discrepancy? I’m looking in the content/posts folder

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 14, 2024, 1:15pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/6 "2024-02-14T13:15:36Z")

</div>

What you have locally is irrelevant. Look at the content of your repository:

[https://github.com/MikeMitchellWebDev/hugoblog/blob/main/content/posts/master-plan-michael-healey.md](https://github.com/MikeMitchellWebDev/hugoblog/blob/main/content/posts/master-plan-michael-healey.md)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 14, 2024, 1:16pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/7 "2024-02-14T13:16:25Z")

</div>

I’m guessing you haven’t committed and/or pushed changes.

---

<div class="post-metadata">

**Author:** ![Leah123](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@Leah123](https://discourse.gohugo.io/u/Leah123)\
**Post date:** [February 14, 2024, 1:20pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/8 "2024-02-14T13:20:17Z")

</div>

I only pushed that code to show you the blog. 1 hour ago it didn’t exist on [github.com](http://github.com). I have the site on my local computer and never intended to push it to github until this problem arose.

to further illustrate, here’s a screenshot of the generated html of the blog post in the public folder, which I thought hugo only generated if draft was set to false.

 ![blog_screenshot_2](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/6/a/6aa0e93b9707e7dcfe1c02908133a0d3b76467d2.png)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 14, 2024, 1:26pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/9 "2024-02-14T13:26:40Z")

</div>

I’m not sure how to make this any clearer. The `draft` flag does exactly what it is supposed to do, and its behavior in this context has not changed in a decade.

The only reason you might see content in public that is marked draft in your content directory is if you toggled the value and you didn’t clear your public directory.  
[https://gohugo.io/getting-started/usage/#build-your-site](https://gohugo.io/getting-started/usage/#build-your-site)

---

<div class="post-metadata">

**Author:** ![Leah123](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@Leah123](https://discourse.gohugo.io/u/Leah123)\
**Post date:** [February 14, 2024, 1:32pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/10 "2024-02-14T13:32:41Z")

</div>

I deleted the public directory and rebuilt. It’s working now. Thank you for your help.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 14, 2024, 1:36pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/11 "2024-02-14T13:36:24Z")

</div>

If your production site uses the “public” directory that you create locally, you should always clear the public directory before building to remove draft, expired, and deleted content.

If your site or theme has a static directory, even if it is empty, you can use the `--cleanDestinationDir` command line flag when building your site.

---

<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:** [February 16, 2024, 1:36pm UTC](https://discourse.gohugo.io/t/posts-not-listed-on-home-page-in-production-build/48284/12 "2024-02-16T13:36:32Z")

</div>

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