aeo.js 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/next.mjs CHANGED
@@ -281,7 +281,8 @@ function collectMarkdownFiles(dir, base = dir) {
281
281
  for (const entry of entries) {
282
282
  const fullPath = join(dir, entry);
283
283
  const stat = statSync(fullPath);
284
- if (stat.isDirectory() && !entry.startsWith(".") && entry !== "node_modules") {
284
+ const SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", "public", "dist", ".next", ".nuxt", ".output", ".open-next", "coverage", "__tests__", "__mocks__"]);
285
+ if (stat.isDirectory() && !entry.startsWith(".") && !SKIP_DIRS.has(entry)) {
285
286
  files.push(...collectMarkdownFiles(fullPath, base));
286
287
  } else if (stat.isFile() && (extname(entry) === ".md" || extname(entry) === ".mdx")) {
287
288
  const content = readFileSync(fullPath, "utf-8");
@@ -624,7 +625,8 @@ function collectUrls(dir, config, base = dir) {
624
625
  for (const entry of entries) {
625
626
  const fullPath = join(dir, entry);
626
627
  const stat = statSync(fullPath);
627
- if (stat.isDirectory() && !entry.startsWith(".") && entry !== "node_modules") {
628
+ const SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", "public", "dist", ".next", ".nuxt", ".output", ".open-next", "coverage", "__tests__", "__mocks__"]);
629
+ if (stat.isDirectory() && !entry.startsWith(".") && !SKIP_DIRS.has(entry)) {
628
630
  urls.push(...collectUrls(fullPath, config, base));
629
631
  } else if (stat.isFile() && (extname(entry) === ".md" || extname(entry) === ".mdx" || extname(entry) === ".html")) {
630
632
  const relativePath = relative(base, fullPath);
@@ -1207,7 +1209,7 @@ function withAeo(nextConfig = {}) {
1207
1209
  page.description = aeoOptions.description;
1208
1210
  }
1209
1211
  }
1210
- const contentDir = aeoOptions.contentDir || (existsSync(join(projectRoot, "src")) ? join(projectRoot, "src") : projectRoot);
1212
+ const contentDir = aeoOptions.contentDir || [join(projectRoot, "content"), join(projectRoot, "docs"), join(projectRoot, "src")].find((d) => existsSync(d)) || join(projectRoot, "content");
1211
1213
  const resolvedConfig = resolveConfig({
1212
1214
  ...aeoOptions,
1213
1215
  outDir: aeoOptions.outDir || join(projectRoot, "public"),
@@ -1327,7 +1329,7 @@ async function postBuild(config = {}) {
1327
1329
  page.description = config.description;
1328
1330
  }
1329
1331
  }
1330
- const contentDir = config.contentDir || (existsSync(join(projectRoot, "src")) ? join(projectRoot, "src") : projectRoot);
1332
+ const contentDir = config.contentDir || [join(projectRoot, "content"), join(projectRoot, "docs"), join(projectRoot, "src")].find((d) => existsSync(d)) || join(projectRoot, "content");
1331
1333
  const resolvedConfig = resolveConfig({
1332
1334
  ...config,
1333
1335
  outDir: config.outDir || join(projectRoot, "public"),