Injection directe du script stratégie dans le footer
- Script JavaScript injecté directement dans le footer via config.json - Le lien apparaît maintenant dans le footer du radar - Page stratégie créée dynamiquement via JavaScript
This commit is contained in:
52
custom.js
Normal file
52
custom.js
Normal file
@@ -0,0 +1,52 @@
|
||||
// Script personnalisé pour ajouter le lien stratégie - injecté directement
|
||||
(function() {
|
||||
function initStrategyLinks() {
|
||||
addStrategyLinkToFooter();
|
||||
handleStrategyRoute();
|
||||
}
|
||||
|
||||
function handleStrategyRoute() {
|
||||
if (window.location.pathname === '/business/strategie' || window.location.pathname === '/business/strategie.html') {
|
||||
createStrategyPage();
|
||||
}
|
||||
}
|
||||
|
||||
function createStrategyPage() {
|
||||
document.body.innerHTML = `
|
||||
<div style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px; background: #f5f5f5;">
|
||||
<div style="background: white; padding: 40px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
||||
<a href="/business/" style="display: inline-block; margin-bottom: 20px; color: #2ecc71; text-decoration: none; font-weight: bold;">← Retour au Radar</a>
|
||||
<h1 style="color: #1a4d3a; border-bottom: 3px solid #2ecc71; padding-bottom: 10px;">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" style="color: #2ecc71; font-weight: bold;">📋 Voir la stratégie sur GitLab</a></p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function addStrategyLinkToFooter() {
|
||||
const footer = document.querySelector('footer') || document.querySelector('.footer') || document.querySelector('[class*="footer"]');
|
||||
|
||||
if (footer) {
|
||||
const strategyLink = document.createElement('a');
|
||||
strategyLink.href = '/business/strategie';
|
||||
strategyLink.textContent = '📋 Voir la Stratégie';
|
||||
strategyLink.style.marginLeft = '10px';
|
||||
strategyLink.style.color = '#2ecc71';
|
||||
strategyLink.style.textDecoration = 'none';
|
||||
strategyLink.style.fontWeight = 'bold';
|
||||
strategyLink.style.display = 'inline-block';
|
||||
footer.appendChild(strategyLink);
|
||||
} else {
|
||||
setTimeout(addStrategyLinkToFooter, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initStrategyLinks);
|
||||
} else {
|
||||
initStrategyLinks();
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user