Browse Source

initial version

master
Nicolas Massé 7 years ago
commit
762fe671d0
  1. 3
      .gitmodules
  2. 6
      archetypes/default.md
  3. 12
      config.toml
  4. 10
      content/_index.md
  5. 12
      content/create-content/_index.md
  6. 13
      content/create-content/chapter.md
  7. 26
      content/create-content/section.md
  8. 12
      content/packaging/_index.md
  9. 21
      content/packaging/git-commit.md
  10. 36
      content/packaging/look-and-feel.md
  11. 13
      content/packaging/test-locally.md
  12. 12
      content/pre-requisites/_index.md
  13. 22
      content/pre-requisites/bootstrap.md
  14. 13
      content/pre-requisites/install.md
  15. 18
      content/pre-requisites/theme.md
  16. 1
      layouts/partials/logo.html
  17. BIN
      static/images/favicon.png
  18. BIN
      static/logo.png
  19. 1
      themes/learn

3
.gitmodules

@ -0,0 +1,3 @@
[submodule "themes/learn"]
path = themes/learn
url = https://github.com/matcornic/hugo-theme-learn.git

6
archetypes/default.md

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

12
config.toml

@ -0,0 +1,12 @@
baseURL = "/"
languageCode = "en-us"
theme = "learn"
[outputs]
home = [ "HTML", "RSS", "JSON"]
[params]
showVisitedLinks = true
disableBreadcrumb = false
disableNextPrev = false
themeVariant = "red"

10
content/_index.md

@ -0,0 +1,10 @@
---
title: "Hugo Workshop"
---
# Welcome to my Hugo workshop
Welcome! Please have a seat and relax.
In the rest of this training, we will craft a mini-training
about Hugo!

12
content/create-content/_index.md

@ -0,0 +1,12 @@
+++
title = "Create Content"
weight = 2
chapter = true
pre = "<b>2. </b>"
+++
### Chapter 2
# Create Content
In this section, we will create some content for our mini-training.

13
content/create-content/chapter.md

@ -0,0 +1,13 @@
---
title: "Chapter"
weight: 1
---
Use the [built-in learn archetypes](https://learn.netlify.com/en/cont/archetypes/)
to generate your chapters:
```sh
hugo new pre-requisites/_index.md --kind chapter
hugo new create-content/_index.md --kind chapter
hugo new packaging/_index.md --kind chapter
```

26
content/create-content/section.md

@ -0,0 +1,26 @@
---
title: "Section"
weight: 2
---
Use the [built-in Hugo archetypes](https://gohugo.io/content-management/archetypes/)
to generate your sections:
```sh
# Welcome page
hugo new _index.md
# Sections in our "pre-requisites" chapter
hugo new pre-requisites/install.md
hugo new pre-requisites/bootstrap.md
hugo new pre-requisites/theme.md
# Sections in our "create-content" chapter
hugo new create-content/chapter.md
hugo new create-content/section.md
# Sections in our "packaging" chapter
hugo new packaging/look-and-feel.md
hugo new packaging/test-locally.md
hugo new packaging/git-commit.md
```

12
content/packaging/_index.md

@ -0,0 +1,12 @@
+++
title = "Packaging"
weight = 3
chapter = true
pre = "<b>3. </b>"
+++
### Chapter 3
# Packaging
In this chapter we will package our mini-training for publication.

21
content/packaging/git-commit.md

@ -0,0 +1,21 @@
---
title: "Git Commit"
weight: 3
---
By committing your work in a GIT repository, you will be able to collaborate
with your peers for reviews and contributions.
Commit your work:
```sh
git add .
git commit -m 'initial version'
```
And push it on your GitHub account:
```sh
git remote add origin git@github.com:nmasse-itix/hugo-workshop.git
git push -u origin master
```

36
content/packaging/look-and-feel.md

@ -0,0 +1,36 @@
---
title: "Look and Feel"
weight: 1
---
Edit the `config.toml` to match the following content:
```toml
baseURL = "/"
languageCode = "en-us"
theme = "learn"
[outputs]
home = [ "HTML", "RSS", "JSON"]
[params]
showVisitedLinks = true
disableBreadcrumb = false
disableNextPrev = false
themeVariant = "red"
```
This will enable cool features such as the search engine, the navigation, the
breadcrumb and the checkmarks next in the table of content for visited links.
And, the left sidebar is now red!
Customize the logo and favicon with cool branding:
```sh
mkdir -p static/images/
curl https://upload.wikimedia.org/wikipedia/fr/c/cb/Red_hat_logo.png -o static/images/logo.png
mkdir -p layouts/partials
echo '<img src="/images/logo.png" />' > layouts/partials/logo.html
curl "http://www.myiconfinder.com/icon/download/16895e53b6d340dffee1c9b84d90ca94-Redhat.png~10057" -o static/images/favicon.png
```

13
content/packaging/test-locally.md

@ -0,0 +1,13 @@
---
title: "Test Locally"
weight: 2
---
You can test locally your new website by running:
```sh
hugo server -D
```
In your web browser you can now open [localhost:1313](http://localhost:1313)
and admire your work!

12
content/pre-requisites/_index.md

@ -0,0 +1,12 @@
+++
title = "Pre-requisites"
weight = 1
chapter = true
pre = "<b>1. </b>"
+++
### Chapter 1
# Pre-requisites
Complete the pre-requisites before creating any content.

22
content/pre-requisites/bootstrap.md

@ -0,0 +1,22 @@
---
title: "Bootstrap"
weight: 2
---
Bootstrap a Hugo site to hold the documentation of our mini-training.
```raw
$ hugo new site hugo-workshop
Congratulations! Your new Hugo site is created in /Users/nicolas/git/hugo-workshop.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
Choose a theme from https://themes.gohugo.io/, or
create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
```

13
content/pre-requisites/install.md

@ -0,0 +1,13 @@
---
title: "Install"
weight: 1
---
As a prerequisite, we need to install Hugo. On MacOS, you can use brew:
```sh
brew install hugo
```
If you are on another Operating System, check the
[Hugo Documentation](https://gohugo.io/getting-started/quick-start/).

18
content/pre-requisites/theme.md

@ -0,0 +1,18 @@
---
title: "Theme"
weight: 3
---
The [learn theme](https://learn.netlify.com/en/) for Hugo is one of the most
suited design for training instructions. It features breadcrumb, navigation
buttons, table of content in the sidebar, checkmark to know which sections
the participant visited and much more!
Install the learn theme:
```sh
cd hugo-workshop
git init
git submodule add https://github.com/matcornic/hugo-theme-learn.git themes/learn
echo 'theme = "learn"' >> config.toml
```

1
layouts/partials/logo.html

@ -0,0 +1 @@
<img src="/logo.png" />

BIN
static/images/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
static/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

1
themes/learn

@ -0,0 +1 @@
Subproject commit 4fc43548b52be044166cde53845d7f36cdb15ad4
Loading…
Cancel
Save