# How to render raw .html page?

**URL:** <https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026>\
**Category:** support\
**Created:** [January 6, 2025, 2:09pm UTC](https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026 "2025-01-06T14:09:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodede](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nodede](https://discourse.gohugo.io/u/nodede)\
**Post date:** [January 6, 2025, 2:09pm UTC](https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026/1 "2025-01-06T14:09:56Z")

</div>

Hi,

I have a page with the following structure:

```auto
content/folder/index.html

```

The `index.html` page contains no front matter (starts and ends with `<html>` tags) and used to be rendered completely by itself by Hugo, without pulling any templates from anywhere. It could be accessed by going to /folder/ on the rendered site.

I recently upgraded from Hugo 0.85.0 to 0.134.3 and the pages are no longer rendered from the raw html. Instead, the entire `index.html` file is treated as `main` in some kind of a larger template.

I also have some pages with the following structure:

```auto
content/
├── folder/
│ ├── _index.md
│ ├── subfolder1/
│ │ └── index.html
│ └── subfolder2/
│ │ └── index.html

```

Before I upgraded Hugo, the index.html pages in `subfolder1` and `subfolder2` would also get rendered completely on their own and fully custom css and html. But after the upgrade, they don’t get rendered at all, with Hugo throwing 404 error when I try to navigate to `folder/subfolder1/` or `folder/subfolder2/` in my browser.

I’m not sure what happened after I upgraded Hugo. Would appreciate any help here. Thank you!

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [January 6, 2025, 2:16pm UTC](https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026/2 "2025-01-06T14:16:41Z")

</div>

have a look at these

> [@Some HTML files get lost, how to force them?](https://discourse.gohugo.io/t/some-html-files-get-lost-how-to-force-them/52724):
>
> Recently I found some html files are not lendered by hugo, like above. Of course the html files in static are copied but I want to lender all html files in normal content folders when I use iframe tag. For now I avoid these by ‘renaming’: ① just save example.html as example.fig, ② \<iframe scr="example.fig"\> ③ It works, but unhappy sob… I’m using hugo v0.136.0 and I know there is no flag exactly same to --forceSyncStatic, but I believe there are other approach, for example, hugo.toml. Is it…

> [@Page resources with a ResourceType of "page" are not published](https://discourse.gohugo.io/t/page-resources-with-a-resourcetype-of-page-are-not-published/52827):
>
> Hi there, haven’t been able to find a solution to this issue in the forum. I follow the Quick Start guide ([Quick start | Hugo](https://gohugo.io/getting-started/quick-start/)) to create an example of my issue. hugo new site quickstart cd quickstart git init git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke echo "theme = 'ananke'" \>\> hugo.toml hugo server Then added: content/index.md: --- {{% resref test.md %}} content/test.md: my test layouts/shortcodes/resref.html: {{ .Page }} {{ $resource := .…

---

<div class="post-metadata">

**Author:** ![nodede](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nodede](https://discourse.gohugo.io/u/nodede)\
**Post date:** [January 6, 2025, 2:52pm UTC](https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026/3 "2025-01-06T14:52:27Z")

</div>

Thank you! This does seem to be the issue.

I tried following one of the instructions and adding

```auto
{{ range .Resources.Match "**.html" }}
  {{ $publishPath := urls.JoinPath $.RelPermalink .Name }}
  {{ (.Content | resources.FromString $publishPath).Publish }}
{{ end }}

```

Either to the front or to the end of `layouts/_default/single.html` but it doesn’t seem to change anything. The .html files are still not rendered…

Right now it seems like moving these pages into /static/ folder is the only solution. However, it has an unfortunate side-effect of breaking the links, since now the pages have to all be accessed by their full file names, rather being able to rely on folder URL pulling the index.html automatically…

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [January 6, 2025, 6:00pm UTC](https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026/4 "2025-01-06T18:00:00Z")

</div>

mmh,

rethinking - the mentioned problem a little different. it talks about resources not published.

In your case you just have a page not a resource  
Keep in mind that index.\* is special for hugo as it identifies a page which may have resources.

i dunno if one should do something like that …

this works for me with your structure shown above

- list template

- single template

ofc if you want to link by the title tag, without frontmatter you will have to scan the content.

maybe your file structure is incomplete but it’s worth a try

---

<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:** [January 12, 2025, 7:39pm UTC](https://discourse.gohugo.io/t/how-to-render-raw-html-page/53026/5 "2025-01-12T19:39:37Z")

</div>

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