style: Update navigation.ts formatting and structure
This commit is contained in:
parent
2a0283785a
commit
baca4c78e7
@ -1,172 +1,169 @@
|
|||||||
const navigationsTypes = {
|
const navigationsTypes = {
|
||||||
GLOBAL: "👋 Général",
|
GLOBAL: "👋 Général",
|
||||||
CERTIFICATIONS: "🎓 Certifications",
|
CERTIFICATIONS: "🎓 Certifications",
|
||||||
DOCUMENTATIONS: "📚 Documentations",
|
DOCUMENTATIONS: "📚 Documentations",
|
||||||
OTHER: "🔗 Autres",
|
OTHER: "🔗 Autres",
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NavigationSection = {
|
export type NavigationSection = {
|
||||||
title: string;
|
title: string;
|
||||||
type: (typeof navigationsTypes)[keyof typeof navigationsTypes];
|
type: (typeof navigationsTypes)[keyof typeof navigationsTypes];
|
||||||
position: "start" | "end" | "auto";
|
position: "start" | "end" | "auto";
|
||||||
links: NavigationLink[];
|
links: NavigationLink[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NavigationOG = Partial<{
|
export type NavigationOG = Partial<{
|
||||||
image: string;
|
image: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export type NavigationLink = {
|
export type NavigationLink = {
|
||||||
title: string;
|
title: string;
|
||||||
href: string;
|
href: string;
|
||||||
og?: NavigationOG;
|
og?: NavigationOG;
|
||||||
subitems: NavigationSubItem[];
|
subitems: NavigationSubItem[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NavigationSubItem = {
|
export type NavigationSubItem = {
|
||||||
title: string;
|
title: string;
|
||||||
href: string;
|
href: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const navigation: NavigationSection[] = [
|
export const navigation: NavigationSection[] = [
|
||||||
{
|
{
|
||||||
title: "Préambule",
|
title: "Préambule",
|
||||||
type: navigationsTypes.GLOBAL,
|
type: navigationsTypes.GLOBAL,
|
||||||
position: "start",
|
position: "start",
|
||||||
links: [
|
links: [
|
||||||
{ title: "Memento Dev", href: "/", subitems: [] },
|
{ title: "Memento Dev", href: "/", subitems: [] },
|
||||||
{ title: "Certifications", href: "/certifications", subitems: [] },
|
{ title: "Certifications", href: "/certifications", subitems: [] },
|
||||||
{ title: "Documentations", href: "/docs", subitems: [] },
|
{ title: "Documentations", href: "/docs", subitems: [] },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Communauté",
|
title: "Communauté",
|
||||||
type: navigationsTypes.GLOBAL,
|
type: navigationsTypes.GLOBAL,
|
||||||
position: "start",
|
position: "start",
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
title: "Influenceurs",
|
title: "Influenceurs",
|
||||||
href: "/communaute/influenceurs",
|
href: "/communaute/influenceurs",
|
||||||
subitems: [],
|
subitems: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Partages et réutilisations",
|
title: "Partages et réutilisations",
|
||||||
href: "/communaute/partages",
|
href: "/communaute/partages",
|
||||||
subitems: [],
|
subitems: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Légal",
|
title: "Légal",
|
||||||
type: navigationsTypes.OTHER,
|
type: navigationsTypes.OTHER,
|
||||||
position: "end",
|
position: "end",
|
||||||
links: [
|
links: [
|
||||||
{ title: "Mentions légales", href: "/mentions-legales", subitems: [] },
|
{ title: "Mentions légales", href: "/mentions-legales", subitems: [] },
|
||||||
{
|
{
|
||||||
title: "Politique de confidentialité",
|
title: "Politique de confidentialité",
|
||||||
href: "/politique-de-confidentialite",
|
href: "/politique-de-confidentialite",
|
||||||
subitems: [],
|
subitems: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Développeur Web et Web Mobile",
|
title: "Développeur Web et Web Mobile",
|
||||||
type: navigationsTypes.CERTIFICATIONS,
|
type: navigationsTypes.CERTIFICATIONS,
|
||||||
position: "auto",
|
position: "auto",
|
||||||
links: [
|
links: [
|
||||||
{ title: "Résumé du titre", href: "/certifications/dwwm", subitems: [] },
|
{ title: "Résumé du titre", href: "/certifications/dwwm", subitems: [] },
|
||||||
{
|
{
|
||||||
title: "Activité Type 1",
|
title: "Activité Type 1",
|
||||||
href: "/certifications/dwwm/at1",
|
href: "/certifications/dwwm/at1",
|
||||||
subitems: [
|
subitems: [
|
||||||
{ title: "Résumé de l'AT", href: "/certifications/dwwm/at1" },
|
{ title: "Résumé de l'AT", href: "/certifications/dwwm/at1" },
|
||||||
{ title: "CP 1", href: "/certifications/dwwm/at1/cp1" },
|
{ title: "CP 1", href: "/certifications/dwwm/at1/cp1" },
|
||||||
{ title: "CP 2", href: "/certifications/dwwm/at1/cp2" },
|
{ title: "CP 2", href: "/certifications/dwwm/at1/cp2" },
|
||||||
{ title: "CP 3", href: "/certifications/dwwm/at1/cp3" },
|
{ title: "CP 3", href: "/certifications/dwwm/at1/cp3" },
|
||||||
{ title: "CP 4", href: "/certifications/dwwm/at1/cp4" },
|
{ title: "CP 4", href: "/certifications/dwwm/at1/cp4" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Activité Type 2",
|
title: "Activité Type 2",
|
||||||
href: "/certifications/dwwm/at2",
|
href: "/certifications/dwwm/at2",
|
||||||
subitems: [
|
subitems: [
|
||||||
{ title: "Résumé de l'AT", href: "/certifications/dwwm/at2" },
|
{ title: "Résumé de l'AT", href: "/certifications/dwwm/at2" },
|
||||||
{ title: "CP 5", href: "/certifications/dwwm/at2/cp5" },
|
{ title: "CP 5", href: "/certifications/dwwm/at2/cp5" },
|
||||||
{ title: "CP 6", href: "/certifications/dwwm/at2/cp6" },
|
{ title: "CP 6", href: "/certifications/dwwm/at2/cp6" },
|
||||||
{ title: "CP 7", href: "/certifications/dwwm/at2/cp7" },
|
{ title: "CP 7", href: "/certifications/dwwm/at2/cp7" },
|
||||||
{ title: "CP 8", href: "/certifications/dwwm/at2/cp8" },
|
{ title: "CP 8", href: "/certifications/dwwm/at2/cp8" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Front-end",
|
title: "Front-end",
|
||||||
type: navigationsTypes.DOCUMENTATIONS,
|
type: navigationsTypes.DOCUMENTATIONS,
|
||||||
position: "auto",
|
position: "auto",
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
title: "React",
|
title: "React",
|
||||||
href: "/docs/react",
|
href: "/docs/react",
|
||||||
subitems: [
|
subitems: [
|
||||||
{ title: "Introduction", href: "/docs/react" },
|
{ title: "Introduction", href: "/docs/react" },
|
||||||
{ title: "Initialisation", href: "/docs/react/initialisation" },
|
{ title: "Initialisation", href: "/docs/react/initialisation" },
|
||||||
{ title: "Syntaxe JSX", href: "/docs/react/jsx" },
|
{ title: "Syntaxe JSX", href: "/docs/react/jsx" },
|
||||||
{ title: "Premier composant", href: "/docs/react/premier-composant" },
|
{ title: "Premier composant", href: "/docs/react/premier-composant" },
|
||||||
{
|
{
|
||||||
title: "State et cycle de vie",
|
title: "State et cycle de vie",
|
||||||
href: "/docs/react/state-et-cycle-de-vie",
|
href: "/docs/react/state-et-cycle-de-vie",
|
||||||
},
|
},
|
||||||
{ title: "Hooks", href: "/docs/react/hooks" },
|
{ title: "Hooks", href: "/docs/react/hooks" },
|
||||||
{ title: "Le hook useContext", href: "/docs/react/use-context" },
|
{ title: "Le hook useContext", href: "/docs/react/use-context" },
|
||||||
{ title: "Le hook useReducer", href: "/docs/react/use-reducer" },
|
{ title: "Le hook useReducer", href: "/docs/react/use-reducer" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
{
|
||||||
},
|
title: "HTML",
|
||||||
{
|
href: "/docs/html",
|
||||||
title: "Base de données",
|
subitems: [{ title: "Introduction", href: "/docs/html" }],
|
||||||
type: navigationsTypes.DOCUMENTATIONS,
|
},
|
||||||
position: "auto",
|
],
|
||||||
links: [
|
},
|
||||||
{
|
{
|
||||||
title: "Merise",
|
title: "Base de données",
|
||||||
href: "/docs/merise",
|
type: navigationsTypes.DOCUMENTATIONS,
|
||||||
og: { image: "/merise/og.webp" },
|
position: "auto",
|
||||||
subitems: [
|
links: [
|
||||||
{ title: "Introduction", href: "/docs/merise" },
|
{
|
||||||
{
|
title: "Merise",
|
||||||
title: "Dictionnaire de données",
|
href: "/docs/merise",
|
||||||
href: "/docs/merise/dictionnaire-de-donnees",
|
og: { image: "/merise/og.webp" },
|
||||||
},
|
subitems: [
|
||||||
{ title: "Modèle Conceptuel de Données", href: "/docs/merise/mcd" },
|
{ title: "Introduction", href: "/docs/merise" },
|
||||||
{ title: "Modèle Logique de Données", href: "/docs/merise/mld" },
|
{
|
||||||
{ title: "Modèle Physique de Données", href: "/docs/merise/mpd" },
|
title: "Dictionnaire de données",
|
||||||
],
|
href: "/docs/merise/dictionnaire-de-donnees",
|
||||||
},
|
},
|
||||||
],
|
{ title: "Modèle Conceptuel de Données", href: "/docs/merise/mcd" },
|
||||||
},
|
{ title: "Modèle Logique de Données", href: "/docs/merise/mld" },
|
||||||
|
{ title: "Modèle Physique de Données", href: "/docs/merise/mpd" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export function doesLinkSubitemExist(
|
export function doesLinkSubitemExist(link: NavigationLink, subitemHref: string): boolean {
|
||||||
link: NavigationLink,
|
return link.subitems.some((subitem) => subitem.href === subitemHref);
|
||||||
subitemHref: string,
|
|
||||||
): boolean {
|
|
||||||
return link.subitems.some((subitem) => subitem.href === subitemHref);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findNavigationLink(
|
export function findNavigationLink(namespace: string, href?: string): NavigationLink | undefined {
|
||||||
namespace: string,
|
const currentUrl = `/${namespace}/${href}`.replace(/\/+/g, "/").replace(/\/$/, "");
|
||||||
href?: string,
|
|
||||||
): NavigationLink | undefined {
|
|
||||||
const currentUrl = `/${namespace}/${href}`
|
|
||||||
.replace(/\/+/g, "/")
|
|
||||||
.replace(/\/$/, "");
|
|
||||||
|
|
||||||
const foundLink = navigation
|
const foundLink = navigation
|
||||||
.flatMap((section) => section.links)
|
.flatMap((section) => section.links)
|
||||||
.find((link) => {
|
.find((link) => {
|
||||||
return link.href === currentUrl || doesLinkSubitemExist(link, currentUrl);
|
return link.href === currentUrl || doesLinkSubitemExist(link, currentUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
return foundLink;
|
return foundLink;
|
||||||
}
|
}
|
||||||
|
|||||||
36
app/pages/docs/html/+Page.mdx
Normal file
36
app/pages/docs/html/+Page.mdx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
title: Introduction au 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";
|
||||||
|
|
||||||
|
HTML est un langage de balisage utilisé pour structurer le contenu des pages web.
|
||||||
|
Bien qu'il ne s'agisse pas d'un langage de programmation à proprement parler, il reste fondamental pour créer des sites web.
|
||||||
|
|
||||||
|
Mais avant de plonger dans le vif du sujet, faisons un petit tour d'horizon de ce qu'est le HTML et pourquoi il est si important.
|
||||||
|
|
||||||
|
## 🤔 Qu'est-ce que le HTML ?
|
||||||
|
|
||||||
|
HTML, ou **HyperText Markup Language**, est le langage standard utilisé pour créer des pages web. Il s'agit d'un langage de balisage qui utilise des **balises** pour structurer le contenu.
|
||||||
|
Il s'agit du squelette d'une page web, qui définit la structure et le contenu de celle-ci.
|
||||||
|
|
||||||
|
<Callout type="question" title="Pourquoi HTML n'est pas un langage de programmation ?">
|
||||||
|
Avant de répondre à cette question, il est important de connaître la définition d'un langage de programmation.
|
||||||
|
|
||||||
|
<Callout type="note" title="Langage de programmation" collapsible>
|
||||||
|
Un langage de programmation est un ensemble de règles et de conventions qui permettent d'écrire des instructions que l'ordinateur peut comprendre et exécuter.
|
||||||
|
Ces instructions peuvent inclure des calculs, des conditions, des boucles, etc.
|
||||||
|
|
||||||
|
Parmis les langages de programmation les plus connus, on peut citer :
|
||||||
|
|
||||||
|
- JavaScript
|
||||||
|
- Python
|
||||||
|
- Java
|
||||||
|
- C++
|
||||||
|
- C#
|
||||||
|
|
||||||
|
et bien d'autres !
|
||||||
|
</Callout>
|
||||||
|
</Callout>
|
||||||
Loading…
Reference in New Issue
Block a user