Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout (tutorials)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Checkout (theme)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: MunifTanjim/minimo
ref: v2.9.0
# repository: falkmielke/minimo
# ref: update_202605
path: themes/minimo

- name: Setup Hugo
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # v2
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1
with:
hugo-version: '0.88.1'
hugo-version: '0.165.0'
# extended: true

- name: Build
Expand All @@ -39,7 +40,7 @@ jobs:
run: node themes/minimo/scripts/generate-search-index-lunr.js

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # 4.8.0
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # 4.9.0
with:
branch: gh-pages
folder: public
13 changes: 7 additions & 6 deletions .github/workflows/generate-artifact-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout (tutorials)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Checkout (theme)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: MunifTanjim/minimo
ref: v2.9.0
# repository: falkmielke/minimo
# ref: update_202605
path: themes/minimo

- name: Setup Hugo
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # v2
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1
with:
hugo-version: '0.88.1'
hugo-version: '0.161.1'
# extended: true

- name: Build
Expand All @@ -38,7 +39,7 @@ jobs:
run: node themes/minimo/scripts/generate-search-index-lunr.js

- name: Archive built site to an artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-${{ env.PR_NUMBER }}-inbo-tutorials-website
path: public
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remove_old_artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@44fc7acaf1b3d0987da0e8d4707a989d80e9554b # v1
uses: c-hive/gha-remove-artifacts@62c2fbea931baa7dd4a6b73ea5a799984a818f61 # v1.8.0
with:
age: '1 days'
skip-recent: 5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ data_gisclub/

/.quarto/
**/*.quarto_ipynb
/.hugo_build.lock
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ The technology used to create the website is [Hugo](https://gohugo.io/), a stati

1. [Install hugo](https://gohugo.io/getting-started/installing/)
2. Clone the tutorials repository
3. In the cloned tutorials directory, install the theme with `git clone https://github.com/MunifTanjim/minimo.git --branch v2.9.0 themes/minimo`
4. Build and serve the site with `hugo server`
3. In the cloned tutorials directory, install the theme[^1] with `git clone https://github.com/MunifTanjim/minimo.git themes/minimo`
4. Build and serve the site
a) with `hugo server` OR
b) for debugging, with `hugo -D` and then serving manually `python -m http.server 8887 --bind localhost --directory <tutorials>/public/`

[^1]: The `minimo` theme seems unmaintained; a (temporary?) fork with fixes of hugo deprecation warnings is available [here](https://github.com/falkmielke/minimo/tree/update_202605).


For more information, see [Hugo's getting started documentation](https://gohugo.io/getting-started/usage/).


### Customizing the theme

The tutorials website makes use of the Hugo theme [minimo](https://themes.gohugo.io/minimo/). This theme is not included in the repository, but [downloaded by GitHub pages](https://github.com/inbo/tutorials/blob/262f305ef66fd4fc46ef7b2a9dce36cd2ad3e0d9/.github/workflows/deploy-gh-pages.yml#L18-L23) at build time. This avoids clutter and changes to the theme itself. To customize the theme:
Expand All @@ -48,4 +54,4 @@ For more information, see the [Hugo theme customization documentation](https://g

## License

[Creative Commons Attribution](https://creativecommons.org/licenses/by/4.0/) for [content](content) / [MIT License](https://github.com/inbo/tutorials/blob/master/LICENSE) for source code.
[Creative Commons Attribution](https://creativecommons.org/licenses/by/4.0/) for [content](content) / [MIT License](https://github.com/inbo/tutorials/blob/master/LICENSE) for source code.
6 changes: 3 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
theme = "minimo"
languageCode = "en-us"
locale = "en-us"
title = "INBO Tutorials"

ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "\\.qmd$", "_cache$", "\\.db$", "\\.csv$", "\\.sqlite$", "\\.geojson$"]
Expand All @@ -12,7 +12,7 @@ copyright = ""
disqusShortname = ""
googleAnalytics = ""

Paginate = 1000
pagination.pagerSize = 1000
preserveTaxonomyNames = true

enableRobotsTXT = true # generate robots.txt
Expand Down Expand Up @@ -146,7 +146,7 @@ hrefTargetBlank = true
# edit this block for your own language
[languages.en]
lang = "en"
languageName = "English"
label = "English"
weight = 1

[markup]
Expand Down
34 changes: 34 additions & 0 deletions layouts/page/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ partial "header" . }}

{{ partial "header/header" . }}

{{ if .Content }}
<div class='entry'>
{{ partial "entry/content" . }}
</div>
{{ end }}

<div class='container'>
{{ partial "widgets/search" . }}

<ul id='search-results' class='list search-results' data-results-empty='{{ i18n "searchResultEmpty" }}' data-searching='{{ i18n "searching" }}'>
</ul>
</div>

{{- with .Site.Params.search.client -}}
{{- if eq . "lunr" -}}
<script src='{{ ( print "search/lunr_idx.js?build=" ( now.Format "200601021504" ) ) | relLangURL }}'></script>
{{- else if eq . "algolia" -}}
<script>window.algolia = {
appId: '{{ $.Site.Params.search.algolia.appId }}',
indexName: '{{ $.Site.Params.search.algolia.indexName | default "minimo_site" }}',
searchApiKey: '{{ $.Site.Params.search.algolia.searchApiKey }}'
}</script>
{{- end -}}

{{- $scriptKey := ( print . "_search" ) -}}
{{- $scriptName := ( index hugo.Data.assets $scriptKey ).js -}}
<script src='{{ print "assets/js/" $scriptName | relURL }}'></script>
{{- end -}}

{{ partial "footer" . }}
19 changes: 19 additions & 0 deletions layouts/partials/comments/staticman/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- $entryId := .File.UniqueID -}}

{{- if isset hugo.Data.comments $entryId -}}

{{- $comments := ( index hugo.Data.comments $entryId ) -}}
<h3 class='comments-title'>
{{ i18n "commentsOnEntry" ( dict "Count" ( len $comments ) "Title" .Title ) }}
</h3>

<ol class='comment-list'>
{{- range $index, $comment := $comments -}}
{{- $.Scratch.Set "comments_depth" 1 -}}
{{- if not $comment.parent_id -}}
{{ partial "comments/staticman/comment" ( dict "Comment" $comment "Page" $ ) }}
{{- end -}}
{{- end -}}
</ol>

{{- end -}}
11 changes: 11 additions & 0 deletions layouts/partials/comments/staticman/replies-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- .Page.Scratch.Add "comments_depth" 1 -}}
{{- $comments := ( index hugo.Data.comments .Page.File.UniqueID ) -}}
{{- $parentId := .ParentId -}}

<ol class='children'>
{{- range $index, $comment := $comments -}}
{{- if ( eq $comment.parent_id $parentId ) -}}
{{ partial "comments/staticman/comment" ( dict "Comment" $comment "Page" $.Page ) }}
{{- end -}}
{{- end -}}
</ol>
15 changes: 15 additions & 0 deletions layouts/partials/data/author/displayName
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- $.Scratch.Set "authorID" "" -}}

{{- if eq .Kind "term" -}}
{{- $.Scratch.Set "authorID" .Data.Term -}}
{{- else if eq .Kind "taxonomy" -}}
{{- $.Scratch.Set "authorID" .Name -}}
{{- else if eq .Kind "page" -}}
{{- $.Scratch.Set "authorID" ( index .Params.authors 0 ) -}}
{{- end -}}

{{- $lang := ( .Params.lang | default .Lang ) -}}
{{- $author := ( index hugo.Data.authors ( $.Scratch.Get "authorID" ) ) -}}
{{- $i18nAuthor := ( index $author $lang ) -}}
{{- $name := ( or $i18nAuthor.name $author.name ) -}}
{{- $name.display -}}
20 changes: 20 additions & 0 deletions layouts/partials/entry/meta/author.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- with .Params.authors -}}

{{- $lang := ( $.Params.lang | default $.Lang ) -}}

<span class='byline'>
{{- partial "svg/icon" "author" -}}
<span class='screen-reader-text'> {{ i18n "by" }} </span>

{{- range $i, $authorID := . -}}
{{- $author := ( index hugo.Data.authors $authorID ) -}}
{{- $i18nAuthor := ( index $author $lang ) -}}
{{- $name := ( or $i18nAuthor.name $author.name ) -}}
{{- if gt $i 0 }}, {{ end -}}
<a href='{{ ( print "authors" "/" $author.id ) | relLangURL }}'>
{{- $name.display -}}
</a>
{{- end -}}
</span>

{{- end -}}
2 changes: 1 addition & 1 deletion layouts/partials/entry/meta/edit-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{ end }}

{{ with .Site.Params.githublink.GithubEditLink }}
<a href='{{ . }}{{ $.Scratch.Get "FilePath" }}'> {{- partial "svg/icons" "github" -}} Improve this page</a>
<a href='{{ . }}{{ $.Scratch.Get "FilePath" }}'> {{- partial "svg/icon" "github" -}} Improve this page</a>
{{ end }}

{{ end }}
Expand Down
16 changes: 16 additions & 0 deletions layouts/partials/footer/katex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- $defaultKatex := hugo.Data.config.default.katex -}}
{{- $katex := ( or hugo.Data.config.katex $defaultKatex ) -}}

{{- if or ( eq .Params.katex true ) ( .HasShortcode "katex" ) -}}

<link rel='stylesheet' href='{{- $katex.library.css.main -}}'>
<script src='{{- $katex.library.js.main -}}'></script>
<script src='{{- $katex.library.js.autoRender -}}'></script>

<script type='text/javascript'>
renderMathInElement(document.querySelector('.entry-content'),
{{- $katex.options | jsonify | safeJS -}}
);
</script>

{{- end -}}
14 changes: 14 additions & 0 deletions layouts/partials/footer/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- $defaultMathjax := hugo.Data.config.default.mathjax -}}
{{- $mathjax := ( or hugo.Data.config.mathjax $defaultMathjax ) -}}

{{- if eq .Params.mathjax true -}}

<script type='text/x-mathjax-config'>
MathJax.Hub.Config(
{{- $mathjax.config | jsonify -}}
)
</script>

<script type='text/javascript' async src='{{- $mathjax.library.path -}}{{- with $mathjax.library.config -}}?config={{- . -}}{{- end -}}'></script>

{{- end -}}
14 changes: 14 additions & 0 deletions layouts/partials/footer/mermaid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- $defaultMermaid := hugo.Data.config.default.mermaid -}}
{{- $mermaid := ( or hugo.Data.config.mermaid $defaultMermaid ) -}}

{{- if eq .Params.mermaid true -}}

<script src='{{- $mermaid.library.path -}}' />

<script type='text/javascript'>
mermaid.initialize(
{{- $mermaid.config | jsonify | safeJS -}}
);
</script>

{{- end -}}
13 changes: 13 additions & 0 deletions layouts/partials/footer/scripts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script>window.__assets_js_src={{- "assets/js/" | relURL -}}</script>

<script src='{{ print "assets/js/" hugo.Data.assets.main.js | relURL }}'></script>

{{- range .Site.Params.assets.customJS -}}
<script src='{{ . | relURL }}'></script>
{{- end -}}

{{ partial "footer/mathjax" . }}
{{- partial "footer/katex" . -}}
{{- partial "footer/mermaid" . -}}

{{ partial "footer/extra" . }}
14 changes: 14 additions & 0 deletions layouts/partials/head/includes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<link rel='icon' href='{{ ( or .Site.Params.assets.favicon "favicon.ico" ) | relURL }}'>
<link rel='stylesheet' href='{{ print "assets/css/" hugo.Data.assets.main.css | relURL }}'>

{{- if or ( .Site.Params.settings.rtl ) ( eq .Site.Language.Direction "rtl" ) -}}
<link rel='stylesheet' href='{{ print "assets/css/" hugo.Data.assets.rtl.css | relURL }}'>
{{- end -}}

{{- range .Site.Params.assets.customCSS -}}
<link rel='stylesheet' href='{{ . | relURL }}'>
{{- end -}}

{{- partial "head/css" . -}}

{{- partial "head/analytics" . -}}
Loading