refactor(nav): format navigation types consistently

This commit is contained in:
Gauthier Daniels 2025-05-13 13:22:28 +02:00
parent b3b75ba5e7
commit 85c2d26c81
5 changed files with 186 additions and 146 deletions

View File

@ -104,6 +104,11 @@ export const navigation: NavigationSection[] = [
type: navigationsTypes.DOCUMENTATIONS,
position: "auto",
links: [
{
title: "HTML",
href: "/docs/html",
subitems: [{ title: "Introduction", href: "/docs/html" }],
},
{
title: "React",
href: "/docs/react",
@ -121,11 +126,6 @@ export const navigation: NavigationSection[] = [
{ title: "Le hook useReducer", href: "/docs/react/use-reducer" },
],
},
{
title: "HTML",
href: "/docs/html",
subitems: [{ title: "Introduction", href: "/docs/html" }],
},
],
},
{
@ -152,12 +152,20 @@ export const navigation: NavigationSection[] = [
},
];
export function doesLinkSubitemExist(link: NavigationLink, subitemHref: string): boolean {
export function doesLinkSubitemExist(
link: NavigationLink,
subitemHref: string,
): boolean {
return link.subitems.some((subitem) => subitem.href === subitemHref);
}
export function findNavigationLink(namespace: string, href?: string): NavigationLink | undefined {
const currentUrl = `/${namespace}/${href}`.replace(/\/+/g, "/").replace(/\/$/, "");
export function findNavigationLink(
namespace: string,
href?: string,
): NavigationLink | undefined {
const currentUrl = `/${namespace}/${href}`
.replace(/\/+/g, "/")
.replace(/\/$/, "");
const foundLink = navigation
.flatMap((section) => section.links)

View File

@ -0,0 +1,8 @@
---
title: Exploration approfondie des attributs HTML : utilisation, explications et exemples pratiques
description: Parlons un peu de HTML, l'incontournable langage de balisage utilisé pour créer des pages web.
tags: []
---
import Callout from "@/components/Callout";

View File

@ -0,0 +1,8 @@
---
title: Comprendre la fonctionnalité et l'importance de la balise \<head\> dans une page HTML
description: Parlons un peu de HTML, l'incontournable langage de balisage utilisé pour créer des pages web.
tags: []
---
import Callout from "@/components/Callout";

View File

@ -0,0 +1,8 @@
---
title: Découverte des balises HTML courantes pour structurer une page web
description: Parlons un peu de HTML, l'incontournable langage de balisage utilisé pour créer des pages web.
tags: []
---
import Callout from "@/components/Callout";

View File

@ -0,0 +1,8 @@
---
title: Créer des formulaires interactifs avec HTML : éléments, types d'entrées et validation de données
description: Parlons un peu de HTML, l'incontournable langage de balisage utilisé pour créer des pages web.
tags: []
---
import Callout from "@/components/Callout";