Refs work with `hugo serve -D` but fail with only running `hugo`

$ pwd
joebb_website_hugo/content

$ tree
.
|____music
| |____ things.md
|____archive
|____about
| |____ index.md # about/index.md
|____blog
| |____ design-hints.md
| |____ key-review.md
| |___  _index.md # blog/_index.md
|____ _index.md # content/_index.md

My content folder directory structure above ^ apologies for the difficulty denoting which are _index.md vs index.md , tree doesn’t work that well in showing the difference, I added some comments to help

I’m on hugo version v0.68.3

$ hugo version
Hugo Static Site Generator v0.68.3/extended darwin/amd64 BuildDate: unknown

These refs fails in content/_index.md when running hugo

{{< ref "/about/_index" >}}
{{< ref "/blog/design-hints" >}}
$ hugo
Building sites … ERROR 2020/06/13 11:38:46 [en] REF_NOT_FOUND: Ref "/about/_index": "joebb_website_hugo/content/_index.md:13:90": page not found
ERROR 2020/06/13 11:38:46 [en] REF_NOT_FOUND: Ref "/blog/design-hints": "joebb_website_hugo/content/_index.md:15:16": page not found
Total in 20 ms
Error: Error building site: logged 2 error(s)

But doing hugo serve -D works fine

$ hugo serve -D

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

Built in 31 ms
Watching for changes in joebb_website_hugo/{archetypes,content,data,i18n,layouts,static}
Watching for config changes in joebb_website_hugo/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 http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

I’m on macOS and I installed hugo using homebrew if that helps at all

Here be my repository: https://github.com/joebb97/joebb97.github.io

-D, --buildDrafts            include content marked as draft

if you need access to the draft content then you need to use hugo -D

also check hugo --help for complete options/flags

ohhhhhhhhhhh

that makes sense, sorry I didn’t pick up on that. Thanks so much!

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