rename content/post to content/posts

This commit is contained in:
Vaica committed 2026-06-02 15:37:49 +08:00
1 parent cda4dbb24b
commit bcd4bc9282
866 files changed
+43 -25

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@
将所有包含 'status: hidden' 的文章标记为草稿 (draft: true),并清理冲突的设置。
.DESCRIPTION
此脚本用于批量处理 Hugo 文章。它会遍历 content/post 目录下的所有 .md 文件。
此脚本用于批量处理 Hugo 文章。它会遍历 content/posts 目录下的所有 .md 文件。
如果发现 'status: hidden':
1. 将 'draft: false' 修改为 'draft: true'。
2. 注释掉冲突的 'status: public' 设置。
@@ -19,7 +19,7 @@
.\scripts\add_draft_to_hidden.ps1
#>
$postsPath = "content/post"
$postsPath = "content/posts"
# Ensure path exists
if (-not (Test-Path $postsPath)) {
Write-Error "Path not found: $postsPath"
+1 -1
View File
@@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');
const CONTENT_DIR = path.join(__dirname, '../content/post');
const CONTENT_DIR = path.join(__dirname, '../content/posts');
async function processDirectory(dir) {
const entries = fs.readdirSync(dir, { withFileTypes: true });
+1 -1
View File
@@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');
const matter = require('gray-matter');
const POSTS_DIR = path.join(__dirname, '../content/post');
const POSTS_DIR = path.join(__dirname, '../content/posts');
function parseDateFlexible(input) {
if (input instanceof Date) return Number.isNaN(input.getTime()) ? null : input;
+1 -1
View File
@@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');
const matter = require('gray-matter');
const postsDir = path.resolve(__dirname, '../content/post');
const postsDir = path.resolve(__dirname, '../content/posts');
function formatDate(date) {
if (!date) return null;
+1 -1
View File
@@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');
const sharp = require('sharp');
const CONTENT_DIR = path.join(__dirname, '../content/post');
const CONTENT_DIR = path.join(__dirname, '../content/posts');
const MAX_SIZE_BYTES = 1 * 1024 * 1024; // 1MB
async function processDirectory(dir) {