Correction : Page stratégie créée dynamiquement via JavaScript
- La page stratégie est maintenant créée dynamiquement via JS - Lien vers le fichier Markdown dans le dépôt GitLab - Fonctionne avec le basePath /business de Next.js
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Script pour ajouter un lien vers la stratégie dans le footer et le header
|
// Script pour ajouter un lien vers la stratégie et créer une page dynamique
|
||||||
(function() {
|
(function() {
|
||||||
// Attendre que le DOM soit chargé
|
// Attendre que le DOM soit chargé
|
||||||
if (document.readyState === 'loading') {
|
if (document.readyState === 'loading') {
|
||||||
@@ -10,6 +10,94 @@
|
|||||||
function initStrategyLinks() {
|
function initStrategyLinks() {
|
||||||
addStrategyLinkToFooter();
|
addStrategyLinkToFooter();
|
||||||
addStrategyLinkToHeader();
|
addStrategyLinkToHeader();
|
||||||
|
handleStrategyRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleStrategyRoute() {
|
||||||
|
// Vérifier si on est sur la route stratégie
|
||||||
|
if (window.location.pathname === '/business/strategie' || window.location.pathname === '/business/strategie.html') {
|
||||||
|
createStrategyPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStrategyPage() {
|
||||||
|
// Créer une page complète pour la stratégie
|
||||||
|
document.body.innerHTML = `
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Stratégie d'Évolution Technique - Laplank</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #333;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
background: white;
|
||||||
|
padding: 40px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #1a4d3a;
|
||||||
|
border-bottom: 3px solid #2ecc71;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
color: #2ecc71;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
color: #3498db;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.back-link {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #2ecc71;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.back-link:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<a href="/business/" 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>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Charger le contenu depuis le fichier Markdown ou l'afficher directement
|
||||||
|
loadStrategyContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadStrategyContent() {
|
||||||
|
// Pour l'instant, afficher un message et rediriger vers le fichier Markdown dans le repo
|
||||||
|
const container = document.querySelector('.container');
|
||||||
|
if (container) {
|
||||||
|
container.innerHTML = `
|
||||||
|
<a href="/business/" 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>
|
||||||
|
<p><a href="https://git.open.us.org/AJR/TechradarDev/-/blob/dev-biz/docs/strategie-evolution-technique.md" target="_blank">Voir la stratégie sur GitLab</a></p>
|
||||||
|
<p>Ou consultez le fichier local : <code>docs/strategie-evolution-technique.md</code></p>
|
||||||
|
`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addStrategyLinkToFooter() {
|
function addStrategyLinkToFooter() {
|
||||||
@@ -19,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 = '/strategie.html';
|
strategyLink.href = '/business/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';
|
||||||
@@ -41,7 +129,7 @@
|
|||||||
|
|
||||||
if (header) {
|
if (header) {
|
||||||
const strategyLink = document.createElement('a');
|
const strategyLink = document.createElement('a');
|
||||||
strategyLink.href = '/strategie.html';
|
strategyLink.href = '/business/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';
|
||||||
@@ -52,4 +140,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user