[Solved] Cannot create content/about.md

Hey all,

I simply want to create the following static pages in /:

content/about.md
content/contact.md

But it seems whatever I try I’m getting 404 Not Found. I have tried setting the type of about.md to about and layout to about with layouts/about/about.html and setting the type to about with simply layouts/about.html

I would prefer my layouts directory look like this:

layouts/about.html
layouts/contact.html

How do I achieve this? I’m not getting the same results as the person in the first link below.

Here’s the tree structure:

.
├── archetypes
│   └── default.md
├── config.toml
├── content
│   ├── about.md
│   ├── post
│   │   └── test.md
│   └── project
│       ├── a.md
│       └── project.md
├── data
├── layouts
│   └── about
│       └── about.html
├── static
│   └── css
│       └── main.css
├── tags
└── themes
    └── minimal
        ├── archetypes
        │   ├── default.md
        │   ├── post.md
        │   └── project.md
        ├── exampleSite
        │   ├── config.toml
        │   └── content
        │       ├── post
        │       │   ├── creating-a-new-theme.md
        │       │   ├── goisforlovers.md
        │       │   ├── hugoisforlovers.md
        │       │   └── migrate-from-jekyll.md
        │       └── project
        │           ├── project1.md
        │           ├── project2.md
        │           ├── project3.md
        │           └── project4.md
        ├── images
        │   ├── screenshot.png
        │   └── tn.png
        ├── layouts
        │   ├── 404.html
        │   ├── _default
        │   │   ├── list.html
        │   │   ├── single.html
        │   │   └── terms.html
        │   ├── index.html
        │   └── partials
        │       ├── body-open.html
        │       ├── css.html
        │       ├── footer.html
        │       ├── header.html
        │       ├── head-open.html
        │       ├── js.html
        │       ├── list-item.html
        │       └── paginator.html
        ├── LICENSE.md
        ├── README.md
        ├── static
        │   └── css
        │       └── main.css
        └── theme.toml

Here’s the site:
romanscollins.net/

This is relevant:

Maybe try making a layouts/_default/single.html which those should pick up, I think.

Indeed, but doesn’t that imply it should use layouts/_default/single.html if I don’t set any type in content/about.md?

It does.

Bummer … :rofl:

I even tried testing this (although, that shouldn’t be necessary):

cp -r themes/minimal/layout/_default layouts/. 

And rebuilding.

I appreciate the help.

Well since it’s definitely not the web server, 404 must mean that the build step is not able to generate anything to display because the layout is not applying during the build process? Resulting in the content being missing…

Thank you.

I’m firing it up on my system. Let me take a look.

1 Like

Try:

---
title: "About"
date: 2018-06-29T06:19:29Z
---

I'm a budding technologist, ...

Hmm,

I tested again with layouts/ containing the same as themes/minimal/layouts when I fired it up locally and get 404 Not Found as well, unfortunately. Tried emptying the root directory’s layouts dir and still 404 Not Found with your suggestion pasted in.

I must’ve had an older version in the git repo with a different format? but it should be the same as your suggestion now and I can confirm the 404 error is still there.

I can’t see anything reading the files or the directory structure that could be interfering with loading from themes/minimal/layouts/_default/single.html

This is in config.toml, however:

[[menu.main]]
url = “/about.md”
name = “About”
weight = 2

All I did was clone your repo, run:

 hugo server --navigateToChanged --buildDrafts --buildFuture --watch --verbose

… and remove the stuff from the about.md frontmatter. After that, the 404 changed to showing the content just fine, because it was picking up the single from the theme.

~/d/romanscblog ❯ hugo env  
Hugo Static Site Generator v0.43-DEV-DE37455E darwin/amd64 BuildDate: 2018-06-29T06:48:38+0900
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.10.3"
$ hugo server --navigateToChanged --buildDrafts --buildFuture --watch --verbose                                                                                                                                      /home/roman/blog %r 
WARN 2018/06/29 04:29:49 No translation bundle found for default language "en"
WARN 2018/06/29 04:29:49 Translation func for language en not found, use default.
WARN 2018/06/29 04:29:49 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
INFO 2018/06/29 04:29:49 Using config file: /home/roman/blog/config.toml
Building sites … INFO 2018/06/29 04:29:49 syncing static files to /
INFO 2018/06/29 04:29:49 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
INFO 2018/06/29 04:29:49 Alias "/categories/page/1/index.html" translated to "categories/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/post/page/1/index.html" translated to "post/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/categories/hello-world/page/1/index.html" translated to "categories/hello-world/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/project/page/1/index.html" translated to "project/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/tags/syntax/page/1/index.html" translated to "tags/syntax/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/tags/page/1/index.html" translated to "tags/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/categories/syntax/page/1/index.html" translated to "categories/syntax/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/tags/tests/page/1/index.html" translated to "tags/tests/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/tags/test/page/1/index.html" translated to "tags/test/page/1/index.html"
INFO 2018/06/29 04:29:49 Alias "/categories/tests/page/1/index.html" translated to "categories/tests/page/1/index.html"

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

Total in 14 ms
Watching for changes in /home/roman/blog/{content,data,layouts,static,themes}
Watching for config changes in /home/roman/blog/config.toml
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
$ curl localhost:1313/about.md ; hugo env
404 page not found
Hugo Static Site Generator v0.42.1 linux/amd64 BuildDate: 2018-06-13T20:49:30+0200
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.10.3"

:confused: I highly doubt it could be the version, and wouldn’t want to add complexity to my setup by building from source and having to manage my updates that way. But maybe I’m wrong

I compiled mine just after 42.2 was released fwiw.

Did you remove those two lines from the about.md?

Ah, I was able to come up with a work around using front matter:

---
# goes in front matter of about.md
menu: "Main"
weight: 2
---

See docs here:

Thank you for your time and suggestions, anway

Just noticed. This url param is pointing at a markdown content file. The md is not needed.
You can put the menu in either the config.toml or in the content file frontmatter. If you don’t specify url it will take the default.