feat: Add a breadcrumb

This commit is contained in:
kbe
2025-08-19 09:54:49 +02:00
parent 90340d03aa
commit 686ece4479
55 changed files with 24172 additions and 2 deletions

View File

@@ -18,14 +18,17 @@
<link href="/assets/css/theme.css" rel="stylesheet">
<link href="/assets/css/theme-colors/theme-color-blue.css" rel="stylesheet">
<!-- Fonts/Icons -->
<!-- <link href="/assets/plugins/bootstrap-icons/bootstrap-icons.css" rel="stylesheet"> -->
<!-- <link href="/assets/plugins/font-awesome/css/all.css" rel="stylesheet"> -->
<link href="/assets/plugins/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="/assets/plugins/font-awesome/css/all.css" rel="stylesheet">
</head>
<body data-preloader="1">
<!-- Header -->
{{ partial "header.html" . }}
<!-- Breadcrumb -->
{{ partial "breadcrumb.html" . }}
<main>
{{ block "main" . }}{{ end }}
</main>

View File

@@ -0,0 +1,71 @@
<!-- Breadcrumb Navigation with SEO optimization -->
<div class="breadcrumb-wrapper">
<div class="container">
<div class="row">
<div class="col-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
<!-- Home/Accueil with SEO -->
<li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ "/" | relLangURL }}" itemprop="item" title="{{ i18n "home" | default "Accueil" }}">
<i class="fas fa-home" aria-hidden="true"></i>
<span itemprop="name">{{ i18n "home" | default "Accueil" }}</span>
</a>
<meta itemprop="position" content="1" />
</li>
<!-- Category with SEO and linking -->
{{ if or .Params.categories .Section }}
{{ $category := "" }}
{{ $categorySlug := "" }}
{{ $categoryUrl := "" }}
{{ if .Params.categories }}
{{ $category = index .Params.categories 0 }}
{{ $categorySlug = urlize $category }}
{{ $categoryUrl = printf "/categories/%s" $categorySlug }}
{{ else if .Section }}
{{ $category = humanize .Section }}
{{ $categorySlug = .Section }}
{{ $categoryUrl = printf "/%s" .Section }}
{{ end }}
{{ if $category }}
<li class="breadcrumb-item active" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" aria-current="page">
<a href="{{ $categoryUrl | relLangURL }}" itemprop="item" title="{{ $category }}">
<span itemprop="name">{{ $category }}</span>
</a>
<meta itemprop="position" content="2" />
</li>
{{ end }}
{{ end }}
</ol>
</nav>
</div>
</div>
</div>
</div>
<!-- JSON-LD Structured Data for SEO -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "{{ i18n "home" | default "Accueil" }}",
"item": "{{ "/" | absLangURL }}"
}{{ if or .Params.categories .Section }},
{
"@type": "ListItem",
"position": 2,
"name": "{{ if .Params.categories }}{{ index .Params.categories 0 }}{{ else }}{{ humanize .Section }}{{ end }}",
"item": "{{ if .Params.categories }}{{ printf "%s/categories/%s" (absLangURL "") (urlize (index .Params.categories 0)) }}{{ else }}{{ printf "%s/%s" (absLangURL "") .Section }}{{ end }}"
}{{ end }}
]
}
</script>

View File

@@ -0,0 +1,46 @@
<!-- Header -->
<div class="header center header-color-dark">
<div class="container">
<!-- Logo -->
<div class="header-logo">
<h3 class="uppercase letter-spacing-1"><a href="/">{{ .Site.Title }}</a></h3>
</div>
<!-- Menu -->
<div class="header-menu">
<ul class="nav">
<li class="nav-item">
<a class="nav-link" href="/">Accueil</a>
</li>
{{ if .Site.Data.wordpress }}
{{ $count := 0 }}
{{ range $index, $element := .Site.Data.wordpress.categories }}
{{ if or (eq $element.name "Featured") (eq $element.name "Non classé") }}
{{ continue }}
{{ else if lt $count 5 }}
<li class="nav-item">
<a class="nav-link" href="/categories/{{ $element.slug }}">{{ $element.name }}</a>
</li>
{{ $count = add $count 1 }}
{{ else }}
{{ break }}
{{ end }}
{{ end }}
{{ end }}
</ul>
</div>
<!-- Menu Extra -->
{{/* <div class="header-menu-extra">
<ul class="list-inline-sm">
<li><a href="#"><i class="bi bi-facebook"></i></a></li>
<li><a href="#"><i class="bi bi-twitter-x"></i></a></li>
<li><a href="#"><i class="bi bi-linkedin"></i></a></li>
</ul>
</div> */}}
<!-- Menu Toggle -->
<button class="header-toggle">
<span></span>
</button>
</div><!-- end container -->
</div>
<!-- end Header -->