I cannot create an About Me or Contact Page

To create an about me page, I created an “about” folder in the “content” folder and created an “index.md” file in this folder.

To design this page, I created an “about” folder in the “layouts” folder and created “index.html” in this folder.

According to what I read and understand in the documentation, the “index.html” code should work when I enter the about url of my site, but it does not work.

Can you help me if I am doing something wrong somewhere or if I misunderstood the documentation?

Change index.html to single.html.

1 Like

Sorry, it’s still not working.

When I do as you say, when I enter my site address example.com/about/, it gives 404, but when I enter example.com/about/single/, the screen comes up.

I want the screen to work example.com/about/

You can also just put about.html in the content directory.

1 Like

The renaming is for the layout not the content.

1 Like

A single page in the root of the site (a leaf bundle is also a single page) has:

Type = page
Kind = page
Section = 

Which means you cannot place its single page template in a layouts/about/ directory and expect it to work.

https://gohugo.io/templates/lookup-order/#hugo-layouts-lookup-rules

Do this:

+++
title = 'About'
date = 2022-12-08T07:36:59-08:00
draft = false
layout = 'about'
+++

The lookup order will be:

layouts/page/about.html
layouts/page/single.html
layouts/_default/about.html
layouts/_default/single.html
3 Likes

I was referring to the layout, not content.

1 Like

Yes, but I think the original poster misread it and made the change to the content.

P.S. And I misused the reply functionality.

1 Like

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