2021-08-25 11:33:29 +00:00
+++
title = "Installation"
weight = 15
+++
2017-08-16 22:57:44 +00:00
2018-05-27 22:40:01 +00:00
The following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you learn more about it by following this [great documentation for beginners ](https://gohugo.io/overview/quickstart/ ).
2017-08-16 22:57:44 +00:00
## Create your project
Hugo provides a `new` command to create a new website.
2021-10-08 17:18:05 +00:00
```
2017-08-16 22:57:44 +00:00
hugo new site < new_project >
```
## Install the theme
2021-09-11 13:46:14 +00:00
Install the Relearn theme by following [this documentation ](https://gohugo.io/getting-started/quick-start/#step-3-add-a-theme )
2017-08-16 22:57:44 +00:00
2021-06-30 12:56:06 +00:00
This theme's repository is: https://github.com/McShelby/hugo-theme-relearn.git
2017-08-16 22:57:44 +00:00
2021-07-01 09:01:51 +00:00
Alternatively, you can [download the theme as .zip ](https://github.com/McShelby/hugo-theme-relearn/archive/main.zip ) file and extract it in the `themes` directory
2017-08-16 22:57:44 +00:00
## Basic configuration
2018-05-27 22:40:01 +00:00
When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (`config.toml`) and set the theme as the default. You can also add the `[outputs]` section to enable the search functionality.
2017-08-16 22:57:44 +00:00
```toml
# Change the default theme to be use when building the site with Hugo
2021-06-30 12:56:06 +00:00
theme = "hugo-theme-relearn"
2017-08-16 22:57:44 +00:00
2018-05-27 22:40:01 +00:00
# For search functionality
2017-08-16 22:57:44 +00:00
[outputs]
home = [ "HTML", "RSS", "JSON"]
```
## Create your first chapter page
2018-05-27 22:40:01 +00:00
Chapters are pages that contain other child pages. It has a special layout style and usually just contains a _chapter name_ , the _title_ and a _brief abstract_ of the section.
2017-08-16 22:57:44 +00:00
2021-08-23 21:32:34 +00:00
```markdown
2017-08-16 22:57:44 +00:00
### Chapter 1
# Basics
2021-08-23 22:46:53 +00:00
Discover what this Hugo theme is all about and the core concepts behind it.
2017-08-16 22:57:44 +00:00
```
2021-08-23 21:51:52 +00:00
renders as
2017-08-16 22:57:44 +00:00
2022-07-14 16:28:56 +00:00
![A Chapter ](chapter.png?classes=shadow&width=60pc )
2017-08-16 22:57:44 +00:00
2021-09-11 13:46:14 +00:00
The Relearn theme provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
2017-08-16 22:57:44 +00:00
2021-08-23 21:32:34 +00:00
```shell
2017-08-16 22:57:44 +00:00
hugo new --kind chapter basics/_index.md
```
By opening the given file, you should see the property `chapter=true` on top, meaning this page is a _chapter_ .
2018-05-27 22:40:01 +00:00
By default all chapters and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata.
2017-09-27 14:39:42 +00:00
2017-08-16 22:57:44 +00:00
## Create your first content pages
2018-05-27 22:40:01 +00:00
Then, create content pages inside the previously created chapter. Here are two ways to create content in the chapter:
2017-08-16 22:57:44 +00:00
2021-08-23 21:32:34 +00:00
```shell
2017-08-16 22:57:44 +00:00
hugo new basics/first-content.md
hugo new basics/second-content/_index.md
```
2021-08-23 21:51:52 +00:00
Feel free to edit those files by adding some sample content and replacing the `title` value in the beginning of the files.
2017-08-16 22:57:44 +00:00
## Launching the website locally
2018-05-27 22:40:01 +00:00
Launch by using the following command:
2017-08-16 22:57:44 +00:00
2021-08-23 21:32:34 +00:00
```shell
2017-08-16 22:57:44 +00:00
hugo serve
```
Go to `http://localhost:1313`
You should notice three things:
2018-05-27 22:40:01 +00:00
1. You have a left-side **Basics** menu, containing two submenus with names equal to the `title` properties in the previously created files.
2. The home page explains how to customize it by following the instructions.
3. When you run `hugo serve` , when the contents of the files change, the page automatically refreshes with the changes. Neat!
2017-08-16 22:57:44 +00:00
## Build the website
2018-05-27 22:40:01 +00:00
When your site is ready to deploy, run the following command:
2017-08-16 22:57:44 +00:00
2021-08-23 21:32:34 +00:00
```shell
2017-08-16 22:57:44 +00:00
hugo
```
2018-05-27 22:40:01 +00:00
A `public` folder will be generated, containing all static content and assets for your website. It can now be deployed on any web server.
2017-08-16 22:57:44 +00:00
{{% notice note %}}
2021-09-11 13:46:14 +00:00
This website can be automatically published and hosted with [Netlify ](https://www.netlify.com/ ) (Read more about [Automated HUGO deployments with Netlify ](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/ )). Alternatively, you can use [GitHub pages ](https://gohugo.io/hosting-and-deployment/hosting-on-github/ )
2017-09-27 14:39:42 +00:00
{{% /notice %}}