feat: exposer le radar business à la racine
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"basePath": "/business",
|
"basePath": "",
|
||||||
"baseUrl": "",
|
"baseUrl": "",
|
||||||
"editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md",
|
"editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md",
|
||||||
"logoFile": "logo.svg",
|
"logoFile": "logo.svg",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
function handleStrategyRoute() {
|
function handleStrategyRoute() {
|
||||||
// Vérifier si on est sur la route stratégie au chargement initial
|
// 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();
|
createStrategyPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
function interceptStrategyLinks() {
|
function interceptStrategyLinks() {
|
||||||
document.addEventListener('click', function(e) {
|
document.addEventListener('click', function(e) {
|
||||||
const link = e.target.closest('a');
|
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.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
createStrategyPage();
|
createStrategyPage();
|
||||||
@@ -55,13 +55,13 @@
|
|||||||
// Réinitialiser les liens après restauration
|
// Réinitialiser les liens après restauration
|
||||||
setTimeout(initStrategyLinks, 100);
|
setTimeout(initStrategyLinks, 100);
|
||||||
} else {
|
} else {
|
||||||
window.location.href = '/business/';
|
window.location.href = '/';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mettre à jour l'URL sans recharger la page
|
// 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() {
|
function addStrategyLinkToFooter() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
function handleStrategyRoute() {
|
function handleStrategyRoute() {
|
||||||
// Vérifier si on est sur la route stratégie
|
// 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();
|
createStrategyPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<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>
|
<h1>Stratégie d'Évolution Technique - Laplank</h1>
|
||||||
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
|
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
|
||||||
<p>Cette page est en cours de chargement...</p>
|
<p>Cette page est en cours de chargement...</p>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
const container = document.querySelector('.container');
|
const container = document.querySelector('.container');
|
||||||
if (container) {
|
if (container) {
|
||||||
container.innerHTML = `
|
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>
|
<h1>Stratégie d'Évolution Technique - Laplank</h1>
|
||||||
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
|
<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>
|
<p>La stratégie complète est disponible dans le dépôt Git :</p>
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
if (footer) {
|
if (footer) {
|
||||||
// Créer le lien vers la stratégie
|
// Créer le lien vers la stratégie
|
||||||
const strategyLink = document.createElement('a');
|
const strategyLink = document.createElement('a');
|
||||||
strategyLink.href = '/business/strategie';
|
strategyLink.href = '/strategie';
|
||||||
strategyLink.textContent = '📋 Voir la Stratégie';
|
strategyLink.textContent = '📋 Voir la Stratégie';
|
||||||
strategyLink.style.marginLeft = '10px';
|
strategyLink.style.marginLeft = '10px';
|
||||||
strategyLink.style.color = '#2ecc71';
|
strategyLink.style.color = '#2ecc71';
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
if (header) {
|
if (header) {
|
||||||
const strategyLink = document.createElement('a');
|
const strategyLink = document.createElement('a');
|
||||||
strategyLink.href = '/business/strategie';
|
strategyLink.href = '/strategie';
|
||||||
strategyLink.textContent = 'Stratégie';
|
strategyLink.textContent = 'Stratégie';
|
||||||
strategyLink.style.marginLeft = '15px';
|
strategyLink.style.marginLeft = '15px';
|
||||||
strategyLink.style.color = '#2ecc71';
|
strategyLink.style.color = '#2ecc71';
|
||||||
|
|||||||
@@ -711,15 +711,21 @@ Interface de pilotage pour les responsables sécurité des PME.
|
|||||||
handleRoute();
|
handleRoute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizePath(pathname) {
|
||||||
|
if (!pathname) return '/';
|
||||||
|
const cleaned = pathname.replace(/\/+$/, '');
|
||||||
|
return cleaned === '' ? '/' : cleaned;
|
||||||
|
}
|
||||||
|
|
||||||
function handleRoute() {
|
function handleRoute() {
|
||||||
const path = window.location.pathname;
|
const path = normalizePath(window.location.pathname);
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
|
|
||||||
// Détection simple
|
// Détection simple
|
||||||
if (hash === '#strategie' || path.includes('/strategie')) showPage('strategie');
|
if (hash === '#strategie' || path === '/strategie') showPage('strategie');
|
||||||
else if (hash === '#business' || path.includes('/business-strat')) showPage('business');
|
else if (hash === '#business' || path === '/business') showPage('business');
|
||||||
else if (hash === '#dataviz' || path.includes('/dataviz')) showPage('dataviz');
|
else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz');
|
||||||
else if (hash === '#dataviz-details' || path.includes('/dataviz-details')) showPage('dataviz-details');
|
else if (hash === '#dataviz-details' || path === '/dataviz-details') showPage('dataviz-details');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPage(pageId) {
|
function showPage(pageId) {
|
||||||
@@ -757,10 +763,10 @@ Interface de pilotage pour les responsables sécurité des PME.
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (window.originalBodyContent) {
|
if (window.originalBodyContent) {
|
||||||
document.body.innerHTML = 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);
|
setTimeout(initStrategyLinks, 100);
|
||||||
} else {
|
} 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() {
|
function styleContent() {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<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>
|
<h1>Stratégie d'Évolution Technique - Laplank</h1>
|
||||||
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
|
<p><strong>Date de mise à jour</strong> : 02/12/2025</p>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"basePath": "/business",
|
"basePath": "",
|
||||||
"baseUrl": "",
|
"baseUrl": "",
|
||||||
"editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md",
|
"editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md",
|
||||||
"logoFile": "logo.svg",
|
"logoFile": "logo.svg",
|
||||||
|
|||||||
Reference in New Issue
Block a user