commit 762fe671d048acc0df9bf935cc77c3aff4f578d4 Author: Nicolas MASSE Date: Wed Feb 20 10:00:26 2019 +0100 initial version diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6433a7d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/learn"] + path = themes/learn + url = https://github.com/matcornic/hugo-theme-learn.git diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..1cf0053 --- /dev/null +++ b/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" diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..fc90ca7 --- /dev/null +++ b/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! \ No newline at end of file diff --git a/content/create-content/_index.md b/content/create-content/_index.md new file mode 100644 index 0000000..7a46729 --- /dev/null +++ b/content/create-content/_index.md @@ -0,0 +1,12 @@ ++++ +title = "Create Content" +weight = 2 +chapter = true +pre = "2. " ++++ + +### Chapter 2 + +# Create Content + +In this section, we will create some content for our mini-training. diff --git a/content/create-content/chapter.md b/content/create-content/chapter.md new file mode 100644 index 0000000..4655923 --- /dev/null +++ b/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 +``` \ No newline at end of file diff --git a/content/create-content/section.md b/content/create-content/section.md new file mode 100644 index 0000000..6172b02 --- /dev/null +++ b/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 +``` diff --git a/content/packaging/_index.md b/content/packaging/_index.md new file mode 100644 index 0000000..b4a42fc --- /dev/null +++ b/content/packaging/_index.md @@ -0,0 +1,12 @@ ++++ +title = "Packaging" +weight = 3 +chapter = true +pre = "3. " ++++ + +### Chapter 3 + +# Packaging + +In this chapter we will package our mini-training for publication. \ No newline at end of file diff --git a/content/packaging/git-commit.md b/content/packaging/git-commit.md new file mode 100644 index 0000000..54c5884 --- /dev/null +++ b/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 +``` \ No newline at end of file diff --git a/content/packaging/look-and-feel.md b/content/packaging/look-and-feel.md new file mode 100644 index 0000000..76a5c66 --- /dev/null +++ b/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 '' > layouts/partials/logo.html +curl "http://www.myiconfinder.com/icon/download/16895e53b6d340dffee1c9b84d90ca94-Redhat.png~10057" -o static/images/favicon.png +``` \ No newline at end of file diff --git a/content/packaging/test-locally.md b/content/packaging/test-locally.md new file mode 100644 index 0000000..59aac22 --- /dev/null +++ b/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! diff --git a/content/pre-requisites/_index.md b/content/pre-requisites/_index.md new file mode 100644 index 0000000..89c8dde --- /dev/null +++ b/content/pre-requisites/_index.md @@ -0,0 +1,12 @@ ++++ +title = "Pre-requisites" +weight = 1 +chapter = true +pre = "1. " ++++ + +### Chapter 1 + +# Pre-requisites + +Complete the pre-requisites before creating any content. \ No newline at end of file diff --git a/content/pre-requisites/bootstrap.md b/content/pre-requisites/bootstrap.md new file mode 100644 index 0000000..b685cf0 --- /dev/null +++ b/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 " command. +2. Perhaps you want to add some content. You can add single files + with "hugo new /.". +3. Start the built-in live server via "hugo server". + +Visit https://gohugo.io/ for quickstart guide and full documentation. +``` \ No newline at end of file diff --git a/content/pre-requisites/install.md b/content/pre-requisites/install.md new file mode 100644 index 0000000..9a31cae --- /dev/null +++ b/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/). diff --git a/content/pre-requisites/theme.md b/content/pre-requisites/theme.md new file mode 100644 index 0000000..272a3ab --- /dev/null +++ b/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 +``` \ No newline at end of file diff --git a/layouts/partials/logo.html b/layouts/partials/logo.html new file mode 100644 index 0000000..3467347 --- /dev/null +++ b/layouts/partials/logo.html @@ -0,0 +1 @@ + diff --git a/static/images/favicon.png b/static/images/favicon.png new file mode 100644 index 0000000..b369a28 Binary files /dev/null and b/static/images/favicon.png differ diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..2845afc Binary files /dev/null and b/static/logo.png differ diff --git a/themes/learn b/themes/learn new file mode 160000 index 0000000..4fc4354 --- /dev/null +++ b/themes/learn @@ -0,0 +1 @@ +Subproject commit 4fc43548b52be044166cde53845d7f36cdb15ad4