HUGO

Hugo renders local website only in draft mode

my system: 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)

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
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/

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. :slight_smile:

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:

[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?

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.

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!

If you have any html in your markdown files, you need to set unsafe = true in the goldmark section of your config file. See https://gohugo.io/getting-started/configuration-markup#config

This is new thing since version 0.60.0.

thank you, it is fine now

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