Skip to content
Draft
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
4 changes: 2 additions & 2 deletions layouts/_partials/GetMedia.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ $directoryName := slicestr . 0 2 }}
{{ $directory := "" }}
{{ $media := "" }}
{{ if isset site.Data.media $directoryName }}
{{ $directory = index site.Data.media $directoryName }}
{{ if isset hugo.Data.media $directoryName }}
{{ $directory = index hugo.Data.media $directoryName }}
{{ if isset $directory . }}
{{ $media = index $directory . }}
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/_partials/GetMenu.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{ $kind := . }}
{{ $menus := index site.Data.menus (printf "%s" site.Language) }}
{{ $menus := index hugo.Data.menus (printf "%s" site.Language) }}
{{ $menu := "" }}
{{/* Try to get menus from the data/menus/<lang> directory */}}
{{ if (and $menus (isset $menus $kind)) }}
{{/* Menu found in data/menus/<lang> */}}
{{ $menu = index $menus $kind }}
{{ else }}
{{/* Fallback to menu in the data/menus directory */}}
{{ $menu = index site.Data.menus $kind }}
{{ $menu = index hugo.Data.menus $kind }}
{{ end }}

{{ if reflect.IsSlice $menu }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/alias/multilingual/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
url = '{{ .Permalink }}'; // default url

{{ with site.Languages }}
{{ range site.Languages }}
{{ range . }}
if (preferLang.indexOf('{{ . }}') > -1) {
url = '/{{ . }}/';
}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/commons/alerts/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{/* Get alerts filtered by lang */}}
{{ $alerts := index site.Data "alerts" site.Language.Lang }}
{{ $alerts := index hugo.Data "alerts" site.Language.Name }}

{{ if $alerts }}
<div class="alerts">
Expand Down
19 changes: 12 additions & 7 deletions layouts/_partials/commons/i18n.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
{{ $position := .position }}
{{ $dropdown_class := "dropdown-menu dropdown-languages" }}


{{ $languages := site.Languages }}
{{/* Should use .Rotate, but it seems unavalaible in 404 page */}}
{{/* {{ $languages := .Rotate "language" }} */}}

{{ if eq $position "footer" }}
{{ $dropdown_class = printf "%s extendable" $dropdown_class }}
{{ end }}

{{ if gt (len site.Languages) 1 }}
{{ if gt (len $languages) 1 }}
<li class="i18n-dropdown {{ $position }}-i18n has-children">
{{ with site.Languages }}
{{ $language := cond (eq $position "footer") site.Language.LanguageName site.Language }}
{{ with $languages }}
{{ $language := cond (eq $position "footer") site.Language.Label site.Language }}
<span
role="button"
aria-controls="{{ $position }}-i18n-list"
Expand All @@ -23,18 +28,18 @@
</span>
<div class="{{ $dropdown_class }}" id="{{ $position }}-i18n-list">
<ul>
{{ range site.Languages }}
{{ range $languages }}
{{ $siteLang := . }}
{{ $url = printf "/%s/" .Lang }}
{{ $url = printf "/%s/" .Name }}
{{ range $pageWithTranslations }}
{{ if eq .Lang $siteLang.Lang }}
{{ if eq .Name $siteLang.Name }}
{{ $url = .Permalink }}
{{ end }}
{{ end }}
{{ if not (eq $siteLang site.Language) }}
<li>
<a href="{{ $url }}" lang="{{ $siteLang }}" hreflang="{{ $siteLang }}" >
{{- $siteLang.LanguageName -}}
{{- $siteLang.Label -}}
</a>
</li>
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/commons/image-default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $section_type := . -}}
{{- $use_default := (index site.Params $section_type).default_image -}}
{{- $image := index site.Data.website site.Language.Lang "default" "image" -}}
{{- $image := index hugo.Data.website site.Language.Name "default" "image" -}}

{{- if and $use_default $image -}}
{{ with index site.Params.image_sizes.sections $section_type }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/diplomas/single/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"image" .Params.image
"sizes" site.Params.image_sizes.sections.home.hero
"context" .
"hero_complement" "diplomas/single/hero/essential.html"
"hero_complement" ( partial "diplomas/single/hero/essential.html" . )
) }}
2 changes: 1 addition & 1 deletion layouts/_partials/footer/contents.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $contents := index site.Data.website site.Language.Lang "contents" }}
{{ $contents := index hugo.Data.website site.Language.Name "contents" }}
{{ if $contents }}
<div class="footer-contents contents-full-width">
{{ partial "contents/list.html" (dict
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/head/csp.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- with site.Data.content_security_policy.allowed_domains -}}
{{- with hugo.Data.content_security_policy.allowed_domains -}}
<meta http-equiv="Content-Security-Policy"
content="
default-src 'self' {{ delimit . " " }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/head/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{{- $twitterImage := "" -}}
{{- $pagefindImage := "" -}}

{{- with index site.Data.website site.Language.Lang "default" "shared_image" -}}
{{- with index hugo.Data.website site.Language.Name "default" "shared_image" -}}
{{- $sharedImage = partial "GetMedia" (index . "id") -}}
{{- end -}}
{{- with or .Params.shared_image .Params.image }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_partials/header/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ partial "hooks/before-hero-content-end.html" .context }}
</div>
{{ if .hero_complement }}
{{ partial .hero_complement .context }}
{{ .hero_complement }}
{{ end }}
{{ partial "header/hero/breadcrumbs/end.html" . }}
</header>
Expand Down
4 changes: 2 additions & 2 deletions layouts/_partials/header/hero/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>

{{ if .hero_content_complement }}
{{ partial .hero_content_complement .context }}
{{ .hero_content_complement }}
{{ end }}

{{ partial "header/hero/content/image.html" (dict
Expand All @@ -16,6 +16,6 @@
) }}

{{ if .hero_after_image_complement }}
{{ partial .hero_after_image_complement .context }}
{{ .hero_after_image_complement }}
{{ end }}
</div>
2 changes: 1 addition & 1 deletion layouts/_partials/header/hero/content/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ <h1 {{ $title_attribute }}>{{ safeHTML .title }}</h1>
{{ partial "header/hero/breadcrumbs/after-title.html" . }}

{{ if .hero_text_complement }}
{{ partial .hero_text_complement .context }}
{{ .hero_text_complement }}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/_partials/locations/single/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"image" .Params.image
"sizes" site.Params.image_sizes.sections.locations.hero_single
"context" .
"hero_text_complement" "locations/single/hero/address.html"
"hero_text_complement" ( partial "locations/single/hero/address.html" . )
) -}}
4 changes: 2 additions & 2 deletions layouts/_partials/programs/single/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{{ partial "header/hero.html" (dict
"title" $title
"context" .
"hero_content_complement" "programs/single/hero/logos.html"
"hero_complement" "programs/single/hero/essential.html"
"hero_content_complement" ( partial "programs/single/hero/logos.html" . )
"hero_complement" ( partial "programs/single/hero/essential.html" . )
) }}
2 changes: 1 addition & 1 deletion layouts/_partials/projects/single/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"title" $title
"image" .Params.image
"sizes" site.Params.image_sizes.sections.projects.hero_single
"hero_text_complement" "projects/single/hero/infos.html"
"hero_text_complement" ( partial "projects/single/hero/infos.html" . )
"context" .
"share" $share
) -}}
2 changes: 1 addition & 1 deletion layouts/_partials/rss/channel/attributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</description>
{{ end -}}
<generator>Hugo+Osuny</generator>
<language>{{ site.Language.LanguageCode }}</language>{{ with .authorEmail }}
<language>{{ site.Language.Locale }}</language>{{ with .authorEmail }}
<managingEditor>{{.}}{{ with .authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with .authorEmail }}
<webMaster>{{ . }}{{ with .authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
<copyright>{{ . }}</copyright>{{ end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ $is_interactive_map_present := false }}
{{ $page_contents := .Params.contents }}
{{ $website_content := index site.Data.website site.Language.Lang "contents" }}
{{ $website_content := index hugo.Data.website site.Language.Name "contents" }}

{{ range slice $page_contents $website_content }}
{{ range . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/alias.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ site.Language.LanguageCode }}">
<html lang="{{ site.Language.Locale }}">
<head>
<title>{{ .Permalink }}</title>
<link rel="canonical" href="{{ .Permalink }}"/>
Expand Down
2 changes: 1 addition & 1 deletion layouts/baseof.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ $.Site.LanguageCode | default "fr" }}">
<html lang="{{ $.Site.Language.Locale | default "fr" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
Loading