tea
October 11, 2019, 3:36pm
1
I have installed Hugo.
I checked it with
$ hugo version
Hugo Static Site Generator v0.58.3/extended darwin/amd64 BuildDate: unknown
So it is installed.
I added index.html code to layouts
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS"
crossorigin="anonymous">
<title>{{ .Title }}</title>
</head>
<body>
<div class="container">
<main id="main">
<div id="home-jumbotron" class="jumbotron text-center">
<h1>{{ .Title }}</h1>
<p class="font-125">{{ .Site.Params.homeText | markdownify }}</p>
</div>
</main>
</div>
</body>
</html>
and added this code to config.toml
baseURL = "http://example.org/"
languageCode = "en-us"
title = "New site"
disableKinds = ["taxonomy", "taxonomyTerm"]
[params]
homeText = "You just made a Hugo blog from scratch."
When I run hugo server I am getting this error:
found no layout file for âHTMLâ for âhomeâ: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
I donât know why, Iâm new to Hugo and I do need advice.
Thanks!
Check out this tutorial here: Hugo 101: Slowstart for beginners
That should solve your issue(s).
tea
October 11, 2019, 4:38pm
3
Hmm I saw it but didnât I do the same. I have read some more explanations but it seems same as I did.
zwbetz
October 11, 2019, 6:25pm
4
Do you have a home template? Such as:
layouts/index.html
maiki
October 11, 2019, 10:39pm
5
Incorrect. You missed the step for adding a template to render the home page. Start over, and follow the directions.
1 Like
tea
October 12, 2019, 2:45pm
7
For home if you mean content/_index.md
I do have it.
Here is my folder structure:
Maybe I donât have right structure.
_nm
October 12, 2019, 5:33pm
8
Here are a couple things that might help:
Make sure that you are in the project root directory when you run hugo
or hugo server
.
The first file found in the following home page lookup order is the layout file that is used. These paths are relative to the project root directory.
layouts/index.html.html
themes/themename/index.html.html
layouts/home.html.html
themes/themename/home.html.html
layouts/list.html.html
themes/themename/list.html.html
layouts/index.html
themes/themename/index.html
layouts/home.html
themes/themename/home.html
layouts/list.html
themes/themename/list.html
layouts/_default/index.html.html
themes/themename/_default/index.html.html
layouts/_default/home.html.html
themes/themename/_default/home.html.html
layouts/_default/list.html.html
themes/themename/_default/list.html.html
layouts/_default/index.html
themes/themename/_default/index.html
layouts/_default/home.html
themes/themename/_default/home.html
layouts/_default/list.html
themes/themename/_default/list.html
I actually prefer to use 21 (layouts/_default/home.html
) and thatâs what I use in TGIH: Themeless & Gitless Introduction to Hugo â maybe this tutorial will help youâŚ