99fb7f0e82
- Created a new sitemap.xml file for better SEO. - Added a compressed version of the sitemap as sitemap.xml.gz. - Introduced extra.css for custom styles, including Persian font support (IRANSansX). - Defined font-face rules for regular and bold styles of IRANSansX. - Implemented various text styles and layout adjustments for better readability. - Enhanced Mermaid diagram styles to support Persian text rendering.
26 lines
819 B
JavaScript
26 lines
819 B
JavaScript
(function () {
|
|
function initMermaid() {
|
|
if (window.mermaid && typeof window.mermaid.initialize === 'function') {
|
|
try {
|
|
// Initialize once per page render; SPA transitions are handled below
|
|
window.mermaid.initialize({ startOnLoad: false, securityLevel: 'loose' });
|
|
window.mermaid.init(undefined, document.querySelectorAll('.mermaid'));
|
|
} catch (e) {
|
|
console.warn('Mermaid init failed:', e);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Initial load
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', initMermaid);
|
|
} else {
|
|
initMermaid();
|
|
}
|
|
|
|
// Re-init on MkDocs Material page transitions (instant loading)
|
|
if (window.document$ && typeof window.document$.subscribe === 'function') {
|
|
window.document$.subscribe(initMermaid);
|
|
}
|
|
})();
|