2023-08-16 17:33:39 +01:00
---
title: Getting Started
weight: 1
2023-08-20 19:20:24 +01:00
next: /docs/guide
2023-08-22 00:48:44 +01:00
prev: /docs
2023-08-16 17:33:39 +01:00
---
2023-08-26 15:36:46 +01:00
## Quick Start from Template
{{< icon " github " > }} [imfing/hextra-starter-template ](https://github.com/imfing/hextra-starter-template )
You will be able to quickly get started by using the above template repository.
< img src = "https://docs.github.com/assets/cb-77734/mw-1440/images/help/repository/use-this-template-button.webp" width = "500" >
We have provided a [GitHub Actions workflow ](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow ) which can help automatically build and deploy your site to GitHub Pages, and host it for free.
[🌐 Demo ↗ ](https://imfing.github.io/hextra-starter-template/ )
2023-08-16 17:33:39 +01:00
## Start as New Project
2023-08-19 13:42:59 +01:00
### Prerequisites
Before we start, make sure we have [Hugo ](https://gohugo.io/ ) installed.
2023-08-16 17:33:39 +01:00
Please refer to Hugo's [official installation guide ](https://gohugo.io/installation/ ) for more details.
2023-08-19 13:42:59 +01:00
[Hugo modules ](https://gohugo.io/hugo-modules/ ) are the recommended way to manage Hugo themes. To use Hugo modules, we need to install [Git ](https://git-scm.com/ ) and [Go ](https://go.dev/ ).
2023-08-16 17:33:39 +01:00
{{% steps %}}
### Initialize a new Hugo site
```bash
$ hugo new site my-site --format=yaml
```
2023-08-19 13:42:59 +01:00
### Configure Hextra theme via module
2023-08-16 17:33:39 +01:00
```shell
# initialize hugo module
$ cd my-site
$ hugo mod init github.com/username/my-site
# add Hextra theme
$ hugo mod get github.com/imfing/hextra
```
2023-08-19 13:42:59 +01:00
Edit `hugo.yaml` to enable Hextra theme:
2023-08-16 17:33:39 +01:00
```yaml
module:
imports:
- path: github.com/imfing/hextra
```
2023-08-19 13:42:59 +01:00
### Create your first content pages
Let's create a new content page for the home page and the documentation page:
```shell
$ hugo new content/_index.md
$ hugo new content/docs/_index.md
```
### Preview the site locally
2023-08-16 17:33:39 +01:00
```shell
2023-08-19 13:42:59 +01:00
$ hugo server
2023-08-16 17:33:39 +01:00
```
Voila! You can see your new site at `http://localhost:1313/` .
{{% /steps %}}
2023-08-19 13:42:59 +01:00
## Next
Explore the following sections to start adding more contents:
{{< cards > }}
2023-08-26 15:01:06 +01:00
{{< card link = "../guide/organize-files" title = "Organize Files" icon = "document-duplicate" > }}
{{< card link = "../guide/configuration" title = "Configuration" icon = "adjustments" > }}
{{< card link = "../guide/markdown" title = "Markdown" icon = "markdown" > }}
2023-08-19 13:42:59 +01:00
{{< / cards > }}