Hugo href links not working - 404 error

#1

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 ?

#2

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
#3

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


Thanks.

#4

What that means ?

Also, Statistics.html should probably be in static

#5

@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
#6

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.

#7

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.

#8

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.

#9

Everything under static/ folder gets copied, as-is

You can use HTML files as content, though

1 Like
#10

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:

#11

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

#12

Please follow https://gohugo.io/getting-started/quick-start/, and read all the docs. I don’t think it will make sense until you grasp those basics. :slight_smile:

2 Likes