1.2.2.2移除广告模式“图片+链接”相关配置,广告改为由侧边栏代码配置,适配加载多广告的情况

This commit is contained in:
j m 2024-05-30 05:52:30 +08:00
parent 472c60467e
commit 624f76643c
3 changed files with 2 additions and 25 deletions

View File

@ -886,26 +886,6 @@ spec:
label:
- value: false
label:
- $formkit: radio
name: ad_mode
label: 侧边栏广告-广告展示方法
help: '选择“自定义广告代码”时,必须在“侧边栏内容”中填写广告代码。'
value: true
options:
- value: true
label: 图片+链接
- value: false
label: 自定义广告代码
- $formkit: text
name: ad_target_url
label: 侧边栏广告-广告目标地址
placeholder: '请输入链接地址'
help: '填写广告跳转的目标路径。'
- $formkit: attachment
name: ad_image
label: 侧边栏广告-广告图片链接
placeholder: '请输入/选择图片路径'
help: '图片+链接模式时不能为空。'
- $formkit: number
name: recent_posts_num
label: 侧边栏最近文章-展示文章数量

View File

@ -1,10 +1,7 @@
<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (sidebar)"
th:class="'card widget ' + ${sidebar.hide}">
<a th:if="${theme.config.sidebar.ad_mode}" target="_blank" th:href="${theme.config.sidebar.ad_target_url}">
<img width="100%" th:src="${theme.config.sidebar.ad_image}" alt="广告"/>
</a>
<th:block th:unless="${theme.config.sidebar.ad_mode}" th:utext="${sidebar.content}"/>
<th:block th:utext="${sidebar.content}"/>
<span th:if="${theme.config.sidebar.show_ad_tag}" class="ad-tag">广告
<svg th:if="${theme.config.sidebar.ad_tag_close}" class="click-close" data-close=".widget"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path

View File

@ -1 +1 @@
1.2.2.1
1.2.2.2