feat: translate the site in french

This commit is contained in:
Bruno Carlin 2025-06-20 02:33:45 +02:00
parent 3e98ac15b6
commit b47b193b20
Signed by: bcarlin
GPG key ID: 8E254EA0FFEB9B6D
81 changed files with 1327 additions and 251 deletions

View file

@ -0,0 +1,14 @@
<p>
© {{ now.Year }} Bruno Carlin
<br>
{{ T "license" (dict
"link" "https://creativecommons.org/licenses/by-nc/4.0/"
"name" "Creative Commons Attribution-NonCommercial 4.0 International"
) | safeHTML }}
{{partial "icon.html" (dict "icon" "creative-commons-fill" "label" "Creative Commons Logo")}}
{{partial "icon.html" (dict "icon" "creative-commons-by-fill" "label" "Creative Commons Attribution Logo")}}
{{partial "icon.html" (dict "icon" "creative-commons-nc-fill" "label" "Creative Commons Non Commercial Logo")}}
<br>
{{ T "generated_with_hugo" | safeHTML }}
</p>

View file

@ -0,0 +1,36 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
{{ hugo.Generator }}
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
<meta name="description" content="{{ default .Summary .Description }}">
<link rel="canonical" href="{{ .Permalink }}"/>
{{- if .IsTranslated }}
{{- range .Translations }}
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .RelPermalink }}"/>
{{- end }}
{{- end }}
{{ with .Site.GetPage "/blog" }}
{{- with .OutputFormats.Get "rss" }}
{{- printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{- end }}
{{- end }}
{{ if eq .Kind "term" }}
{{- with .OutputFormats.Get "rss" }}
{{- printf `<link rel=%q type=%q href=%q title='%s | %s'>` .Rel .MediaType.Type .Permalink $.Title site.Title | safeHTML }}
{{- end }}
{{- end }}
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="bcarlin.net" />
<link rel="manifest" href="/site.webmanifest" />
{{ template "_internal/opengraph.html" . }}
{{- template "_internal/schema.html" . }}
{{ partialCached "head/css.html" . }}
{{- partialCached "head/js.html" . }}

View file

@ -0,0 +1,29 @@
{{- with resources.Get "static/css/pico.min.css" }}
{{- if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- else }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
{{- end }}
{{- end }}
{{- with resources.Get "static/css/remixicon.css" }}
{{- if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- else }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
{{- end }}
{{- end }}
{{- with resources.Get "static/css/bcarlin.css" }}
{{- if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- else }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,19 @@
{{- with resources.Get "static/js/bcarlin.js" }}
{{- $opts := dict
"minify" (not hugo.IsDevelopment)
"sourceMap" (cond hugo.IsDevelopment "external" "")
"targetPath" "static/js/bcarlin.js"
}}
{{- with . | js.Build $opts }}
{{- if hugo.IsDevelopment }}
<script src="{{ .RelPermalink }}"></script>
{{- else }}
{{- with . | fingerprint }}
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if not hugo.IsDevelopment }}
<script defer data-domain="bcarlin.net" src="//stats.bcarlin.net/js/script.js"></script>
{{- end }}

View file

@ -0,0 +1,22 @@
<a id="menu-close">
{{partial "icon.html" (dict "icon" "close-large-fill" "label" (T `close_menu`))}}
</a>
<nav id="main-menu" aria-label="{{ T `main_menu` }}">
<ul>
<li>
<a href="{{ .Site.Home.Permalink }}" class="contrast">
<img class="u-logo" src="/static/logo.svg" alt="{{T `logo`}}"/>
</a>
</li>
<li>
<span class="title p-name">
<a href="{{ .Site.Home.Permalink }}" class="contrast">{{ .Site.Title }}</a>
</span>
</li>
</ul>
{{ partial "menu.html" (dict "menuID" "main" "class" "menu-primary" "page" .) }}
{{ partial "menu.html" (dict "menuID" "secondary" "class" "menu-secondary" "page" .) }}
</nav>

View file

@ -0,0 +1 @@
<i class="ri-{{ .icon }}" role="img" title="{{ .label }}"></i>

View file

@ -0,0 +1,62 @@
{{- /*
Renders a menu for the given menu ID.
@context {page} page The current page.
@context {string} menuID The menu ID.
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
*/}}
{{- $page := .page }}
{{- $menuID := .menuID }}
{{- $menuClass := .class }}
{{- with index site.Menus $menuID }}
<ul class="{{ $menuClass }}">
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
{{- end }}
{{- define "_partials/inline/menu/walk.html" }}
{{- $page := .page }}
{{- range .menuEntries }}
{{- $attrs := dict "href" .URL "class" "" }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
{{- else if $page.HasMenuCurrent .Menu .}}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
{{- $attrs = merge $attrs (dict "class" (print $attrs.class " contrast")) }}
{{- if (ne .Params.class nil) }}
{{- $attrs = merge $attrs (dict "class" (print $attrs.class " " .Params.class)) }}
{{- end }}
{{- if (ne .Params.rel nil) }}
{{- $attrs = merge $attrs (dict "rel" .Params.rel) }}
{{- end }}
{{- $name := .Name }}
{{- with .Identifier }}
{{- with T . }}
{{- $name = . }}
{{- end }}
{{- end }}
<li>
<a
{{- range $k, $v := $attrs }}
{{- with $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
>
{{- if (ne .Params.iconName nil) }}
{{partial "icon.html" (dict "icon" .Params.iconName "label" .Params.iconTitle)}}
{{- end }}
{{ $name }}
</a>
{{- with .Children }}
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
{{- end }}
</li>
{{- end }}
{{- end }}

View file

@ -0,0 +1,9 @@
{{- with $terms := .GetTerms "tags" }}
<p class="tags">
{{ partial "icon.html" (dict "icon" "price-tag-3-line" "label" (T "tags")) }}
{{- range $idx, $it := $terms }}
<a href="{{ $it.RelPermalink }}" rel="tag" class="p-category">{{ $it.LinkTitle }}</a>
{{- if ne $idx (sub $terms.Len 1) }}<span aria-hidden="true">, </span>{{ end }}
{{- end }}
</p>
{{- end }}