mirror of
https://github.com/mleem97/gregWiki.git
synced 2026-04-11 03:29:19 +02:00
Merge Docusaurus site: all content under docs/, align with gregFramework split layout
- Move markdown and wiki-import tree into docs/; keep app shell at repo root - Point docusaurus docs path to docs/; edit links to mleem97/gregWiki - Sync and i18n scripts use gregWiki root and ../.wiki under gregFramework - Sidebars: workspace layout from root docs ids; plugins under mods/extensions - Fix redirects, module catalog URLs, release note paths, and wiki-import category keys - Update repo inventory for split repos; Dockerfile for single-repo context Made-with: Cursor
This commit is contained in:
36
scripts/fix-wiki-import-en-links.mjs
Normal file
36
scripts/fix-wiki-import-en-links.mjs
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* One-off helper: strip legacy -en suffixes from markdown links after i18n normalize.
|
||||
* Run from gregWiki root: node scripts/fix-wiki-import-en-links.mjs
|
||||
*/
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
function walk(dir) {
|
||||
for (const ent of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
const p = path.join(dir, ent.name);
|
||||
if (ent.isDirectory()) walk(p);
|
||||
else if (ent.name.endsWith('.md')) {
|
||||
let s = fs.readFileSync(p, 'utf8');
|
||||
const orig = s;
|
||||
s = s.replace(/Troubleshooting\/Troubleshooting-en/g, 'Troubleshooting/overview');
|
||||
s = s.replace(/\.\.\/Troubleshooting\/Troubleshooting-en/g, '../Troubleshooting/overview');
|
||||
s = s.replace(/\(Troubleshooting-en\)/g, '(overview)');
|
||||
s = s.replace(/([a-zA-Z0-9/_.-])-en\)/g, '$1)');
|
||||
if (s !== orig) {
|
||||
fs.writeFileSync(p, s);
|
||||
console.log('updated', p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const roots = [
|
||||
path.resolve(import.meta.dirname, '../docs/wiki-import'),
|
||||
path.resolve(
|
||||
import.meta.dirname,
|
||||
'../i18n/de/docusaurus-plugin-content-docs/current/wiki-import',
|
||||
),
|
||||
];
|
||||
for (const r of roots) {
|
||||
if (fs.existsSync(r)) walk(r);
|
||||
}
|
||||
Reference in New Issue
Block a user