Skip to content
Merged
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
10 changes: 7 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -24,16 +27,16 @@ jobs:
- name: Download and setup Hugo
uses: peaceiris/actions-hugo@v3
env:
HUGO_RELEASE: '0.155.3'
HUGO_RELEASE: '0.159.1'
with:
hugo-version: ${{ env.HUGO_RELEASE }}
extended: true
- name: Check Hugo installation
run: hugo env
- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '18'
node-version: '24'
- name: Cache dependencies
uses: actions/cache@v4
with:
Expand All @@ -51,6 +54,7 @@ jobs:
--printI18nWarnings \
--cacheDir "${{ runner.temp }}/hugo_cache"
- name: Deploy website with rsync
if: github.event_name == 'push' && github.ref_name == 'main'
uses: burnett01/rsync-deployments@v8
with:
switches: -avzr --quiet --delete
Expand Down
7 changes: 6 additions & 1 deletion assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ var tour = new Tour({
]
});

availableLanguages = [{{ printf "'%s'" (delimit site.Languages "','") }}];
availableLanguages = [
{{- range hugo.Sites -}}
'{{- .Language -}}',
{{- end -}}
];

// Check if browser language matches document language and language version exists.
if (userLanguage !== document.documentElement.lang
&& availableLanguages.includes(userLanguage)) {
Expand Down
43 changes: 29 additions & 14 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
baseURL: 'https://moodletoolguide.net/'
languageCode: en-us

# Site language. Available translations in the theme's `/i18n` directory.
defaultContentLanguage: en

# Site time zone
timeZone: Europe/Zurich

# Whether to publish the default content language to a subdirectory matching the defaultContentLanguage
defaultContentLanguageInSubdir: true

Expand Down Expand Up @@ -40,7 +42,8 @@ params:

languages:
en:
languageName: English
label: English
locale: en-us
weight: 1
title: Moodle Tool Guide
contentDir: content/en
Expand Down Expand Up @@ -73,7 +76,8 @@ languages:
date_format: January 2, 2006

fr:
languageName: Français
label: Français
locale: fr-fr
weight: 2
title: Guide des outils Moodle
contentDir: content/fr
Expand Down Expand Up @@ -105,7 +109,8 @@ languages:
date_format: 2 January 2006

it:
languageName: Italiano
label: Italiano
locale: it-it
weight: 3
title: Guida agli strumenti Moodle
contentDir: content/it
Expand Down Expand Up @@ -138,7 +143,8 @@ languages:
date_format: 2 January 2006

de:
languageName: Deutsch
label: Deutsch
locale: de-de
weight: 4
title: Moodle-Werkzeuge für Lehrpersonen
contentDir: content/de
Expand Down Expand Up @@ -174,7 +180,8 @@ languages:
date_format: 2. January 2006

es:
languageName: Español
label: Español
locale: es-es
weight: 5
title: Guía de las herramientas de Moodle
contentDir: content/es
Expand Down Expand Up @@ -207,7 +214,8 @@ languages:
date_format: 2 January 2006

nl:
languageName: Nederlands
label: Nederlands
locale: nl-nl
weight: 6
title: Moodle Gereedschapsgids
contentDir: content/nl
Expand Down Expand Up @@ -243,7 +251,8 @@ languages:
date_format: 2 January 2006

eu:
languageName: Euskara
label: Euskara
locale: eu
weight: 7
title: Moodleko Tresnen Gida
contentDir: content/eu
Expand Down Expand Up @@ -279,7 +288,8 @@ languages:
date_format: 2006 January 2

pt-br:
languageName: Português (Brasil)
label: Português (Brasil)
locale: pt-br
weight: 8
title: Guia de Ferramentas Moodle
contentDir: content/pt-br
Expand Down Expand Up @@ -311,7 +321,8 @@ languages:
date_format: 2 January 2006

pt-pt:
languageName: Português
label: Português
locale: pt-pt
weight: 9
title: Guia de Ferramentas do Moodle
contentDir: content/pt-pt
Expand Down Expand Up @@ -343,7 +354,8 @@ languages:
date_format: 2 January 2006

zh:
languageName: 中文
label: 中文
locale: zh-cn
weight: 10
title: Moodle Tool Guide
contentDir: content/zh
Expand Down Expand Up @@ -376,7 +388,8 @@ languages:
date_format: January 2, 2006

fi:
languageName: Suomi
label: Suomi
locale: fi-fi
weight: 12
title: Moodle-työkaluopas
contentDir: content/fi
Expand Down Expand Up @@ -408,7 +421,8 @@ languages:
date_format: 2 January 2006

et:
languageName: Eesti
label: Eesti
locale: et-ee
weight: 13
title: Moodle'i tööriistade juhend
contentDir: content/et
Expand Down Expand Up @@ -441,7 +455,8 @@ languages:
date_format: 2 January 2006

sv:
languageName: Svenska
label: Svenska
locale: sv-se
weight: 11
title: Moodle-verktygsguide
contentDir: content/sv
Expand Down
11 changes: 4 additions & 7 deletions layouts/_default/robots.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
User-agent: *

{{ range .Sites }}
{{- range where site.RegularPages "Params.robotsdisallow" true -}}
Disallow: {{ .RelPermalink }}
{{- end }}
{{ end }}
Sitemap: {{ "sitemap.xml" | absURL -}}
{{- if hugo.IsMultilingual }}
{{ range site.Languages -}}
Sitemap: {{ printf "%s/sitemap.xml" .Lang | absURL }}
{{- end -}}
{{ end }}
Sitemap: {{ "sitemap.xml" | absURL }}
{{ range hugo.Sites -}}
Sitemap: {{ .Home.Permalink }}sitemap.xml
{{ end }}
23 changes: 1 addition & 22 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,7 @@
{{ end }}
</ul>
{{ end }}
{{ if hugo.IsMultilingual }}
<ul class="nav navbar-nav navbar-right">
<li id="language-switch" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-globe fa-lg" aria-hidden="true"></i><span id="language-name">{{ .Language.LanguageName }}</span></a>
<ul class="dropdown-menu">
{{ $siteLanguages := site.Languages }}
{{ $pageLang := .Page.Lang }}
{{ range .Page.AllTranslations }}
{{ $translation := .}}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ $selected := false }}
{{ if not (eq $pageLang .Lang) }}
<li><a href="{{ $translation.RelPermalink }}">{{ .LanguageName }}</a></li>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</ul>
</li>
</ul>
{{ end }}
{{ partial "langswitcher" . }}
</div>
</div>
</nav>
14 changes: 14 additions & 0 deletions layouts/partials/langswitcher.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<ul class="nav navbar-nav navbar-right">
{{ with .Rotate "language" }}
<li id="language-switch" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-globe fa-lg" aria-hidden="true"></i><span id="language-name">{{- $.Site.Language.Label -}}</span></a>
<ul class="dropdown-menu">
{{ range . }}
{{ if not (eq .Site.Language $.Site.Language) }}
<li><a href="{{ .RelPermalink }}">{{ .Site.Language.Label }}</a></li>
{{ end }}
{{ end }}
</ul>
</li>
{{ end }}
</ul>
Loading