mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-02 06:24:16 +02:00
docs: move English sources into docs/en/ locale folder (#5501)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,7 @@ const path = require("path");
|
||||
const { forEachDocPage } = require("./lib/frontmatter");
|
||||
|
||||
const REPO_ROOT = path.resolve(process.argv[2] || ".");
|
||||
const DOCS_DIR = path.join(REPO_ROOT, "docs");
|
||||
const DOCS_DIR = path.join(REPO_ROOT, "docs", "en");
|
||||
|
||||
// Map of feature module directory names to expected doc page slugs.
|
||||
// Modules not listed here are considered internal (no user-facing docs required).
|
||||
|
||||
@@ -13,7 +13,7 @@ const { parseFrontmatter, forEachDocPage } = require("./lib/frontmatter");
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const positional = args.filter(a => !a.startsWith("--"));
|
||||
const DOCS_DIR = path.resolve(positional[0] || "docs");
|
||||
const DOCS_DIR = path.resolve(positional[0] || path.join("docs", "en"));
|
||||
|
||||
const maxAgeArg = args.find(a => a.startsWith("--max-age-days="));
|
||||
const MAX_AGE_DAYS = maxAgeArg ? parseInt(maxAgeArg.split("=")[1], 10) : 180;
|
||||
|
||||
@@ -37,8 +37,8 @@ const IMAGE_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".gif", ".svg", ".web
|
||||
const ANDROID_REPO_ROOT = positionalArgs.length > 0
|
||||
? path.resolve(positionalArgs[0])
|
||||
: path.resolve(__dirname, "..");
|
||||
const SRC_DOCS_DIR = path.join(ANDROID_REPO_ROOT, "docs");
|
||||
const SRC_SCREENSHOTS_DIR = path.join(SRC_DOCS_DIR, "assets", "screenshots");
|
||||
const SRC_DOCS_DIR = path.join(ANDROID_REPO_ROOT, "docs", "en");
|
||||
const SRC_SCREENSHOTS_DIR = path.join(ANDROID_REPO_ROOT, "docs", "assets", "screenshots");
|
||||
|
||||
if (!fs.existsSync(SRC_DOCS_DIR)) {
|
||||
console.error(`Error: docs directory not found at ${SRC_DOCS_DIR}`);
|
||||
|
||||
@@ -11,7 +11,9 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { discoverSlugs, forEachDocPage } = require("./lib/frontmatter");
|
||||
|
||||
const DOCS_DIR = path.resolve(process.argv[2] || "docs");
|
||||
const DOCS_DIR = path.resolve(process.argv[2] || path.join("docs", "en"));
|
||||
// Assets (screenshots) live at docs/ root, not inside the en/ locale folder
|
||||
const DOCS_ROOT = path.resolve(DOCS_DIR, "..");
|
||||
const IMAGE_EXTS = new Set([".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp"]);
|
||||
|
||||
// Collect known page slugs from both sections
|
||||
@@ -64,7 +66,7 @@ forEachDocPage(DOCS_DIR, (filePath, slug, section) => {
|
||||
if (/^https?:/.test(imgPath)) continue;
|
||||
|
||||
const resolved = imgPath.startsWith("/")
|
||||
? path.join(DOCS_DIR, imgPath)
|
||||
? path.join(DOCS_ROOT, imgPath)
|
||||
: path.resolve(path.dirname(filePath), imgPath);
|
||||
if (!fs.existsSync(resolved)) {
|
||||
console.log(` ERROR: ${section}/${slug}.md:${lineNum} — missing image '${imgPath}'`);
|
||||
|
||||
Reference in New Issue
Block a user