Search code examples
htmlcsshugobase-urlblogdown

Bad rendering of the local index.html from public folder using HUGO


I am creating a web using RStudio and HUGO, by means of the Blogdown package.

When serving the site locally in RStudio, it seems to be rendered properly. All the files are created within the folder /public.

enter image description here

However, when I open the file index.html from the /public folder, I get this appearance.

enter image description here

I am employing the theme Mainroad with this base URL:

baseurl = "/"

Any idea why when opening the HTML file it is not rendered properly?


Solution

  • Thanks to the HUGO forum, I post the answer that worked for me, just in case somebody get here.

    It is pretty simple, just by adding two lines at the top of the config.toml file:

    relativeURLs = true
    uglyURLs = true