rename content/post to content/posts
This commit is contained in:
1 parent
43d3e3a4f8
commit
1cae1da5ec
866 files changed
+43
-25
No files matched your search
@@ -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,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 });
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user