Skip to content

Commit

Permalink
添加文章封面默认图可选设置
Browse files Browse the repository at this point in the history
  • Loading branch information
Roozenlz committed Aug 14, 2023
1 parent 9d6f64e commit 51065a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ spec:
- group: article
label: 文章
formSchema:
- $formkit: attachment
name: default_img
value: /themes/theme-aurora/assets/img/default-cover.jpg
label: 默认封面图
placeholder: 请填写封面图地址
help: 文章封面图为空时的默认图,可填写随机图地址,默认为 /themes/theme-aurora/assets/img/default-cover.jpg ,文章及自定义页面的背景图与其封面图一致
- $formkit: number
name: index_number
label: 首页文章列表每列显示数量
Expand Down
2 changes: 1 addition & 1 deletion templates/macro/post-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="article">
<div class="article-thumbnail">
<img alt="" lazy="loading"
th:src="${#strings.isEmpty(post.spec.cover) ? ASSETS +'/img/default-cover.jpg' : post.spec.cover} ">
th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.article.default_img : post.spec.cover} ">
<span class="thumbnail-screen"
style="background: linear-gradient(130deg, rgb(36, 198, 220), rgb(84, 51, 255) 41.07%, rgb(255, 0, 153) 76.05%);"></span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/modules/feature-article.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="feature-article">
<div class="feature-thumbnail">
<img class="ob-hz-thumbnail" lazy="loaded"
th:src="${#strings.isEmpty(post.spec.cover) ? ASSETS +'/img/default-cover.jpg' : post.spec.cover} ">
th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.article.default_img : post.spec.cover} ">
<span class="thumbnail-screen"
style="background: linear-gradient(130deg, rgb(36, 198, 220), rgb(84, 51, 255) 41.07%, rgb(255, 0, 153) 76.05%);"></span>
</div>
Expand Down

0 comments on commit 51065a8

Please sign in to comment.