0.2.0 版本发布

This commit is contained in:
小赵同学 committed 2025-02-20 19:50:51 +08:00
1 parent a3f1e5074e
commit ddccb1c2b5
12 files changed
+4230 -43

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
---
title: "文章列表"
date: 2023-01-01
---
+3
View File
@@ -13,3 +13,6 @@ HasCJKLanguage = true
# 去掉post
[permalinks]
post = "/:slug/"
+5
View File
@@ -58,6 +58,11 @@ name = "archives"
weight = 20
url = "/archives"
[[menu.main]]
name = "memos"
weight = 20
url = "/memos"
# 模块配置
[module]
# Hugo 版本要求
+24 -42
View File
@@ -1,49 +1,31 @@
{{ define "main" }}
<div id="pjax-container" uk-scrollspy="target: > div,a; cls: uk-animation-slide-bottom-small; delay: 0">
<article>
<div class="recent-posts section">
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
<div class="posts">
<!-- 使用 sort 对文章按 Weight 排序 -->
{{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden")
"Weight" }}
{{ $paginator := .Paginate $posts }}
{{ range $paginator.Pages }}
<div class="post">
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<!-- 计算每篇文章的发布时间与当前时间的差值 -->
{{ $publishDate := .Date }}
{{ $currentTime := now }}
{{ $timeDiff := div (sub $currentTime.Unix $publishDate.Unix) 3600 }}
<!-- 判断发布时间是否小于 24 小时,并且没有 weight 属性 -->
{{ if and (lt $timeDiff 24) (not .Params.weight) }}
<span class="new-post-message"></span>
{{ end }}
<!-- 判断发布时间和 weight 属性 -->
{{ if .Params.weight }}
<!-- 如果有 weight 属性,添加 pushpin 图标 -->
<img src="/image/zd_top.png" alt="" srcset="" style="width: 19px;position: relative;bottom: 2px;right: 3px;box-shadow: 0 0px 0px rgba(0, 0, 0, 0.2);cursor: pointer;transform: 1s;">
{{ end }}
<div class="post-content" itemprop="articleBody">
<div class="index-laodao">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bird"><path d="M16 7h.01"/><path d="M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20"/><path d="m20 7 2 .5-2 .5"/><path d="M10 18v3"/><path d="M14 17.75V21"/><path d="M7 18a6 6 0 0 0 3.84-10.61"/></svg>
<div class="index-laodao-titile">说说</div>
</div>
{{ end }}
<!--memos-->
<div id="memos"></div>
<div id="bber"></div>
<!--相对时间-->
<script src="https://koobai.com/js/moment.min.js?v=2.29.4"></script>
<script src="https://koobai.com/js/moment.twitter.min.js"></script>
<script>
function formatDate(param) {
if(typeof param === 'number') {
param = new Date(param * 1000).toISOString();
}
return moment(Date.parse(param)).twitterLong().replace(/\s\d{2}:\d{2}/, '');
}
</script>
<!-- 加载 Markdown 语法-->
<script src="https://fastly.jsdelivr.net/npm/marked/marked.min.js"></script>
<!--评论加载-->
<link href="https://img.koobai.com/Artalk.css" rel="stylesheet">
<script src="https://img.koobai.com/Artalk.js"></script>
<!--memos结束-->
</div>
</div>
</article>
<ul class="pagination">
<li class="page-item page-next">
{{ if $paginator.HasNext }}
<a class="next" title="下一页" href="{{ $paginator.Next.URL }}">下一页</a>
{{ end }}
</li>
<li class="page-item page-previous">
{{ if $paginator.HasPrev }}
<a class="prev" title="上一页" href="{{ $paginator.Prev.URL }}">上一页</a>
{{ end }}
</li>
</ul>
</div>
{{ end }}
+4
View File
@@ -25,6 +25,10 @@
<script src="/js/echarts.min.js"></script>
<script src="/js/tiaozhuan.js"></script>
<script async src="/js/bsz.js"></script>
<!--memos 内容-->
<script src="/js/memos.js?v=1.4.4"></script>
<script src="https://koobai.com/js/coco-message.min.js"></script>
<!--memos 结束-->
</body>
</html>
+1 -1
View File
@@ -20,11 +20,11 @@
<nav class="nav">
<ul class="flat">
<li class="active"><a href="/">首页</a></li>
<li class="active"><a href="/post/">文章</a></li>
<li class="active"><a href="/about/">关于</a></li>
<li class="active"><a href="/ly/">留言</a></li>
<li class="active"><a href="/archives/">归档</a></li>
<li class="active"><a href="/links/">友链</a></li>
<!--<li class="active"><a href="/circles/">友圈</a></li>-->
</ul>
</nav>
</div>
+49
View File
@@ -0,0 +1,49 @@
{{ define "main" }}
<div id="pjax-container" uk-scrollspy="target: > div,a; cls: uk-animation-slide-bottom-small; delay: 0">
<article>
<div class="recent-posts section">
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
<div class="posts">
<!-- 使用 sort 对文章按 Weight 排序 -->
{{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden")
"Weight" }}
{{ $paginator := .Paginate $posts }}
{{ range $paginator.Pages }}
<div class="post">
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<!-- 计算每篇文章的发布时间与当前时间的差值 -->
{{ $publishDate := .Date }}
{{ $currentTime := now }}
{{ $timeDiff := div (sub $currentTime.Unix $publishDate.Unix) 3600 }}
<!-- 判断发布时间是否小于 24 小时,并且没有 weight 属性 -->
{{ if and (lt $timeDiff 24) (not .Params.weight) }}
<span class="new-post-message"></span>
{{ end }}
<!-- 判断发布时间和 weight 属性 -->
{{ if .Params.weight }}
<!-- 如果有 weight 属性,添加 pushpin 图标 -->
<img src="/image/zd_top.png" alt="" srcset="" style="width: 19px;position: relative;bottom: 2px;right: 3px;box-shadow: 0 0px 0px rgba(0, 0, 0, 0.2);cursor: pointer;transform: 1s;">
{{ end }}
</div>
{{ end }}
</div>
</div>
</article>
<ul class="pagination">
<li class="page-item page-next">
{{ if $paginator.HasNext }}
<a class="next" title="下一页" href="{{ $paginator.Next.URL }}">下一页</a>
{{ end }}
</li>
<li class="page-item page-previous">
{{ if $paginator.HasPrev }}
<a class="prev" title="上一页" href="{{ $paginator.Prev.URL }}">上一页</a>
{{ end }}
</li>
</ul>
</div>
{{ end }}
File diff suppressed because it is too large. Load diff
+65
View File
@@ -146,3 +146,68 @@ function flattenComments(comments) {
if (document.querySelector("#Comments") && !isMobile()) {
loadBarrager()
}
// 灯箱调用(首页顶部/Memos页面)
window.ViewImage && ViewImage.init('.content_zhengwen img, .top-img,.gallery-thumbnail img,.posts_photo a,.photo-moment a');
// 页面上滑加载动画
function animateSummaries() {
const articles = document.querySelectorAll('.img-hide,.retu-hide'); // 包含新的类
const shuffledArticles = Array.from(articles).sort(() => Math.random() - 0.5);
function animate(article, delay) {
setTimeout(() => {
article.classList.add('visible');
}, delay);
}
const options = {
rootMargin: '0px 0px -70px 0px',
};
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry, index) => {
if (entry.isIntersecting) {
// 类名 retu-hide 延迟 100 默认 img-hide 延迟 8,实现错落效果
const delay = entry.target.classList.contains('retu-hide') ? index * 100 : index * 8;
animate(entry.target, delay);
observer.unobserve(entry.target);
}
});
}, options);
shuffledArticles.forEach((article) => {
observer.observe(article);
});
}
function initEditor() {
const loadEditorBtn = document.getElementById("loadEditorBtn");
const memosEditor = document.querySelector(".memos-editor");
const editorBody = document.querySelector('.index-laodao');
if (loadEditorBtn) {
loadEditorBtn.addEventListener("click", function () {
// 切换编辑器显示状态
getEditor != "show" ? hasMemosOpenId() : '';
memosEditor.classList.toggle("d-none");
// 保存编辑器显示状态到 localStorage
if (window.localStorage) {
const isHidden = memosEditor.classList.contains("d-none");
window.localStorage.setItem("memos-editor-display", isHidden ? "hide" : "show");
getEditor = window.localStorage.getItem("memos-editor-display");
}
// 平滑滚动到 .index-laodao
if (editorBody && !memosEditor.classList.contains("d-none")) {
editorBody.scrollIntoView({ behavior: 'smooth' });
}
});
}
}
// 初始化编辑器逻辑
initEditor();
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+247
View File
@@ -0,0 +1,247 @@
{
"Emoji": {
"type": "emoji",
"container":[
{
"icon": "😂",
"text": "哭笑不得"
},
{
"icon": "😎",
"text": "酷"
},
{
"icon": "😏",
"text": "坏笑"
},
{
"icon": "😅",
"text": "流汗"
},
{
"icon": "😄",
"text": "笑"
},
{
"icon": "😜",
"text": "调皮"
},
{
"icon": "🤣",
"text": "笑倒"
},
{
"icon": "😭",
"text": "大哭"
},
{
"icon": "🙄",
"text": "白眼"
},
{
"icon": "🤐",
"text": "嘘"
},
{
"icon": "😋",
"text": "美食脸"
},
{
"icon": "🥶",
"text": "冰冻"
},
{
"icon": "🥵",
"text": "热"
},
{
"icon": "😴",
"text": "睡觉"
},
{
"icon": "🤧",
"text": "打喷嚏"
},
{
"icon": "🍉",
"text": "西瓜"
},
{
"icon": "😱",
"text": "惊恐"
},
{
"icon": "👋",
"text": "招手"
},
{
"icon": "🔨",
"text": "锤子"
},
{
"icon": "🐶",
"text": "小狗"
},
{
"icon": "👏",
"text": "鼓掌"
},
{
"icon": "🙈",
"text": "不看"
},
{
"icon": "😓",
"text": "汗"
},
{
"icon": "😍",
"text": "爱心眼"
},
{
"icon": "🤝",
"text": "握手"
},
{
"icon": "🥺",
"text": "求你"
},
{
"icon": "😔",
"text": "沮丧"
},
{
"icon": "😪",
"text": "困"
},
{
"icon": "😕",
"text": "困惑"
},
{
"icon": "🤷‍♂️",
"text": "摊手"
},
{
"icon": "😛",
"text": "舌头"
},
{
"icon": "🤭",
"text": "偷笑"
},
{
"icon": "🤮",
"text": "呕吐"
},
{
"icon": "🥺",
"text": "求你"
},
{
"icon": "🙂",
"text": "轻松的笑"
},
{
"icon": "😈",
"text": "恶魔"
},
{
"icon": "😃",
"text": "笑脸"
},
{
"icon": "🤫",
"text": "嘘"
},
{
"icon": "😒",
"text": "无语"
},
{
"icon": "😵",
"text": "晕"
},
{
"icon": "💪",
"text": "加油"
},
{
"icon": "👍",
"text": "赞"
},
{
"icon": "👎",
"text": "踩"
},
{
"icon": "😡",
"text": "愤怒"
},
{
"icon": "🤬",
"text": "怒骂"
},
{
"icon": "😖",
"text": "心烦"
},
{
"icon": "🌹",
"text": "玫瑰"
},
{
"icon": "🏃",
"text": "跑步"
},
{
"icon": "😆",
"text": "大笑"
},
{
"icon": "💵",
"text": "钞票"
},
{
"icon": "😘",
"text": "飞吻"
},
{
"icon": "😷",
"text": "生病"
},
{
"icon": "🤕",
"text": "受伤"
},
{
"icon": "🎉",
"text": "庆祝"
},
{
"icon": "❤️",
"text": "红心"
},
{
"icon": "💔",
"text": "心碎"
},
{
"icon": "😣",
"text": "无奈"
},
{
"icon": "😘",
"text": "飞吻"
},
{
"icon": "💩",
"text": "一坨便便"
},
{
"icon": "🤩",
"text": "爱慕"
}
]
}
}