fix: corrects content path in stat generation
This commit is contained in:
parent
70b9413e45
commit
bad5a4e838
1 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ function countWords(text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count blog posts and their words
|
// Count blog posts and their words
|
||||||
const postsDir = path.join(root, 'src/content/md');
|
const postsDir = path.join(root, 'content');
|
||||||
const posts = fs.existsSync(postsDir)
|
const posts = fs.existsSync(postsDir)
|
||||||
? fs.readdirSync(postsDir).filter(f => f.endsWith('.md'))
|
? fs.readdirSync(postsDir).filter(f => f.endsWith('.md'))
|
||||||
: [];
|
: [];
|
||||||
|
|
@ -35,7 +35,7 @@ for (const txt of txtFiles) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count bookmarks
|
// Count bookmarks
|
||||||
const bookmarksFile = path.join(root, 'src/content/bookmarks.yaml');
|
const bookmarksFile = path.join(root, 'content/bookmarks.yaml');
|
||||||
const bookmarks = fs.existsSync(bookmarksFile)
|
const bookmarks = fs.existsSync(bookmarksFile)
|
||||||
? yaml.load(fs.readFileSync(bookmarksFile, 'utf-8')) || []
|
? yaml.load(fs.readFileSync(bookmarksFile, 'utf-8')) || []
|
||||||
: [];
|
: [];
|
||||||
|
|
@ -49,7 +49,7 @@ if (fs.existsSync(guestbookJsonFile)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate totals (excluding stats.txt words for now, we'll add them after generating)
|
// Calculate totals (excluding stats.txt words for now, we'll add them after generating)
|
||||||
const totalPages = 1 + 1 + posts.length + 1 + txtFiles.length + 1 + 1; // home, blog index, posts, txt index, txts, bookmarks, guestbook
|
const totalPages = 1 + posts.length + txtFiles.length; // home + individual post pages + txt files
|
||||||
|
|
||||||
// Read template from public/stats.txt and replace placeholders
|
// Read template from public/stats.txt and replace placeholders
|
||||||
const template = fs.readFileSync(path.join(root, 'public/stats.txt'), 'utf-8');
|
const template = fs.readFileSync(path.join(root, 'public/stats.txt'), 'utf-8');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue