You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/hugo.md
+63-38
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ group: Guides
3
3
weight: 20
4
4
title: Hugo
5
5
---
6
+
6
7
## Introduction
7
8
8
9
This guide will walk you through how to integrate Decap CMS with Hugo. This is a good place to start if you want to learn from the ground up how these two tools work together. If you want to get up-and-running quicker, you can use one of the pre-existing and amazing [starter templates](/docs/start-with-a-template/)!
**Note:** You won't be able to access the CMS just yet — you still need to deploy the project with **Netlify** and authenticate with **Netlify Identity**. You'll handle this in the next few steps of this guide.
108
109
110
+
### Configuring Netlify Build Settings
111
+
112
+
To ensure consistent builds on Netlify, create a `netlify.toml` configuration file at your project's root with these settings:
113
+
114
+
```toml
115
+
[build]
116
+
command = "hugo"
117
+
publish = "public"
118
+
119
+
[context.production.environment]
120
+
HUGO_VERSION = "0.128.0"
121
+
```
122
+
123
+
This configuration:
124
+
125
+
1. Specifies the exact Hugo version Netlify should use (match this to your local Hugo version)
126
+
2. Defines the build command that generates your site
127
+
3. Sets the publish directory to Hugo's default output folder
128
+
129
+
**Note:** Explicitly setting the Hugo version prevents unexpected build issues from version mismatches between your local environment and Netlify's auto-detected version.
130
+
109
131
### Pushing to GitHub
110
132
111
133
It's now time to commit your changes and push to GitHub. You can run the following commands to initialize a git repository and push the changes so far.
@@ -163,9 +185,7 @@ In your `layouts/index.html` file, you'll create an unordered list element and u
163
185
<ul>
164
186
{{ range (where .Pages "Section" "blog") }}
165
187
<li>
166
-
<ahref="{{ .RelPermalink }}">
167
-
{{ .Title }}
168
-
</a>
188
+
<a href="{{ .RelPermalink }}"> {{ .Title }} </a>
169
189
</li>
170
190
{{ end }}
171
191
</ul>
@@ -191,9 +211,7 @@ Create a file `layouts/blog/single.html`, and put the following content in there
0 commit comments