Amélioration configuration Docusaurus et implémentation i18n

- Add language switcher to navbar for bilingual site (FR/EN)
- Remove intro page, use presentation as entry point
- Add example pages to all documentation categories
- Configure categories with generated-index for page listings
- Update footer and homepage links to reference presentation
- Enhance configuration with best practices:
  - Add metadata and SEO keywords
  - Enable RSS/Atom feeds for blog
  - Configure sitemap generation
  - Add syntax highlighting for YAML, HCL, Docker
  - Enable Mermaid diagram support
  - Configure table of contents settings
  - Respect user color scheme preferences
  - Add last update metadata to docs
- Fix deprecated onBrokenMarkdownLinks configuration
- Create bilingual example pages with practical code examples
- Update all i18n translations for consistency

This update brings the site in line with Docusaurus 3.x best practices
and provides a solid foundation for documentation growth.
This commit is contained in:
Tellsanguis 2025-11-15 14:57:36 +01:00
parent fda75fdd28
commit aba46f671c
13 changed files with 558 additions and 85 deletions

View file

@ -14,8 +14,11 @@ const config: Config = {
projectName: 'blog_technique',
onBrokenLinks: 'throw',
onBrokenAnchors: 'warn',
markdown: {
format: 'mdx',
mermaid: true,
hooks: {
onBrokenMarkdownLinks: 'warn',
},
@ -45,9 +48,18 @@ const config: Config = {
docs: {
sidebarPath: './sidebars.ts',
editUrl: 'https://github.com/Tellsanguis/blog_technique/tree/main/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
blog: {
showReadingTime: true,
feedOptions: {
type: ['rss', 'atom'],
title: 'TellServ Tech Blog',
description: 'Recherches et réflexions sur les défis techniques',
copyright: `Copyright © ${new Date().getFullYear()} TellServ.`,
language: 'fr',
},
editUrl: 'https://github.com/Tellsanguis/blog_technique/tree/main/',
blogSidebarTitle: 'Articles récents',
blogSidebarCount: 'ALL',
@ -55,12 +67,28 @@ const config: Config = {
theme: {
customCss: './src/css/custom.css',
},
sitemap: {
lastmod: 'date',
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
},
} satisfies Preset.Options,
],
],
themeConfig: {
image: 'img/docusaurus-social-card.jpg',
metadata: [
{name: 'keywords', content: 'homelab, kubernetes, docker, devops, opentofu, ansible, k3s, infrastructure as code'},
{name: 'author', content: 'TellServ'},
],
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: 'TellServ Tech Blog',
logo: {
@ -75,6 +103,10 @@ const config: Config = {
label: 'Documentation',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
type: 'localeDropdown',
position: 'right',
},
{
href: 'https://github.com/Tellsanguis/blog_technique',
label: 'GitHub',
@ -89,8 +121,8 @@ const config: Config = {
title: 'Documentation',
items: [
{
label: 'Introduction',
to: '/docs/intro',
label: 'Présentation',
to: '/docs/presentation',
},
],
},
@ -122,6 +154,11 @@ const config: Config = {
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['bash', 'yaml', 'hcl', 'docker'],
},
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 5,
},
} satisfies Preset.ThemeConfig,
};