mirror of
https://github.com/mleem97/gregWiki.git
synced 2026-04-11 11:39:18 +02:00
- Changed project title and tagline in docusaurus.config.js to reflect the new branding. - Updated package.json and package-lock.json to rename the project to gregwiki-docs-site. - Adjusted sidebar and documentation files to align with the new project structure and naming conventions. - Enhanced documentation content for clarity and consistency across various sections. - Added Prettier as a development dependency for code formatting. This commit aligns the project with the new branding and improves overall documentation quality.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
/**
|
|
* 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/legacy/wiki-import'),
|
|
path.resolve(
|
|
import.meta.dirname,
|
|
'../i18n/de/docusaurus-plugin-content-docs/current/legacy/wiki-import',
|
|
),
|
|
];
|
|
for (const r of roots) {
|
|
if (fs.existsSync(r)) walk(r);
|
|
}
|