# Yet another: What is going on with my relationship of /content to /templating

**URL:** <https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278>\
**Category:** Uncategorized\
**Created:** [June 15, 2020, 11:49am UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278 "2020-06-15T11:49:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxisme](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maxisme/32/13141_2.png) [@maxisme](https://discourse.gohugo.io/u/maxisme)\
**Post date:** [June 15, 2020, 11:49am UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/1 "2020-06-15T11:49:21Z")

</div>

I currently have the structure:

```auto
/content/index.md
/content/blog/_index.md
/content/blog/test-blog.md
/layouts/_default/list.html
/layouts/_default/single.html
/layouts/_default/blog/single.html
/layouts/_default/blog/list.html

```

[http://localhost:1313/](http://localhost:1313/) works exactly as expected (`/content/index.md` data is put into `/layouts/_default/single.html` although if I rename this file to `/layouts/index.html` it doesn’t work as expected).

However [http://localhost:1313/blog/test-blog/](http://localhost:1313/blog/test-blog/) does not.

I am not sure if this is a bug but if I run `hugo server` and then add or delete `/content/blog/_index.md` I don’t get a 404 at `http://localhost:1313/blog/test-blog/` or `http://localhost:1313/blog/`.  
BUT if I restart and don’t edit or delete the `_index.md` I get a 404…

Anyway even at `http://localhost:1313/blog/test-blog/` (when it kinda works) It uses the `/layouts/_default/single.html` template **not** the `/layouts/_default/blog/single.html` template - it also doesn’t have any content but that is as expected as there isn’t the corresponding data that is in `/content/index.md`.

What is going on? Thanks in advance 🙂

* * *

config.toml:

```auto
baseURL = "http://example.org/"
languageCode = "en-gb"
title = "My New Hugo Site"
[sitemap]
  changefreq = "monthly"
  filename = "sitemap.xml"
  priority = 0.5

```

`test-blog.md`:

```auto
+++
title = "Test Blog"

+++

```

`/layouts/_default/blog/single.html`:

```auto
it works!!! {{ .Params.title }}

```

`/layouts/_default/single.html`:

```auto
it has unfortunately used this template!!! {{ .Params.title }}

```

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [June 15, 2020, 5:51pm UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/2 "2020-06-15T17:51:09Z")

</div>

**/layouts/\_default/blog/single.html** and **/layouts/\_default/blog/list.html**

should be under **/layouts/blog/**

> **[Hugo's Lookup Order](https://gohugo.io/templates/lookup-order/)**
>
> Hugo searches for the layout to use for a given page in a well defined order, starting from the most specific.

---

<div class="post-metadata">

**Author:** ![maxisme](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maxisme/32/13141_2.png) [@maxisme](https://discourse.gohugo.io/u/maxisme)\
**Post date:** [June 15, 2020, 8:06pm UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/3 "2020-06-15T20:06:15Z")

</div>

How do you mean under sorry?

---

<div class="post-metadata">

**Author:** ![maxisme](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maxisme/32/13141_2.png) [@maxisme](https://discourse.gohugo.io/u/maxisme)\
**Post date:** [June 15, 2020, 8:08pm UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/4 "2020-06-15T20:08:16Z")

</div>

I have moved **/layouts/\_default/blog/single.html** to **/layouts/blog/single.html** and now it finds the write template but I am still having the 404 issue where I have to change the `/content/blog/_index.md` file

---

<div class="post-metadata">

**Author:** ![maxisme](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maxisme/32/13141_2.png) [@maxisme](https://discourse.gohugo.io/u/maxisme)\
**Post date:** [June 15, 2020, 8:18pm UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/5 "2020-06-15T20:18:14Z")

</div>

Here is an example of [https://streamable.com/np38tm](https://streamable.com/np38tm) what I mean. I turn the server on - 404, undelete the `_index.md` no more 404, turn the server on and off - 404, delete the `_index.md` no more 404. What is going on?

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [June 16, 2020, 11:02am UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/6 "2020-06-16T11:02:13Z")

</div>

can you give us a (sample) repository for help?

Check how the permalinks for the blog section are defined (in your config file).  
Let hugo render all to the public directory and check out the files.

---

<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:** [June 18, 2020, 11:02am UTC](https://discourse.gohugo.io/t/yet-another-what-is-going-on-with-my-relationship-of-content-to-templating/26278/7 "2020-06-18T11:02:17Z")

</div>

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