update at 2025-09-22 18:54:59
This commit is contained in:
@@ -270,6 +270,48 @@ export class NoteToMpSettingTab extends PluginSettingTab {
|
||||
});
|
||||
})
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Gallery 根路径')
|
||||
.setDesc('用于 {{<gallery dir="..."/>}} 短代码解析;需指向本地图片根目录')
|
||||
.addText(text => {
|
||||
text.setPlaceholder('例如 /Users/xxx/site/static 或 相对路径')
|
||||
.setValue(this.settings.galleryPrePath || '')
|
||||
.onChange(async (value) => {
|
||||
this.settings.galleryPrePath = value.trim();
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
text.inputEl.setAttr('style', 'width: 360px;');
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Gallery 选取图片数')
|
||||
.setDesc('每个 gallery 短代码最多替换为前 N 张图片')
|
||||
.addText(text => {
|
||||
text.setPlaceholder('数字 >=1')
|
||||
.setValue(String(this.settings.galleryNumPic || 2))
|
||||
.onChange(async (value) => {
|
||||
const n = parseInt(value, 10);
|
||||
if (Number.isFinite(n) && n >= 1) {
|
||||
this.settings.galleryNumPic = n;
|
||||
await this.plugin.saveSettings();
|
||||
}
|
||||
});
|
||||
text.inputEl.setAttr('style', 'width: 120px;');
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('默认封面图片')
|
||||
.setDesc('当文章无任何图片/短代码时使用;可填 wikilink 文件名或 http(s) URL')
|
||||
.addText(text => {
|
||||
text.setPlaceholder('例如 cover.png 或 https://...')
|
||||
.setValue(this.settings.defaultCoverPic || '')
|
||||
.onChange(async (value) => {
|
||||
this.settings.defaultCoverPic = value.trim();
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
text.inputEl.setAttr('style', 'width: 360px;');
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('启用空行渲染')
|
||||
.addToggle(toggle => {
|
||||
|
||||
Reference in New Issue
Block a user