Skip to content

Commit

Permalink
docs: finish chapter 1 #567
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Sep 23, 2024
1 parent 793c837 commit 41e25dc
Show file tree
Hide file tree
Showing 15 changed files with 149 additions and 182 deletions.
2 changes: 1 addition & 1 deletion archetypes/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title = "{{ replace .Name "-" " " | title }}"
type = "home"
+++

This is a new home page.
This is your new home page.
2 changes: 1 addition & 1 deletion exampleSite/content/basics/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ type = "chapter"
weight = 1
+++

Discover what this Hugo theme is all about and the core-concepts behind it.
Discover what this Hugo theme is all about.
2 changes: 1 addition & 1 deletion exampleSite/content/basics/changelog/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ alwaysopen = false
disableToc = false
title = "Changelog"
type = "changelog"
weight = 4
weight = 3
+++

{{% pages showdivider="true" showhidden="true" hidevisible="true" showtitle="true" %}}
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/basics/changelog/_index.pir.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ alwaysopen = false
disableToc = false
title = "Changelog"
type = "changelog"
weight = 4
weight = 3
+++
{{< piratify >}}
149 changes: 0 additions & 149 deletions exampleSite/content/basics/installation/_index.en.md

This file was deleted.

6 changes: 0 additions & 6 deletions exampleSite/content/basics/installation/_index.pir.md

This file was deleted.

136 changes: 136 additions & 0 deletions exampleSite/content/basics/quickstart/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
+++
title = "Getting Started"
weight = 1
+++

With following steps you are initializing your new website. If you don't know Hugo, we strongly suggest you learn more about it in Hugo's great [documentation for starters](https://gohugo.io/getting-started/).

## Install Hugo

Install Hugo {{% badge color="fuchsia" icon="fa-fw fab fa-hackerrank" title=" " %}}0.126.0{{% /badge %}} or higher for your OS [according to the documentation](https://gohugo.io/installation/).

## Create your Project

Hugo provides the `new site` command to create a new website

````shell
hugo new site my-new-site
````

After that change into the directory

````shell
cd my-new-site
````

Every upcoming command will be executed from inside this directory.

## Install the Theme

### Downloading as Archive

You can [download the theme as .zip archive](https://github.com/McShelby/hugo-theme-relearn/archive/main.zip) and extract its content into the `themes/hugo-theme-relearn` directory.

Afterwards add this at the top of your `hugo.toml`

{{< multiconfig file=hugo >}}
theme = "hugo-theme-relearn"
{{< /multiconfig >}}

### Using with Hugo's Module System

You can install the Relearn theme following [the official documentation](https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme) using Hugo's module system

````shell
hugo mod init example.com
````

Afterwards add this at the end of your `hugo.toml`

{{< multiconfig file=hugo >}}
[module]
[[module.imports]]
path = 'github.com/McShelby/hugo-theme-relearn'
{{< /multiconfig >}}

### Using as Git Submodule

If you plan to store your project in a [Git](https://git-scm.com/) repository you can create one now with

````shell
git init
````

Now you can add the theme as a Git submodule by

````shell
git submodule add --depth 1 https://github.com/McShelby/hugo-theme-relearn.git themes/hugo-theme-relearn
````

Afterwards add this at the top of your `hugo.toml`

{{< multiconfig file=hugo >}}
theme = "hugo-theme-relearn"
{{< /multiconfig >}}

## Create your Home Page

Start your journey by creating a home page

````shell
hugo new --kind home _index.md
````

The newly created home page file `content/_index.md` is structured in two parts, the meta information of this page like the `title`, called [front matter](https://gohugo.io/content-management/front-matter/) and the text of the page itself.

## Create your First Chapter Page

Chapters are meant to be top level pages that contain other child pages. They have a special layout.

Create your first chapter page

````shell
hugo new --kind chapter basics/_index.md
````

The newly created file `content/basics/_index.md`, contains the `weight` front matter set to a number. This will be used to generate the subtitle of that chapter page, and for ordering your chapters in the menu.

## Create your First Content Pages

Now create content pages inside the previously created chapter. Here are three ways to create content in the chapter

````shell
hugo new basics/first-content/_index.md
hugo new basics/second-content/index.md
hugo new basics/third-content.md
````

Due to their file name, all three files are handled a bit differently by Hugo. You can read more about that in [Hugo's documentation](https://gohugo.io/content-management/).

Feel free to edit those files by replacing the `title` or adding an optional `weight` value in the front matter and changing the text to your liking.

## Test your Website Locally

Launch your new web site locally by using the following command

````shell
hugo serve
````

Go to [`http://localhost:1313`](http://localhost:1313) in your browser.

You can leave the web server running while editing your pages. The browser will reload automatically every time you save your files.

{{% figure src="magic.gif" link="https://gohugo.io" alt="Magic" caption="It's a kind of magic" %}}

## Build and Deploy your Website

When your site is ready to be deployed, run the following command:

````shell
hugo
````

A `public` directory will be generated, containing all content and assets for your web site.

It now can be deployed to any web server by simply uploading its contents or you can check out one of [Hugo's many other deployment options](https://gohugo.io/hosting-and-deployment/).
5 changes: 5 additions & 0 deletions exampleSite/content/basics/quickstart/_index.pir.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Gettin' started"
weight = 1
+++
{{< piratify >}}
2 changes: 1 addition & 1 deletion exampleSite/content/basics/releasenotes/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ alwaysopen = false
disableToc = false
title = "What's New"
type = "releasenotes"
weight = 3
weight = 2
+++

{{% pages showdivider="true" showhidden="true" hidevisible="true" showtitle="true" %}}
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/basics/releasenotes/_index.pir.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ alwaysopen = false
disableToc = false
title = "What's New"
type = "releasenotes"
weight = 3
weight = 2
+++
{{< piratify true >}}
12 changes: 0 additions & 12 deletions exampleSite/content/basics/requirements/_index.en.md

This file was deleted.

7 changes: 0 additions & 7 deletions exampleSite/content/basics/requirements/_index.pir.md

This file was deleted.

2 changes: 1 addition & 1 deletion exampleSite/content/configuration/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ type = "chapter"
weight = 2
+++

Find out how to configure and customize the site to your liking.
Find out how to configure and customize your site.
2 changes: 1 addition & 1 deletion exampleSite/content/content/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ type = "chapter"
weight = 3
+++

Find out how to create and organize your pages quickly and intuitively.
Learn how to create and organize your content pages.

0 comments on commit 41e25dc

Please sign in to comment.