# Cannot build a markdown file, possible hugo server drama

**URL:** <https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081>\
**Category:** support\
**Created:** [October 23, 2024, 5:44am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081 "2024-10-23T05:44:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MW2K](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mw2k/32/23169_2.png) [@MW2K](https://discourse.gohugo.io/u/MW2K)\
**Post date:** [October 23, 2024, 5:44am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/1 "2024-10-23T05:44:18Z")

</div>

My site is [here](https://github.com/MW2K/hugo) and the file in question is site.md. When I edit and save this file in VS Code, the hugo server does nothing. In fact, I don’t even know if it’s running. Normally when I do `hugo server` the output in the terminal is:

`Built in 28 ms Environment: "development" Serving pages from disk 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`

Now, when I do the same command, I get:

`PS D:\Websites\new-site> hugo server Watching for changes in D:\Websites\new-site\{archetypes,assets,content,data,i18n,layouts,static,themes} Watching for config changes in D:\Websites\new-site\hugo.toml, D:\Websites\new-site\themes\lugo\hugo.toml Start building sites … hugo v0.136.2-ad985550a4faff6bc40ce4c88b11215a9330a74e+extended windows/amd64 BuildDate=2024-10-17T14:30:05Z VendorInfo=gohugoio`

As you can see, this is a different message and in fact, my browser times out if I try localhost:1313. I followed another post here and rebound it to my internal IP and set the baseURL to the same IP (192.168.20.8) and allowed it to work on Windows’ firewall app but it still times out.

I’ve restarted both my computer and VS code repeatedly, still getting the same message.

Where have I messed up here?

Edit: hugo is apparently and running.

`TCP 127.0.0.1:1313 victoria:0 LISTENING [hugo.exe]`

---

<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:** [October 23, 2024, 7:03am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/2 "2024-10-23T07:03:51Z")

</div>

Your `listpages` shortcode is recursive

first time rendered when your `site.md` is generated

- the shortcode calls: `.Site.RegularPages` which includes `site.md`
  - which calls `listpages`
    - which renders `site.md`…

---

<div class="post-metadata">

**Author:** ![MW2K](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mw2k/32/23169_2.png) [@MW2K](https://discourse.gohugo.io/u/MW2K)\
**Post date:** [October 23, 2024, 7:20am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/3 "2024-10-23T07:20:21Z")

</div>

Alright. I’m not 100% certain how to exclude a file from the indexing, i.e site.md. If it’s recursive, then I need to exclude it obviously, but I’m lost in the documentation on how that is done.

Secondly, why is the server message different all of a sudden? Even though it’s listening on port 1313, it’s doing nothing, making no changes and me trying to access localhost:1313 times out.

---

<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:** [October 23, 2024, 8:28am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/4 "2024-10-23T08:28:37Z")

</div>

> [@MW2K](#):
>
> to exclude a file from the indexing,

with your site layout you could move `content/site.md` to `content/site/_index.md`.  
It then is a list page and not captured by .RegularPages

Update: usually one would use a special layout instead of your shortcode.

read about `Content Organization`, `Page Bundels` `Templates`and `Template lookup order`

**hint** : it looks like (your) RSS handling also generates a site.html ??? RSS is not my topic, so I disabled it for my test in hugo.toml `disableKinds = ['RSS']`.

> [@MW2K](#):
>
> Even though it’s listening on port 1313

If you don’t get the message

> Web Server is available at [http://localhost:1313/](http://localhost:1313/) (bind address 127.0.0.1)  
> Press Ctrl+C to stop

hugo is still processing something

guess the port is bound at the beginning but no handler set up to handle requests

---

<div class="post-metadata">

**Author:** ![MW2K](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mw2k/32/23169_2.png) [@MW2K](https://discourse.gohugo.io/u/MW2K)\
**Post date:** [October 23, 2024, 9:13am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/5 "2024-10-23T09:13:53Z")

</div>

Thanks for that. I do need to bone up on page organisation - I’m slowly getting the hang of this app - I’ve been following along with a YouTube video [https://www.youtube.com/watch?v=QTolhoxMyXg](https://www.youtube.com/watch?v=QTolhoxMyXg)  
but it seems like the Hugo that existed in 2022 doesn’t exist today, as when I imitate what the guy does, I get errors like I’ve mentioned. I guess there’s a lot of deprecated and/or altered attributes etc.

---

<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:** [October 23, 2024, 11:10am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/6 "2024-10-23T11:10:36Z")

</div>

just checked the RSS:

When you enable the RSS , a xml feed is generated. You use a frontmatter param to set the URL.

It looks like if the `url` is set to “something.html”, the RSS and the PAGE get this name - dunno if this is a real bug or just an edge case depending on your content structure.

If I remove that value from frontmatter of `site/_index.md` two files are generated (`index.html` and `index.xml` in `public/site/`

> without changing your site structure too much you could:

- keep the site.md in your content root folder

- remove the `url` frontmatter value from all your `*.md`

- set `uglyURLs`= true in `hugo.toml` (see uglyURLs in the docs)

- change your shortcode (line 2 skips the site page)

- you may want to exclude the site page from the RSS template

looks like that generates the same structure as before, if your md files are named same as your former url parameter.

> **Summary**
>
> ```plaintext
> \TOPIC-52801\NEW-SITE\PUBLIC
> │ 404.html
> │ about.html
> │ categories.html
> │ gfprelude.html
> │ imwriting.html
> │ index.html
> │ index.xml
> │ me-lifesketch.jpg
> │ nia-cover.jpg
> │ onmymind.html
> │ rss.svg
> │ site.html
> │ sitemap.xml
> │ style.css
> │ tags.html
> │
> ├───categories
> │ index.xml
> │
> └───tags
> │ fels.html
> │ fiction.html
> │ index.xml
> │ novels.html
> │ shortstories.html
> │ writing.html
> │
> ├───fels
> │ index.xml
> │
> ├───fiction
> │ index.xml
> │
> ├───novels
> │ index.xml
> │
> ├───shortstories
> │ index.xml
> │
> └───writing
> index.xml
> 
> ```

---

<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:** [October 25, 2024, 11:11am UTC](https://discourse.gohugo.io/t/cannot-build-a-markdown-file-possible-hugo-server-drama/52081/7 "2024-10-25T11:11:32Z")

</div>

Closed on October 25, 2024, 11:11am UTC

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