Cannot build a markdown file, possible hugo server drama

My site is here 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]

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

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.

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 Templatesand 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'].

If you don’t get the message

Web Server is available at 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

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
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.

1 Like

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)

    {{ range (where .Site.RegularPages "Path" "ne" "/site") }}
       <h3>
          <a href="{{ .RelPermalink }}">{{ .Title }}</a>
       </h3>
       {{ .Summary }}
      <br />
       {{ if .Truncated }}
          <a href="{{ .RelPermalink }}">Read more...</a>
       {{ end }}
       <br />
       {{ .WordCount }}
       <hr />
    {{ end }}
    
  • 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
\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
1 Like

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