修复若干bug
This commit is contained in:
1 parent
94855a49bf
commit
21fa47801b
14 files changed
+69
-130
No files matched your search
@@ -22,7 +22,7 @@ social = [
|
||||
# 主页链接
|
||||
{ title = "我的主页", url = "#", icon = "ri-at-line" },
|
||||
# Rss订阅链接
|
||||
{ title = "Rss订阅", url = "https://usj.cc/rss.xml", icon = "ri-rss-fill" }
|
||||
{ title = "Rss订阅", url = "/rss.xml", icon = "ri-rss-fill" }
|
||||
]
|
||||
|
||||
[[menus.main]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<div class="post-content" style="list-style-type: none;" uk-scrollspy="target: > .link-title,.diy-h3,li; cls: uk-animation-slide-bottom-small; delay: 0">
|
||||
<div class="post-content" style="list-style-type: none;" uk-scrollspy="target: .link-title; cls: uk-animation-slide-left-small; delay: 50; repeat: true">
|
||||
{{ $currentYear := 0 }}
|
||||
{{ $currentMonth := 0 }}
|
||||
{{ range .Site.RegularPages }}
|
||||
@@ -12,7 +12,7 @@
|
||||
{{ if ne $currentYear 0 }}
|
||||
</div> <!-- Close previous year -->
|
||||
{{ end }}
|
||||
<div class="link-title a-title" uk-scrollspy="cls: uk-animation-slide-bottom-small; repeat: false">
|
||||
<div class="link-title a-title">
|
||||
<span>{{ $year }}</span>
|
||||
</div>
|
||||
{{ $currentYear = $year }}
|
||||
@@ -23,21 +23,19 @@
|
||||
{{ if ne $currentMonth 0 }}
|
||||
</div> <!-- Close previous month -->
|
||||
{{ end }}
|
||||
<h3 class="diy-h3" uk-scrollspy="cls: uk-animation-slide-bottom-small; repeat: false" data-toggle="collapse"
|
||||
<h3 class="diy-h3" data-toggle="collapse" uk-scrollspy="cls: uk-animation-fade; delay: 100"
|
||||
data-target="#collapse{{ $year }}{{ printf "%02d" $month }}" aria-expanded="false"
|
||||
aria-controls="collapse{{ $year }}{{ printf "%02d" $month }}">
|
||||
|
||||
{{ $month | printf "%02d" }}月
|
||||
</h3>
|
||||
<div class="collapse" id="collapse{{ $year }}{{ printf "%02d" $month }}"
|
||||
uk-scrollspy="cls: uk-animation-slide-bottom-small; repeat: false">
|
||||
<div class="collapse" id="collapse{{ $year }}{{ printf "%02d" $month }}" uk-scrollspy="target: > li; cls: uk-animation-slide-right-small; delay: 100">
|
||||
{{ $currentMonth = $month }}
|
||||
{{ end }}
|
||||
|
||||
<li data-date="{{ $year }}{{ printf "%02d" $month }}{{ .Date.Day }}">
|
||||
<span class="articles_date_time">{{ .Date.Format "01/02" }}</span>
|
||||
<a class="a-archives" uk-scrollspy="cls: uk-animation-slide-bottom-small; repeat: false"
|
||||
href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
<a class="a-archives" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
{{ partial "header.html" .}}
|
||||
<!-- header部分结束 -->
|
||||
<!-- main主体部分 -->
|
||||
{{ block "main" . }}{{ end }}
|
||||
<div id="pjax-wrapper" style="position: relative; min-height: 50vh;">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</div>
|
||||
<!-- main主体部分结束 -->
|
||||
<!-- footer页脚部分 -->
|
||||
{{ partial "footer.html" .}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="post-content" itemprop="articleBody">
|
||||
{{ .Content }}
|
||||
<div id="hexo-circle-of-friends-root"
|
||||
uk-scrollspy="target: > .cf-article-item; cls: uk-animation-fade; delay: 0"></div>
|
||||
uk-scrollspy="target: > .cf-article-item; cls: uk-animation-slide-bottom-small; delay: 100"></div>
|
||||
</div>
|
||||
<script>
|
||||
// 定义几个全局变量
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container" uk-scrollspy="target: > div,a; cls: uk-animation-slide-bottom-small; delay: 0">
|
||||
<div id="pjax-container">
|
||||
<article>
|
||||
<div class="recent-posts section">
|
||||
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
|
||||
<div class="posts">
|
||||
<h2 class="section-header" uk-scrollspy="cls: uk-animation-slide-left-small; delay: 200">随笔<i class="ri-quill-pen-line"></i></h2>
|
||||
<div class="posts" uk-scrollspy="target: > .post; cls: uk-animation-slide-bottom-small; delay: 150">
|
||||
<!-- 使用 sort 对文章按 Weight 排序 -->
|
||||
{{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden")
|
||||
"Weight" }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<div class="post-content" itemprop="articleBody" uk-scrollspy="target: > .cf-friends; cls: uk-animation-slide-bottom-small; delay: 0">
|
||||
<div class="post-content" itemprop="articleBody" uk-scrollspy="target: > .cf-friends; cls: uk-animation-scale-up; delay: 150">
|
||||
{{ partial "link_items.html" . }}
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<article>
|
||||
<div class="post-list section">
|
||||
<div class="post-list section" uk-scrollspy="target: > .post; cls: uk-animation-slide-bottom-small; delay: 150">
|
||||
{{ $paginator := .Paginate (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden") }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post">
|
||||
@@ -22,4 +23,5 @@
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -79,40 +79,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
// 配置:友链数据源地址
|
||||
// 1. 本地模块模式:使用 '/json/link_lite.json' (默认)
|
||||
// 2. 远程模式:修改为您的 GitHub + jsDelivr 链接
|
||||
// 例如:const linksJsonUrl = 'https://cdn.jsdelivr.net/gh/您的用户名/您的仓库名@main/link_lite.json';
|
||||
const linksJsonUrl = '/json/link_lite.json';
|
||||
|
||||
const list = document.getElementById('links-list');
|
||||
if (!list) return;
|
||||
|
||||
fetch(linksJsonUrl)
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error('Network response was not ok');
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
if (data && Array.isArray(data) && data.length > 0) {
|
||||
// 清空现有的静态内容,使用动态数据
|
||||
list.innerHTML = '';
|
||||
|
||||
data.forEach(item => {
|
||||
const li = document.createElement('li');
|
||||
// 保持原有的 DOM 结构和类名
|
||||
li.innerHTML = `<a href="${item.url}" class="url-name" target="_blank">${item.name}</a><span style="margin-left: 13px;">${item.description || ''}</span>`;
|
||||
list.appendChild(li);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.warn('友链动态加载失败,回退到静态内容:', error);
|
||||
// 加载失败时保留静态内容 (Hugo 生成的)
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<!-- 移除动态加载脚本,仅保留静态生成内容 -->
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -25,55 +25,6 @@
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
// 配置:友链数据源地址 (与 new-links-lite.html 保持一致)
|
||||
// 1. 本地模块模式:使用 '/json/link_lite.json' (默认)
|
||||
// 2. 远程模式:修改为您的 GitHub + jsDelivr 链接
|
||||
const linksJsonUrl = '/json/link_lite.json';
|
||||
|
||||
const container = document.getElementById('links-container');
|
||||
if (!container) return;
|
||||
|
||||
fetch(linksJsonUrl)
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error('Network response was not ok');
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
if (data && Array.isArray(data) && data.length > 0) {
|
||||
// 清空现有的静态内容,使用动态数据
|
||||
container.innerHTML = '';
|
||||
|
||||
data.forEach(item => {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'item-box';
|
||||
div.innerHTML = `
|
||||
<div class="website-img">
|
||||
<img src="https://s0.wp.com/mshots/v1/${item.url}?w=800&h=600" alt="${item.name}">
|
||||
</div>
|
||||
<div class="link-info">
|
||||
<div class="link-avatar">
|
||||
<img src="${item.image}" alt="${item.name}">
|
||||
</div>
|
||||
<div class="link-des">
|
||||
<div class="link-name">${item.name}</div>
|
||||
<div class="link-des" style="color: #64748B;">${item.description || ''}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="${item.url}" target="_blank">
|
||||
<div class="website-go-button">逛一逛</div>
|
||||
</a>
|
||||
`;
|
||||
container.appendChild(div);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.warn('友链动态加载失败,回退到静态内容:', error);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<!-- 移除动态加载脚本,仅保留静态生成内容 -->
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -1,17 +1,17 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<article style="margin-bottom: 3.5em;">
|
||||
<h1 class="post-title" itemprop="name headline">{{ .Title }}</h1>
|
||||
<div class="meta">
|
||||
<h1 class="post-title" itemprop="name headline" uk-scrollspy="cls: uk-animation-slide-top-small; delay: 200">{{ .Title }}</h1>
|
||||
<div class="meta" uk-scrollspy="cls: uk-animation-fade; delay: 300">
|
||||
作者: 小赵同学 浏览: <span id="busuanzi_value_page_uv"></span> 字数: {{ .WordCount }} 分类:
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ . }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="post-content" id="post-writing" itemprop="articleBody" uk-scrollspy="target: > hr,h2,p,pre; cls: uk-animation-slide-bottom-small; delay: 0">
|
||||
<div class="post-content" id="post-writing" itemprop="articleBody" uk-scrollspy="target: > h2,h3,h4,blockquote,img,table,figure; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
<div class="post-tags" style="margin-top: -30px;">
|
||||
<div class="post-tags" style="margin-top: -30px;" uk-scrollspy="cls: uk-animation-fade; delay: 400">
|
||||
<nav class="nav tags">
|
||||
<ul class="flat">
|
||||
<!-- 标签内容 -->
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
server: 'https://artalk.usj.cc',
|
||||
site: '优世界',
|
||||
flatMode: true,
|
||||
darkMode: isDark
|
||||
darkMode: isDark,
|
||||
emoticons: '/emotion/OwO.json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -441,14 +441,18 @@ ul {
|
||||
}
|
||||
|
||||
/* Pjax 页面切换过渡动画 */
|
||||
.js-Pjax-remove.pjax-leave.pjax-forward,
|
||||
.js-Pjax-remove.pjax-leave.pjax-backward {
|
||||
animation: pjax-fade-out 0.22s ease-in forwards;
|
||||
.pjax-leave {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
animation: pjax-fade-out 0.3s ease-in forwards;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.js-Pjax-add.pjax-enter.pjax-forward,
|
||||
.js-Pjax-add.pjax-enter.pjax-backward {
|
||||
animation: pjax-fade-in 0.22s ease-out forwards;
|
||||
.pjax-enter {
|
||||
animation: pjax-fade-in 0.3s ease-out forwards;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@keyframes pjax-fade-in {
|
||||
@@ -779,9 +783,34 @@ darkb-text:active {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* 视频尺寸 */
|
||||
/* 骨架屏动画 */
|
||||
.skeleton-line {
|
||||
background: #e0e0e0;
|
||||
border-radius: 4px;
|
||||
background-image: linear-gradient(90deg, #e0e0e0 0px, #f5f5f5 40px, #e0e0e0 80px);
|
||||
background-size: 600px;
|
||||
animation: skeleton-loading 1.6s infinite ease-out;
|
||||
}
|
||||
|
||||
.size-video {
|
||||
@keyframes skeleton-loading {
|
||||
0% {
|
||||
background-position: -100px;
|
||||
}
|
||||
100% {
|
||||
background-position: 140px;
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme="dark"] #pjax-loading-skeleton {
|
||||
background: rgba(15, 23, 42, 0.94) !important;
|
||||
box-shadow: var(--card-shadow-dark) !important;
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .skeleton-line {
|
||||
background: #1f2937;
|
||||
background-image: linear-gradient(90deg, #1f2937 0px, #374151 40px, #1f2937 80px);
|
||||
}
|
||||
position: relative;
|
||||
border-radius: 5px;
|
||||
padding-bottom: 66.5%;
|
||||
|
||||
@@ -75,7 +75,8 @@ function initArtalkAndGetComments() {
|
||||
el: '#Comments', // 绑定元素的 Selector
|
||||
server: 'https://artalk.usj.cc', // 后端地址
|
||||
site: '优世界', // 你的站点名
|
||||
flatMode: true
|
||||
flatMode: true,
|
||||
emoticons: '/emotion/OwO.json'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,20 +3,8 @@ var pjax = new Pjax({
|
||||
// 这里填写页面中改变的部分(和 CSS 选择器用法一样)
|
||||
selectors: ["title", "#pjax-container"],
|
||||
cacheBust: false,
|
||||
elements: "a",
|
||||
switches: {
|
||||
"#pjax-container": Pjax.switches.sideBySide
|
||||
},
|
||||
switchesOptions: {
|
||||
"#pjax-container": {
|
||||
classNames: {
|
||||
add: "pjax-enter",
|
||||
remove: "pjax-leave",
|
||||
backward: "pjax-backward",
|
||||
forward: "pjax-forward"
|
||||
}
|
||||
}
|
||||
}
|
||||
elements: "a"
|
||||
// 移除 sideBySide,改用默认替换以配合骨架屏逻辑
|
||||
});
|
||||
// 设置图片灯箱回调函数
|
||||
function lazyimg_pjax() {
|
||||
@@ -146,7 +134,7 @@ function lazyimg_pjax() {
|
||||
// 设置pjax预先加载代码
|
||||
function pjax_reload() {
|
||||
// 给pjax容器加入css过渡动画
|
||||
$("#pjax-container").addClass("uk-animation-slide-bottom-small");
|
||||
// $("#pjax-container").addClass("uk-animation-slide-bottom-small");
|
||||
// 评论区过渡动画
|
||||
$(".comment-meta").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
$(".comment-author vcard").attr("uk-scrollspy", "cls: uk-animation-fade; delay: 100");
|
||||
@@ -198,7 +186,8 @@ document.addEventListener("pjax:complete", function () {
|
||||
el: '#Comments', // 绑定元素的 Selector
|
||||
server: 'https://artalk.usj.cc', // 后端地址
|
||||
site: '优世界', // 你的站点名
|
||||
flatMode: true
|
||||
flatMode: true,
|
||||
emoticons: '/emotion/OwO.json'
|
||||
})
|
||||
}
|
||||
// 重载评论弹幕
|
||||
|
||||
Reference in new issue
Block a user