mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-16 03:09:41 +08:00
fix(thumbnail): 归档页面添加默认封面图
This commit is contained in:
parent
4b29cf2994
commit
ab736ce1d7
@ -12,9 +12,10 @@
|
|||||||
<div class="timeline-title" th:text="${archive.year}"></div>
|
<div class="timeline-title" th:text="${archive.year}"></div>
|
||||||
<div class="timeline">
|
<div class="timeline">
|
||||||
<th:block th:each="months : ${archive.months}">
|
<th:block th:each="months : ${archive.months}">
|
||||||
<article th:each="post : ${months.posts}" class="media">
|
<article th:each="post : ${months.posts}" class="media"
|
||||||
<a th:if="${!#strings.isEmpty(post.spec.cover)}" th:href="${post.status.permalink}" class="media-left">
|
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : post.spec.cover}">
|
||||||
<img class="not-gallery" th:src="${post.spec.cover}" th:alt="${post.spec.title}">
|
<a th:if="${!#strings.isEmpty(thumbnail)}" th:href="${post.status.permalink}" class="media-left">
|
||||||
|
<img class="not-gallery" th:src="${thumbnail}" th:alt="${post.spec.title}">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-content">
|
<div class="media-content">
|
||||||
<time th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"></time>
|
<time th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"></time>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<th:block xmlns:th="https://www.thymeleaf.org"
|
<th:block xmlns:th="https://www.thymeleaf.org"
|
||||||
th:fragment="article (post, type)"
|
th:fragment="article (post, type)"
|
||||||
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()},
|
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()},
|
||||||
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail : post.spec.cover}">
|
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : post.spec.cover}">
|
||||||
|
|
||||||
<div th:if="${!#strings.isEmpty(thumbnail)}" class="card widget">
|
<div th:if="${!#strings.isEmpty(thumbnail)}" class="card widget">
|
||||||
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'">
|
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<th:block xmlns:th="https://www.thymeleaf.org"
|
<th:block xmlns:th="https://www.thymeleaf.org"
|
||||||
th:fragment="articleList (posts)">
|
th:fragment="articleList (posts)">
|
||||||
<th:block th:each="post : ${posts}"
|
<th:block th:each="post : ${posts}"
|
||||||
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + '?id=' + postStat.index : post.spec.cover},
|
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : post.spec.cover},
|
||||||
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : !#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode'))? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
|
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : !#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode'))? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
|
||||||
<div th:if="${!#strings.isEmpty(thumbnail) && thumbnail_mode == 'back'}" class="card widget card-cover">
|
<div th:if="${!#strings.isEmpty(thumbnail) && thumbnail_mode == 'back'}" class="card widget card-cover">
|
||||||
<a th:href="${post.status.permalink}">
|
<a th:href="${post.status.permalink}">
|
||||||
@ -133,7 +133,7 @@
|
|||||||
<div th:if="${theme.config.post.top_thumbnail_mode == 'grid' || theme.config.post.thumbnail_mode == 'grid'}"
|
<div th:if="${theme.config.post.top_thumbnail_mode == 'grid' || theme.config.post.thumbnail_mode == 'grid'}"
|
||||||
class="column-main-grid">
|
class="column-main-grid">
|
||||||
<th:block th:each="post : ${posts}"
|
<th:block th:each="post : ${posts}"
|
||||||
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + '?id=' + postStat.index : post.spec.cover}">
|
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : post.spec.cover}">
|
||||||
<div
|
<div
|
||||||
th:if="${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))}"
|
th:if="${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))}"
|
||||||
class="card widget">
|
class="card widget">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user