优化阅读体验、前台编辑、播放器等
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
<th:block th:fragment="home-blog(_posts,path)">
|
||||
<th:block th:fragment="home-blog(_posts,path,tag,selectedCategory)">
|
||||
|
||||
<div class="normal_list">
|
||||
<div class="normal_list_inner" uk-height-viewport="offset-top: true">
|
||||
|
||||
<div class="posts_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li><a th:data="${path}" class="active">全部<span></span></a>
|
||||
<li><a th:data="${path}" th:classappend="${#strings.isEmpty(tag) ? 'active' : ''}">全部<span></span></a>
|
||||
</li>
|
||||
<li th:if="${theme.config.post.post_nav == 'category'}" th:each="categoryItem,iStat : ${categoryFinder.listAll()}">
|
||||
<a th:data="${categoryItem.status.permalink}"
|
||||
class="">[[${categoryItem.spec.displayName}]]<span></span></a>
|
||||
<a th:if="${path == '/archives'}" th:data="@{/archives(tag=${categoryItem.spec.displayName})}"
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span></a>
|
||||
<a th:unless="${path == '/archives'}" th:data="${categoryItem.status.permalink}"
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span></a>
|
||||
</li>
|
||||
<li th:if="${theme.config.post.post_nav == 'custom_category'}"
|
||||
th:each="category : ${theme.config.post.nav_category}">
|
||||
<th:block th:with="categoryItem = ${categoryFinder.getByName(category)}">
|
||||
<a th:if="${categoryItem!=null}"
|
||||
<a th:if="${categoryItem!=null and path == '/archives'}"
|
||||
th:data="@{/archives(tag=${categoryItem.spec.displayName})}"
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span>
|
||||
</a>
|
||||
<a th:if="${categoryItem!=null and path != '/archives'}"
|
||||
th:data="${categoryItem.status.permalink}"
|
||||
class="">[[${categoryItem.spec.displayName}]]<span></span>
|
||||
th:classappend="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(selectedCategory, categoryItem.metadata.name) ? 'active' : ''}">[[${categoryItem.spec.displayName}]]<span></span>
|
||||
</a>
|
||||
</th:block>
|
||||
</li>
|
||||
@@ -26,13 +32,20 @@
|
||||
<div id="post_item" class="norpost_list " th:with='postItems=${_posts.items}'
|
||||
th:classappend="${theme.config.post.post_list_type == 'grid' ? 'uk-grid-small uk-grid' : ''}">
|
||||
<th:block th:replace="~{'macro/tpl/content-post'}"></th:block>
|
||||
<th:block th:if="${#lists.isEmpty(postItems)}">
|
||||
<th:block th:replace="~{macro/tpl/content-none}"/>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<th:block th:if="${_posts.totalPages>1}">
|
||||
<div id="pagination">
|
||||
<div class="post-paging" th:if="${_posts.hasNext()}"
|
||||
th:with="_page = ${_posts.page+1},_path = ${path == '/archives' ? path+'?page='+_page : path +'page/'+_page }">
|
||||
<a th:data="${_path}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
th:with="_page = ${_posts.page+1},_path = ${path +'page/'+_page }">
|
||||
<a th:if="${path == '/archives' and #strings.isEmpty(tag)}"
|
||||
th:data="@{/archives(page=${_page})}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${path == '/archives' and not #strings.isEmpty(tag)}"
|
||||
th:data="@{/archives(tag=${tag},page=${_page})}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${path != '/archives'}" th:data="${_path}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
@@ -41,4 +54,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<th:block th:fragment="home-moment(_moments,tags)">
|
||||
<th:block th:fragment="home-moment(_moments,tags,path)" th:with="_path = ${#strings.isEmpty(path) ? '/moments' : path}">
|
||||
|
||||
<div class="blog_list">
|
||||
<div class="blog_list_inner" uk-height-viewport="offset-top: true">
|
||||
<div class="moment_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li><a data="/moments" class="" th:classappend="${#lists.isEmpty(param.tag) ? 'active' : ''}"
|
||||
<li><a th:data="@{${_path}}" class="" th:classappend="${#lists.isEmpty(param.tag) ? 'active' : ''}"
|
||||
><span>全部</span></a>
|
||||
</li>
|
||||
<li th:each="tag,iStat : ${tags}">
|
||||
<a th:data="|/moments?tag=${tag.name}|" class=""
|
||||
<a th:data="@{${_path}(tag=${tag.name})}" class=""
|
||||
th:classappend="${#lists.contains(param.tag, tag.name) ? 'active' : ''}"
|
||||
><span>[[${tag.name}]]</span></a>
|
||||
</li>
|
||||
@@ -26,9 +26,14 @@
|
||||
</div>
|
||||
<th:block th:if="${_moments.totalPages>1}">
|
||||
<div id="t_pagination">
|
||||
<div class="post-paging" th:if="${_moments.hasNext()}"
|
||||
th:with="tag = ${not #lists.isEmpty(param.tag) ? '?tag='+param.tag : ''},_page = ${_moments.page+1}">
|
||||
<a th:data="${'/moments/page/'+_page+tag}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<div class="post-paging" th:if="${_moments.hasNext()}"
|
||||
th:with="tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]},_page = ${_moments.page+1}">
|
||||
<a th:if="${#strings.isEmpty(tag)}"
|
||||
th:data="@{${_path}(page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:unless="${#strings.isEmpty(tag)}"
|
||||
th:data="@{${_path}(tag=${tag},page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
@@ -36,4 +41,4 @@
|
||||
<div id="comment_form_reset"></div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<th:block th:fragment="home-photos(photoPage,groups,tag,selectedGroup)">
|
||||
<div class="normal_list">
|
||||
<div class="normal_list_inner" uk-height-viewport="offset-top: true">
|
||||
|
||||
<!-- 分类导航 -->
|
||||
<div class="photos_cat_nav">
|
||||
<ul id="cat_nav_items">
|
||||
<li>
|
||||
<!-- 修改:href 改为 data-href,并添加一个通用 class 如 'cat-link' -->
|
||||
<a th:attr="data-href=@{/photos}"
|
||||
th:classappend="${#strings.isEmpty(tag) and #strings.isEmpty(selectedGroup) ? 'active' : ''}"
|
||||
class="cat-link">
|
||||
全部<span></span>
|
||||
</a>
|
||||
</li>
|
||||
<th:block th:each="photoGroup : ${groups}">
|
||||
<li>
|
||||
<!-- 修改:这里也改为 data-href -->
|
||||
<a th:attr="data-href=@{/photos(tag=${photoGroup.spec.displayName})}"
|
||||
th:classappend="${#strings.equals(tag, photoGroup.spec.displayName) or #strings.equals(selectedGroup, photoGroup.metadata.name) ? 'active' : ''}"
|
||||
th:text="${photoGroup.spec.displayName}" class="cat-link">
|
||||
<span></span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 相册列表 -->
|
||||
<div id="photos_item" class="norpost_list">
|
||||
<div th:unless="${#lists.isEmpty(photoPage.items)}" class="gallery-photos page">
|
||||
|
||||
<div th:each="photo : ${photoPage.items}" class="gallery-photo">
|
||||
|
||||
<th:block th:with="
|
||||
img = ${!#strings.isEmpty(photo.spec.cover) ? photo.spec.cover : photo.spec.url},
|
||||
isVideo = ${#strings.endsWith(img, '.mp4') or #strings.endsWith(img, '.webm') or #strings.endsWith(img, '.ogg')}
|
||||
">
|
||||
|
||||
<span th:if="${isVideo}" th:href="${img}" data-fancybox="gallery"
|
||||
class="fancybox video-fancybox"
|
||||
style="position: relative; display: block; cursor: pointer;">
|
||||
<video class="photo-img" preload="metadata" muted playsinline>
|
||||
<source th:src="${img}" th:type="${#strings.endsWith(img, '.mp4') ? 'video/mp4' :
|
||||
(#strings.endsWith(img, '.webm') ? 'video/webm' : 'video/ogg')}" />
|
||||
</video>
|
||||
<div
|
||||
style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;">
|
||||
<i class="ri-play-circle-line play-icon"
|
||||
style="color: #41b87e; font-size: 40px; background-color: rgba(255, 255, 255, 0.8); border-radius: 50%;"></i>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span th:unless="${isVideo}" th:href="${img}" data-fancybox="gallery"
|
||||
class="fancybox" th:data-thumb="${img}"
|
||||
style="position: relative; display: block;">
|
||||
<img class="photo-img" loading="lazy" th:src="${img}" />
|
||||
</span>
|
||||
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空数据 -->
|
||||
<th:block th:if="${#lists.isEmpty(photoPage.items)}">
|
||||
<th:block th:replace="~{macro/tpl/content-none}" />
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<th:block th:if="${photoPage.hasPrevious()} or ${photoPage.hasNext()}">
|
||||
<div id="p_pagination">
|
||||
<div class="post-paging" th:if="${photoPage.hasNext()}"
|
||||
th:with="_page = ${photoPage.page+1}">
|
||||
<a th:if="${#strings.isEmpty(tag)}"
|
||||
th:data="@{/photos(page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:unless="${#strings.isEmpty(tag)}"
|
||||
th:data="@{/photos(tag=${tag},page=${_page})}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
Reference in New Issue
Block a user