# Hugo renders local website only in draft mode

**URL:** <https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223>\
**Category:** support\
**Created:** [March 24, 2020, 4:01pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223 "2020-03-24T16:01:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![soundsbeard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/soundsbeard/32/10876_2.png) [@soundsbeard](https://discourse.gohugo.io/u/soundsbeard)\
**Post date:** [March 24, 2020, 4:01pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/1 "2020-03-24T16:01:22Z")

</div>

my system: [https://pastebin.com/vVYLjhDR](https://pastebin.com/vVYLjhDR)

i was using hugo for many years.  
i deployed my website with netlify using hugo 0.37 back in the days (screenshot from Netlify)  
[![](https://i.imgur.com/pPxeUra.png) ](https://i.imgur.com/pPxeUra.png)

everything was fine, i was making new content for my blog and pushed changes to bitbucket repo.  
i was updating my system (manjaro) as usual, and before posting i always run local build with  
$ hugo server

after the last update im not able to see parts of my website locally, but for some reason it builds ok with  
$ hugo server -D

and no, i don’t mean that i don’t see drafts without -D flag, i don’t have any drafts.  
hugo can’t render this part of code from index.html: [https://pastebin.com/zEPBu3Aw](https://pastebin.com/zEPBu3Aw)  
also it gives 404 on clicking one of the navigation links.

also it doesn’t display videos added with  
`<video controls src="/img/misc_images/file.mp4"></video>`  
even with -D flag

here is a link to a repo (code and formatting is really bad):  
[https://bitbucket.org/soundsbeard/soundsbeard-website/src/master/](https://bitbucket.org/soundsbeard/soundsbeard-website/src/master/)

is my code too old, or there is a bug in new versions of hugo?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [March 24, 2020, 6:08pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/2 "2020-03-24T18:08:49Z")

</div>

> [@soundsbeard](#):
>
> is my code too old, or there is a bug in new versions of hugo?

I haven’t loaded your repo, but the way to check is the same: check which theme you are using and get support from the author, or check the errors and see what it says. Are you getting any errors? Which version of Hugo are you using now?

Whenever you upgrade versions you’ll need to note changes and adjust accordingly. 🙂

---

<div class="post-metadata">

**Author:** ![soundsbeard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/soundsbeard/32/10876_2.png) [@soundsbeard](https://discourse.gohugo.io/u/soundsbeard)\
**Post date:** [March 25, 2020, 12:30pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/3 "2020-03-25T12:30:16Z")

</div>

i don’t use themes, i did all html, css and js by myself.  
hugo version:  
Hugo Static Site Generator v0.68.1/extended linux/amd64 BuildDate: unknown

well, actually i had some old errors about deprecating .URL and at first i thought that its the reason for not building local site.  
but i followed the error message and replaced all .URL (methods? functions?) to .Permalink and still it us able to build a website in draft mode, but not in normal mode.

here is the output of `hugo server` and `hugo server -D`:

```auto
[soundsbeard@sb-renderpit soundsbeard-website]$ hugo server

                   | EN   
-------------------+------
  Pages | 7  
  Paginator pages | 0  
  Non-page files | 0  
  Static files | 190  
  Processed images | 0  
  Aliases | 0  
  Sitemaps | 1  
  Cleaned | 0  

Built in 3952 ms
Watching for changes in /run/media/soundsbeard/fb08260a-df77-45f7-9735-deaf965f9c60/sb/make it SYNC manjaro/projects/www/hugo/soundsbeard-website/{archetypes,content,data,layouts,static}
Watching for config changes in /run/media/soundsbeard/fb08260a-df77-45f7-9735-deaf965f9c60/sb/make it SYNC manjaro/projects/www/hugo/soundsbeard-website/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

[soundsbeard@sb-renderpit soundsbeard-website]$ hugo server -D

                   | EN   
-------------------+------
  Pages | 23  
  Paginator pages | 0  
  Non-page files | 0  
  Static files | 190  
  Processed images | 0  
  Aliases | 0  
  Sitemaps | 1  
  Cleaned | 0  

Built in 1054 ms
Watching for changes in /run/media/soundsbeard/fb08260a-df77-45f7-9735-deaf965f9c60/sb/make it SYNC manjaro/projects/www/hugo/soundsbeard-website/{archetypes,content,data,layouts,static}
Watching for config changes in /run/media/soundsbeard/fb08260a-df77-45f7-9735-deaf965f9c60/sb/make it SYNC manjaro/projects/www/hugo/soundsbeard-website/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

```

so the best way to get things working is to downgrade hugo and exclude it from updates?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [March 25, 2020, 8:39pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/4 "2020-03-25T20:39:56Z")

</div>

You have `draft: true` for most of the content, as set in `/content/misc/_index.md`. That would be one reason it only shows in draft mode.

---

<div class="post-metadata">

**Author:** ![soundsbeard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/soundsbeard/32/10876_2.png) [@soundsbeard](https://discourse.gohugo.io/u/soundsbeard)\
**Post date:** [March 27, 2020, 1:12pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/5 "2020-03-27T13:12:21Z")

</div>

thats surprising, i’ve changed draft to true in \_index.md, and it worked.  
how does it work?  
i had ‘false’ on each separate .md blog post and it was working.  
so now \_index.md defines the overall option for all posts?

and `<video></video>` is not displayed still.  
anyway, thank you for looking through my issue, i appreciate that!

---

<div class="post-metadata">

**Author:** ![funkydan2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/funkydan2/32/5636_2.png) [@funkydan2](https://discourse.gohugo.io/u/funkydan2)\
**Post date:** [March 28, 2020, 4:48am UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/6 "2020-03-28T04:48:20Z")

</div>

> [@soundsbeard](#):
>
> and `<video></video>` is not displayed still.

If you have **any** html in your markdown files, you need to set `unsafe = true` in the goldmark section of your config file. See [Configure markup | Hugo](https://gohugo.io/getting-started/configuration-markup#config)

This is new thing since version 0.60.0.

---

<div class="post-metadata">

**Author:** ![soundsbeard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/soundsbeard/32/10876_2.png) [@soundsbeard](https://discourse.gohugo.io/u/soundsbeard)\
**Post date:** [March 28, 2020, 1:33pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/7 "2020-03-28T13:33:05Z")

</div>

thank you, it is fine now

---

<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:** [March 30, 2020, 1:33pm UTC](https://discourse.gohugo.io/t/hugo-renders-local-website-only-in-draft-mode/24223/8 "2020-03-30T13:33:05Z")

</div>

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