feat(post): 增加隐藏图片名称的配置,#26

This commit is contained in:
nineya 2023-07-14 10:50:27 +08:00
parent 50596ec29d
commit 7d6563a7d0
4 changed files with 12 additions and 2 deletions

View File

@ -453,6 +453,15 @@ spec:
label: 正文长图折叠 label: 正文长图折叠
placeholder: '请输入高度数值px' placeholder: '请输入高度数值px'
help: '图片高度超出指定高度px后默认进行折叠指定的高度需大于等于 400px。' help: '图片高度超出指定高度px后默认进行折叠指定的高度需大于等于 400px。'
- $formkit: radio
name: show_img_name
label: 显示图片名称
value: true
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: text - $formkit: text
name: invalid_tips_day name: invalid_tips_day
label: 文章失效提示 label: 文章失效提示

View File

@ -62,7 +62,7 @@ const commonContext = {
$('.main-content img:not(.not-gallery)').each(function () { $('.main-content img:not(.not-gallery)').each(function () {
if ($(this).parents('[data-fancybox],mew-photos').length === 0) { if ($(this).parents('[data-fancybox],mew-photos').length === 0) {
$(this).wrap(`<div class="gallery-item"><div data-fancybox="gallery" ${this.alt ? `data-caption="${this.alt}"` : ''} href="${$(this).attr('src') $(this).wrap(`<div class="gallery-item"><div data-fancybox="gallery" ${this.alt ? `data-caption="${this.alt}"` : ''} href="${$(this).attr('src')
}"></div>${this.alt ? `<p>${this.alt}</p>` : ''}</div>`) }"></div>${(this.alt && DreamConfig.show_img_name) ? `<p>${this.alt}</p>` : ''}</div>`)
} }
}) })
}, },

File diff suppressed because one or more lines are too long

View File

@ -80,6 +80,7 @@
[(${theme.config.enhance.effects_circle_magic_mode != 'none'?'DreamConfig["effects_circle_magic_mode"] = "' + theme.config.enhance.effects_circle_magic_mode + '";': ''})] [(${theme.config.enhance.effects_circle_magic_mode != 'none'?'DreamConfig["effects_circle_magic_mode"] = "' + theme.config.enhance.effects_circle_magic_mode + '";': ''})]
[(${theme.config.enhance.enable_baidu_push?'DreamConfig["enable_baidu_push"] = true;': ''})] [(${theme.config.enhance.enable_baidu_push?'DreamConfig["enable_baidu_push"] = true;': ''})]
[(${theme.config.enhance.enable_toutiao_push?'DreamConfig["enable_toutiao_push"] = true;': ''})] [(${theme.config.enhance.enable_toutiao_push?'DreamConfig["enable_toutiao_push"] = true;': ''})]
[(${theme.config.post.show_img_name?'DreamConfig["show_img_name"] = true;': ''})]
[(${theme.config.basic_style.load_progress != 'none'?'DreamConfig["load_progress"] = "' + theme.config.basic_style.load_progress + '";': ''})] [(${theme.config.basic_style.load_progress != 'none'?'DreamConfig["load_progress"] = "' + theme.config.basic_style.load_progress + '";': ''})]
[(${!#strings.isEmpty(theme.config.page_config.journals_share_image)?'DreamConfig["journals_share_image"] = "' + theme.config.page_config.journals_share_image + '";': ''})] [(${!#strings.isEmpty(theme.config.page_config.journals_share_image)?'DreamConfig["journals_share_image"] = "' + theme.config.page_config.journals_share_image + '";': ''})]
[(${!#strings.isEmpty(theme.config.sidebar.meting_api)?'var meting_api = "' + theme.config.sidebar.meting_api + '";': ''})] [(${!#strings.isEmpty(theme.config.sidebar.meting_api)?'var meting_api = "' + theme.config.sidebar.meting_api + '";': ''})]