feat: exposer le radar business à la racine

This commit is contained in:
syoul
2025-12-02 21:06:59 +01:00
parent 5c29d2b5a4
commit 364adffd96
6 changed files with 26 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
{
"basePath": "/business",
"basePath": "",
"baseUrl": "",
"editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md",
"logoFile": "logo.svg",

View File

@@ -8,7 +8,7 @@
function handleStrategyRoute() {
// Vérifier si on est sur la route stratégie au chargement initial
if (window.location.pathname === '/business/strategie' || window.location.pathname === '/business/strategie.html' || window.location.hash === '#strategie') {
if (window.location.pathname === '/strategie' || window.location.pathname === '/strategie.html' || window.location.hash === '#strategie') {
createStrategyPage();
}
}
@@ -17,7 +17,7 @@
function interceptStrategyLinks() {
document.addEventListener('click', function(e) {
const link = e.target.closest('a');
if (link && (link.href.includes('/business/strategie') || link.getAttribute('href') === '/business/strategie' || link.id === 'strategie-link')) {
if (link && (link.href.includes('/strategie') || link.getAttribute('href') === '/strategie' || link.id === 'strategie-link')) {
e.preventDefault();
e.stopPropagation();
createStrategyPage();
@@ -55,13 +55,13 @@
// Réinitialiser les liens après restauration
setTimeout(initStrategyLinks, 100);
} else {
window.location.href = '/business/';
window.location.href = '/';
}
});
}
// Mettre à jour l'URL sans recharger la page
window.history.pushState({page: 'strategie'}, 'Stratégie', '/business/strategie');
window.history.pushState({page: 'strategie'}, 'Stratégie', '/strategie');
}
function addStrategyLinkToFooter() {

View File

@@ -15,7 +15,7 @@
function handleStrategyRoute() {
// Vérifier si on est sur la route stratégie
if (window.location.pathname === '/business/strategie' || window.location.pathname === '/business/strategie.html') {
if (window.location.pathname === '/strategie' || window.location.pathname === '/strategie.html') {
createStrategyPage();
}
}
@@ -72,7 +72,7 @@
</head>
<body>
<div class="container">
<a href="/business/" class="back-link">← Retour au Radar</a>
<a href="/" class="back-link">← Retour au Radar</a>
<h1>Stratégie d'Évolution Technique - Laplank</h1>
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
<p>Cette page est en cours de chargement...</p>
@@ -90,7 +90,7 @@
const container = document.querySelector('.container');
if (container) {
container.innerHTML = `
<a href="/business/" class="back-link">← Retour au Radar</a>
<a href="/" class="back-link">← Retour au Radar</a>
<h1>Stratégie d'Évolution Technique - Laplank</h1>
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
<p>La stratégie complète est disponible dans le dépôt Git :</p>
@@ -107,7 +107,7 @@
if (footer) {
// Créer le lien vers la stratégie
const strategyLink = document.createElement('a');
strategyLink.href = '/business/strategie';
strategyLink.href = '/strategie';
strategyLink.textContent = '📋 Voir la Stratégie';
strategyLink.style.marginLeft = '10px';
strategyLink.style.color = '#2ecc71';
@@ -129,7 +129,7 @@
if (header) {
const strategyLink = document.createElement('a');
strategyLink.href = '/business/strategie';
strategyLink.href = '/strategie';
strategyLink.textContent = 'Stratégie';
strategyLink.style.marginLeft = '15px';
strategyLink.style.color = '#2ecc71';

View File

@@ -711,15 +711,21 @@ Interface de pilotage pour les responsables sécurité des PME.
handleRoute();
}
function normalizePath(pathname) {
if (!pathname) return '/';
const cleaned = pathname.replace(/\/+$/, '');
return cleaned === '' ? '/' : cleaned;
}
function handleRoute() {
const path = window.location.pathname;
const path = normalizePath(window.location.pathname);
const hash = window.location.hash;
// Détection simple
if (hash === '#strategie' || path.includes('/strategie')) showPage('strategie');
else if (hash === '#business' || path.includes('/business-strat')) showPage('business');
else if (hash === '#dataviz' || path.includes('/dataviz')) showPage('dataviz');
else if (hash === '#dataviz-details' || path.includes('/dataviz-details')) showPage('dataviz-details');
if (hash === '#strategie' || path === '/strategie') showPage('strategie');
else if (hash === '#business' || path === '/business') showPage('business');
else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz');
else if (hash === '#dataviz-details' || path === '/dataviz-details') showPage('dataviz-details');
}
function showPage(pageId) {
@@ -757,10 +763,10 @@ Interface de pilotage pour les responsables sécurité des PME.
e.preventDefault();
if (window.originalBodyContent) {
document.body.innerHTML = window.originalBodyContent;
window.history.pushState(null, null, window.location.pathname.replace(/\/business\/.*$/, '/business/'));
window.history.pushState(null, null, '/');
setTimeout(initStrategyLinks, 100);
} else {
window.location.href = '/business/';
window.location.href = '/';
}
});
@@ -772,7 +778,7 @@ Interface de pilotage pour les responsables sécurité des PME.
});
});
window.history.pushState({page: pageId}, pageTitles[pageId], `/business/${pageId}`);
window.history.pushState({page: pageId}, pageTitles[pageId], `/${pageId}`);
}
function styleContent() {

View File

@@ -75,7 +75,7 @@
</head>
<body>
<div class="container">
<a href="/business/" class="back-link">← Retour au Radar</a>
<a href="/" class="back-link">← Retour au Radar</a>
<h1>Stratégie d'Évolution Technique - Laplank</h1>
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>

View File

@@ -1,5 +1,5 @@
{
"basePath": "/business",
"basePath": "",
"baseUrl": "",
"editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md",
"logoFile": "logo.svg",