Hugo href links not working - 404 error

Hello dear supporters,

I have a problem. I am newbie.
I have an Index page, and I would like, by clicking to a link, to load another page.

However, I got 404 error. I dont know what I am doing wrong.

in index.html ( nothing else )

<div id="main_body" class="main_body"> 
		<a href="/Statistics.html">About</a>  
	
</div><!-- mainbody closing -->

In Statistics.html ( in partials ) ( nothing else )

 <div id="m_body" class="m_body">
	
Statistics is a science based on probabilities

 </div>

The config.toml file:

baseURL = “https://localhost:1313/
title = “EstatisticEU”
theme = “nofancy”
pygmentsStyle = “native”

languageCode = “en-us”
defaultContentLanguage = “en”
enableRobotsTXT = true

What I must do ?

You need to read Requesting Help and share your code. We need to see all the templates working together to see how it works, and we need to clone and build the site locally to really be helpful.

Also, Statistics.html should probably be in static, for that link to work. And don’t use that https://localhost:1313/ as a baseURL, it will cause problem.

1 Like

Here, is the git… I hope it work well… no md files. I built the site, directly on the partial html code.


Thanks.

What that means ?

Also, Statistics.html should probably be in static

@estatistics your site doesn’t have a content directory. You may be jumping into Hugo without a foundation. Have you done the https://gohugo.io/getting-started/quick-start/ or added content to a Hugo project before?

1 Like

I have found that It can render the webpage (index.html) even without a content directory. I delete it. I want to built directly in html, as I did.

Thanks.

Hello Maiki, Yes, I have created a demo web. However, I am niewbie. I am trying to import into Hugo, my website.
I am trying to learn.

Hello Maiki,
I moved the Statistics.html into static folder. It was successfully loaded its content.
However, I have Hugo code in that file which was not rendered.

How can I load that html file with Hugo code properly, from index.html file?

Thanks.

Everything under static/ folder gets copied, as-is

You can use HTML files as content, though

1 Like

Hello Zwbetz,
Thanks. I am tottally niewby. I downloaded a template and I found that “content” folder probably is needed.

I think thats the case. I need to keep the layout standard, top bars, footer. Left links are changed according to the top menu that is selected. So, the body is “content” according to what link to be clicked either on top menu or on the left link menu.

So, can you post a very primitive and simple example how can I do that?

Because, if possible, I want not to use at all markdown language.

Thanks! :slight_smile:

I found a template that I am playing with… " hugo-theme-techdoc-master ".

Can you provide an example how html content can be used on that template, if it is easier to you? Thanks

Please follow Quick start | Hugo, and read all the docs. I don’t think it will make sense until you grasp those basics. :slight_smile:

2 Likes

2 posts were split to a new topic: Menu entries - 404 page not found