修复若干bug
This commit is contained in:
1 parent
94855a49bf
commit
21fa47801b
14 files changed
+69
-130
No files matched your search
@@ -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">
|
||||
<!-- 标签内容 -->
|
||||
|
||||
Reference in new issue
Block a user