Skip to content

Commit 5e8028b

Browse files
committed
fix: regenerate documentation with proper links
1 parent b069495 commit 5e8028b

File tree

63 files changed

+551671
-306612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+551671
-306612
lines changed

docs/.scripts/fix-doc-links.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { readFile, writeFile } from 'fs/promises';
2+
3+
const SCRIPT_TO_INJECT = `<script>
4+
document.querySelectorAll('a[href^="https://"]').forEach(link => {
5+
if (!link.href.startsWith('https://xeokit.github.io/xeokit-bim-viewer/docs')) {
6+
link.setAttribute('target', '_blank');
7+
link.setAttribute('rel', 'noopener noreferrer');
8+
}
9+
});
10+
</script>`;
11+
12+
const filePath = './docs/index.html';
13+
let content = await readFile(filePath, 'utf-8');
14+
content = content.replace('</body>', `${SCRIPT_TO_INJECT}\n</body>`);
15+
await writeFile(filePath, content);
16+
console.log('Processed: docs/index.html');

0 commit comments

Comments
 (0)