update at 2025-09-25 22:35:01

This commit is contained in:
douboer
2025-09-25 22:35:01 +08:00
parent a60cdd593c
commit c9ce811ce9
11 changed files with 1192 additions and 21 deletions

View File

@@ -3,7 +3,12 @@
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
if (ignoreFrontmatterImage !== undefined) {
settings.ignoreFrontmatterImage = ignoreFrontmatterImage;
}
if (Array.isArray(batchPublishPresets)) {
settings.batchPublishPresets = batchPublishPresets;
}n the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@@ -51,6 +56,13 @@ export class NMPSettings {
defaultCoverPic: string;
// 是否忽略 frontmatter 中的 cover/image 字段(用户要求:封面不使用 frontmatter image
ignoreFrontmatterImage: boolean;
// 批量发布筛选条件预设
batchPublishPresets: Array<{
name: string;
tags?: string[];
folders?: string[];
filenameKeywords?: string[];
}>;
private static instance: NMPSettings;
@@ -86,7 +98,16 @@ export class NMPSettings {
this.galleryNumPic = 2;
// 默认封面:使用当前笔记同目录下的 cover.png (若存在会被后续流程正常解析;不存在则无效但可被用户覆盖)
this.defaultCoverPic = 'cover.png';
this.ignoreFrontmatterImage = false;
this.ignoreFrontmatterImage = false;
// 批量发布预设
this.batchPublishPresets = [
{
name: '篆刻文章',
tags: ['篆刻'],
folders: [],
filenameKeywords: []
}
];
}
resetStyelAndHighlight() {
@@ -121,6 +142,7 @@ export class NMPSettings {
galleryNumPic,
defaultCoverPic,
ignoreFrontmatterImage,
batchPublishPresets = [],
} = data;
const settings = NMPSettings.getInstance();