Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hugo-Lecture: remove support for multilingual #283

Merged
merged 2 commits into from
Jul 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
{{ $topic := .Page.File.TranslationBaseName }}

{{ $schedule := .Site.Data.schedule }}
{{ if .Site.IsMultiLingual }}
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ $schedule = $data.schedule }}
{{ end }}

{{ $due := "" }}
{{ range $schedule }}
Expand Down
4 changes: 0 additions & 4 deletions hugo/hugo-lecture/layouts/partials/assignments.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{{ $assignments := .Params.assignments }}
{{ $schedule := .Site.Data.schedule }}
{{ if .Site.IsMultiLingual }}
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ $schedule = $data.schedule }}
{{ end }}

{{ if $assignments }}

Expand Down
17 changes: 0 additions & 17 deletions hugo/hugo-lecture/layouts/partials/attachments.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
{{ $url = printf "%s/%s" . $url }}
{{ end }}
{{ $url = $url | path.Clean | absURL }}

{{ if $.Site.IsMultiLingual }}
{{/*
Hugo will include the current language code as subdir in the URL, but the
additional content (images, files, ...) will be placed in the default
language dir only. So the content will not be reachable using the correct
URL generated by Hugo, and we have to use the URL pointing to the default
language dir in all language variants.

Replace the current language code in the path with the language code for the
default language, e.g. replace "/ma/" w/ "/ba/" in "path/ma/images/wuppie.png"
(result: "path/ba/images/wuppie.png").
*/}}
{{ $default_lang := printf "/%s/" (index $.Site.Languages 0).Lang }}
{{ $current_lang := printf "%s/" $.Site.LanguagePrefix }}
{{ $url = replace $url $current_lang $default_lang }}
{{ end }}
{{ end }}
{{ $c = printf "%s <li><a href='%s' class='icon reading' target='_blank' rel='nofollow noopener noreferrer'>%s</a></li>" $c ($url | safeURL) $n }}
{{ end }}
Expand Down
5 changes: 0 additions & 5 deletions hugo/hugo-lecture/layouts/partials/favicon.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}

{{ $logo := "images/logo.png" }}
{{ if .Site.IsMultiLingual }}
{{ with (strings.TrimPrefix "/" .Site.LanguagePrefix) }}
{{ $logo = printf "images/logo.%s.png" . }}
{{ end }}
{{ end }}

<link href="{{ $logo | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="icon" type="image/png">
6 changes: 0 additions & 6 deletions hugo/hugo-lecture/layouts/partials/logo.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{{ $logo := "images/logo.png" }}

{{ if .Site.IsMultiLingual }}
{{ with (strings.TrimPrefix "/" .Site.LanguagePrefix) }}
{{ $logo = printf "images/logo.%s.png" . }}
{{ end }}
{{ end }}

<a id="logo" href='{{- .Site.BaseURL -}}/index.html'>
<img style="max-width:35%" alt="icon" src='{{- $logo | relURL -}}'>
</a>
17 changes: 0 additions & 17 deletions hugo/hugo-lecture/layouts/shortcodes/img.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@
{{ $src = printf "%s/%s" . $src }}
{{ end }}
{{ $src = $src | path.Clean | absURL }}

{{ if $.Site.IsMultiLingual }}
{{/*
Hugo will include the current language code as subdir in the URL, but the
additional content (images, files, ...) will be placed in the default
language dir only. So the content will not be reachable using the correct
URL generated by Hugo, and we have to use the URL pointing to the default
language dir in all language variants.

Replace the current language code in the path with the language code for the
default language, e.g. replace "/ma/" w/ "/ba/" in "path/ma/images/wuppie.png"
(result: "path/ba/images/wuppie.png").
*/}}
{{ $default_lang := printf "/%s/" (index $.Site.Languages 0).Lang }}
{{ $current_lang := printf "%s/" $.Site.LanguagePrefix }}
{{ $src = replace $src $current_lang $default_lang }}
{{ end }}
{{ end }}

{{/*
Expand Down
Loading