Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/llms-txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function collectMarkdownFiles(dir: string, base: string = dir): MarkdownFile[] {
const fullPath = join(dir, entry);
const stat = statSync(fullPath);

if (stat.isDirectory() && !entry.startsWith('.') && entry !== 'node_modules') {
const SKIP_DIRS = new Set(['node_modules', 'public', 'dist', '.next', '.nuxt', '.output', '.open-next', 'coverage', '__tests__', '__mocks__']);
if (stat.isDirectory() && !entry.startsWith('.') && !SKIP_DIRS.has(entry)) {
files.push(...collectMarkdownFiles(fullPath, base));
} else if (stat.isFile() && (extname(entry) === '.md' || extname(entry) === '.mdx')) {
const content = readFileSync(fullPath, 'utf-8');
Expand Down
3 changes: 2 additions & 1 deletion src/core/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function collectUrls(dir: string, config: ResolvedAeoConfig, base: string = dir)
const fullPath = join(dir, entry);
const stat = statSync(fullPath);

if (stat.isDirectory() && !entry.startsWith('.') && entry !== 'node_modules') {
const SKIP_DIRS = new Set(['node_modules', 'public', 'dist', '.next', '.nuxt', '.output', '.open-next', 'coverage', '__tests__', '__mocks__']);
if (stat.isDirectory() && !entry.startsWith('.') && !SKIP_DIRS.has(entry)) {
urls.push(...collectUrls(fullPath, config, base));
} else if (stat.isFile() && (extname(entry) === '.md' || extname(entry) === '.mdx' || extname(entry) === '.html')) {
const relativePath = relative(base, fullPath);
Expand Down
9 changes: 6 additions & 3 deletions src/plugins/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ export function withAeo(nextConfig: NextAeoConfig = {}): Record<string, any> {
}
}

// Resolve contentDir: prefer user-specified, then src/, then project root
// Resolve contentDir: prefer user-specified, then known content dirs, then src/
// Never fall back to project root — it causes recursive crawling of public/, .next/, etc.
const contentDir = aeoOptions.contentDir
|| (existsSync(join(projectRoot, 'src')) ? join(projectRoot, 'src') : projectRoot);
|| [join(projectRoot, 'content'), join(projectRoot, 'docs'), join(projectRoot, 'src')].find(d => existsSync(d))
|| join(projectRoot, 'content');

const resolvedConfig = resolveConfig({
...aeoOptions,
Expand Down Expand Up @@ -247,7 +249,8 @@ export async function postBuild(config: AeoConfig = {}): Promise<void> {
}

const contentDir = config.contentDir
|| (existsSync(join(projectRoot, 'src')) ? join(projectRoot, 'src') : projectRoot);
|| [join(projectRoot, 'content'), join(projectRoot, 'docs'), join(projectRoot, 'src')].find(d => existsSync(d))
|| join(projectRoot, 'content');

const resolvedConfig = resolveConfig({
...config,
Expand Down
Binary file added website/public/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading