Skip to content

Commit

Permalink
适配缩略图
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhongxue committed Aug 29, 2024
1 parent fdd592c commit f7e66f9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion templates/archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<h2>归档 <span>Archives.</span></h2>
<div class="archive-box">
<ul>
<th:block th:each="archive : ${archives.items}">
<th:block th:each="archive : ${postFinder.archives(1, 0).items}">
<th:block th:each="month : ${archive.months}">
<h3>[[${archive.year}]]年[[${month.month}]]月</h3>
<li th:each="post : ${month.posts}">
Expand Down
2 changes: 1 addition & 1 deletion templates/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>分类 <span>Categories.</span></h2>
<div class="left">
<a th:href="@{${post.status.permalink}}">
<img
th:with="img = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.iemo_cover_post : post.spec.cover}"
th:with="img = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.iemo_cover_post : thumbnail.gen(post.spec.cover, 's')}"
th:src="${img}" alt="">
</a>
</div>
Expand Down
3 changes: 3 additions & 0 deletions templates/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ <h3 th:text="${link.spec.displayName}"></h3>
</th:block>
</ul>
</div>
<th:block
th:replace="~{modules/inc/halo-comment :: halo-comment(name=${pluginName},kind='Plugin',group='plugin.halo.run')}">
</th:block>
</article>
<th:block th:replace="~{modules/aside}" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/modules/inc/home-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li th:each="post,iter : ${postItems}">
<div class="left">
<a class="cover" th:href="@{${post.status.permalink}}">
<img th:with="img = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.iemo_cover_post : post.spec.cover}"
<img th:with="img = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.iemo_cover_post : thumbnail.gen(post.spec.cover, 's')}"
th:src="${img}" alt="">
</a>
<div class="cate-view">
Expand Down
2 changes: 1 addition & 1 deletion templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<article>
<div class="post-cover">
<div class="cover"
th:with="cover = ${not #strings.isEmpty(post.spec.cover) ? post.spec.cover : theme.config.post.iemo_cover_post}">
th:with="cover = ${not #strings.isEmpty(post.spec.cover) ? thumbnail.gen(post.spec.cover, 'm') : theme.config.post.iemo_cover_post}">
<th:block th:if="${not #strings.isEmpty(cover)}">
<img class="thumbnail_loading" th:src="@{/assets/images/loading.gif}" alt="">
<img th:src="${cover}" alt="">
Expand Down
2 changes: 1 addition & 1 deletion templates/tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>标签 <span>Tags.</span></h2>
<li th:each="post,iStat : ${posts.items}">
<div class="left">
<a th:href="@{${post.status.permalink}}">
<img th:with="img = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.iemo_cover_post : post.spec.cover}"
<img th:with="img = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.iemo_cover_post : thumbnail.gen(post.spec.cover, 's')}"
th:src="${img}" alt="">
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ spec:
issues: "https://github.com/chengzhongxue/halo-theme-iemo/issues"
settingName: "theme-iemo-setting"
configMapName: "theme-iemo-configMap"
version: "1.0.2"
requires: ">=2.15.0"
version: "1.0.3"
requires: ">=2.19.0"
license:
- name: "MIT License"
url: "https://github.com/chengzhongxue/halo-theme-iemo/blob/main/LICENSE"

0 comments on commit f7e66f9

Please sign in to comment.