synchronization
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2025-08-25 13:02:18 +08:00
commit f1ecb4ed07
37 changed files with 1644 additions and 0 deletions

3
app/404.md Normal file
View File

@@ -0,0 +1,3 @@
---
layout: 404
---

282
app/_config.async.yml Normal file
View File

@@ -0,0 +1,282 @@
# 默认主题配置, 开启切换主题功能
theme:
switch: true
default: style-light # style-light style-dark
# 网站图标 Favicon
favicon:
logo: /img/favicon-16x16.png
icon16: /img/favicon-16x16.png
icon32: /img/favicon-32x32.png
appleTouchIcon: /img/favicon-16x16.png
webmanifest: /site.webmanifest
visibilitychange: true
hidden: /img/favicon-32x32.png
showText: 打咩~
hideText: 咿呀哒~
# 字体图标 Icon
assets:
third_party_provider: https://npm.elemecdn.com
icons:
type: symbol
css:
js: //at.alicdn.com/t/c/font_3637590_i4hyyea14ur.js
# 用户信息 User
user:
name: Offends
first_name:
last_name:
email: offends4@163.com
domain: https://blog.offends.cn
avatar: /img/avatar.png
describe: 现充爆炸吧
ruleText: 尊重原创足矣。
# 导航栏 TopBars
top_bars:
- title: 首页
url: /
- title: 分类
url: /categories/
# - title: 标签
# url: /tags/
- title: 其它
url: '#'
children:
- title: 关于
url: /about/
- title: 留言
url: /comment/
- title: 友链
url: /links/
# 侧栏 Sidebar
sidebar:
social:
- name: github
icon: icon-github
url: https://github.com/dinghui40
- name: gitee
icon: icon-gitee
url: https://gitee.com/offends
# 打字动画
typedTextPrefix: [' ']
typedText: [ 'I`m Ding Hui','Welcome Back']
info:
- key: 地址
val: 银河系
- key: 年龄
val: 不清楚
- key: 实力
val: 上升期
# - key: <div><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=260 height=86 src="//music.163.com/outchain/player?type=2&id=466808591&auto=0&height=66"></iframe></div>
# 横幅 Banner
banner:
use_cover: false
default:
type: img
bgurl: /img/desktop.png
bannerText:
position: top
fit: cover
index:
bannerTitle: 业精于勤,荒于嬉。
bannerText:
archive:
bannerTitle: 积土而为山,积水而为海。
bannerText:
links:
bannerTitle: 渚寒烟淡,棹移人远,飘渺行舟如叶。
bannerText:
comment:
bannerTitle: 天下兴亡,咱们有责,嘿嘿。
bannerText:
about:
bannerTitle: 四顾山光接水光,<br>凭栏十里芰荷香。
bannerText:
# 页脚 Footer
footer:
# 起始年份
copyrightYear: 2020
# 显示框架
powered:
enable: true
# 显示备案号
beian:
enable: true
icp: 京ICP备2022021046号
# 运行时间
live_time:
enable: true
prefix: footer.tips
start_time: 01/3/2022 00:00:00
# 其他信息
custom_text: <a href="https://beian.mps.gov.cn/#/query/webSearch" rel="noopener" target="_blank">京公网安备11010502052505号</a>
# 打赏 Reward
reward:
enable: true
comment: I'm so cute. Please give me money.
methods:
- name: 支付宝
path: /img/zfb.png
- name: 微信
path: /img/wx.png
# 文章目录
toc:
enable: true
list_number: true
max_depth: 3
min_depth: 1
# 图片懒加载
lazyload:
enable: true
# 归档页
archive:
type: less
# 版权信息
creative_commons:
license: by-nc-sa
language: deed.zh
post: true
clipboard: false
# 自定义封面图
cover:
default: /img/block.png
type: img
# 上下篇文章
post_pagination:
enable: true
type: small
# 文章过期提醒
notice_outdate:
enable: false
style: flat
limit_day: 365
position: top
# 文章破图时默认图片
error_img:
flink: /img/404.gif
post_page: /img/404.jpg
# 分类卡片
categorie_card:
enable: true
len: 2
list: ["已完成", "待验证"]
# 固定按钮块
rightside:
readmode: true
aside: true
# 日期格式化 Date Format
datetime_foramt:
post_card:
date: YY/MM/DD
time: HH:mm
post_info:
type: updated
date: MM/DD
time: HH:mm
archive:
date: MM/DD
time: HH:mm
# 代码高亮 Highlight
highlight:
theme: true
title: mac
copy: true
lang: true
code_word_wrap: true
height_limit: 200 # 超出时,显示折叠按钮
# 自定义图标 Icon
icons:
# 主题切换图标
sun: icon-sun
moon: icon-moon
# 首页视频播放
play: icon-yunhang
# 邮箱
email: icon-email
# 分类进入图标
next: icon-arrow-right
# 文章详情 日期
calendar: icon-rili
# 文章详情 时间
clock: icon-shijian
# 文章详情 作者
user: icon-yonghu
# 返回顶部 v1.1.3+
back_top: icon-backtop
# 查询 v1.1.5+
search: icon-chaxun
# 关闭 v1.1.5+
close: icon-guanbi
# 打赏 v1.1.7+
reward: icon-qiandai
# 用户信息和文章目录切换 v1.2.10+
user_tag: icon-yonghu1
toc_tag: icon-liebiao
# 右下角固定按钮 v1.2.11+
read: icon-yuedu
arrows: icon-arrows-h
# 代码块
double_arrows: icon-angle-double-down
copy: icon-copy
# 关于 About
about:
insert: none # 插入规则 before插入在内容前 | after插入在内容后 | none不插入
title: 温故而知新,可以为师矣。
introduction: 大家好,我是 Offends很高兴您能在浩瀚如烟的互联网世界里发现这个博客更感谢您能够饶有兴致地浏览这个页面。建立这个 Blog 是出于兴趣爱好,我将在此分会分享一些学习笔记,可能还会分享少许图片、视频以及其他有趣东西的链接。
blog:
<ul class="trm-list">
<li>程序Hexo </li>
<li>主题Hexo-theme-async </li>
</ul>
privacy: 本网站不会追踪访客行为,且不要求访客提供任何敏感信息(比如真实姓名、身份证号码、手机号等),因而也不存在任何隐私泄漏问题。访客参与评论,必须遵守法律法规和基本道德规范,文明礼貌。严禁发布任何有关淫秽、反动、暴力、博彩、恐吓、低俗的内容或违法信息,在尊重言论自由的同时请保持和平与理性。请勿对他人采取不友好的评论或其它过激行为。
# 评论 Comment
comment:
twikoo:
enable: true
envId: https://blog.offends.cn/twikoo
# 本地搜索
search:
enable: true
type: local
# 百度自动推送
baidu_push: true
# 字数统计
wordcount:
enable: true
count: true
time: true
# 数学公式
katex:
copy_tex: true
global: false
options: {}
# 渐入式应用
sw: true

16
app/index.less Normal file
View File

@@ -0,0 +1,16 @@
.var-primary(@primary: #afb42b; @primary-weak: #c0ca33) {
--primary : @primary;
--primary-70 : fade(@primary, 70%);
--primary-50 : fade(@primary, 50%);
--primary-30 : fade(@primary, 30%);
--primary-weak : @primary-weak;
--primary-weak-50: fade(@primary-weak, 50%);
}
:root {
.var-primary(#5a5df0, #697be2);
&.dark {
.var-primary(#a4ce60, #82df7a);
}
}

163
app/init.sh Normal file
View File

@@ -0,0 +1,163 @@
#!/bin/bash
#############################################################################################
# 用途: Hexo-Async-Deployer 项目初始化脚本
# 作者: 丁辉
# 编写日期: 2021-10-1
# 更新日期: 2024-07-09
#############################################################################################
# 加载检测脚本
source <(curl -sS https://gitee.com/offends/Linux/raw/main/File/Shell/Check_command.sh)
# 初始化基础信息
function INIT_BASE_INFO() {
# 修改基础模版
sed -i "s#language: en#language: zh-Hans#g" /hexo/_config.yml
sed -i "s#author: John Doe#author: Offends#g" /hexo/_config.yml
SEND_INFO "初始化基础信息"
# 本地搜索
CHECK_COMMAND_NULL npm install hexo-generator-searchdb
# 数字统计
CHECK_COMMAND_NULL npm install hexo-wordcount
# 初始化基础信息
CHECK_COMMAND_NULL mv /app/_config.async.yml /hexo/_config.async.yml
CHECK_DIR /hexo/source/_data/
CHECK_COMMAND_NULL mv /app/links.yml /hexo/source/_data/links.yml
CHECK_COMMAND_NULL mv /app/404.md /hexo/source/404.md
CHECK_COMMAND_NULL mv /app/site.webmanifest /hexo/source/site.webmanifest
CHECK_DIR /hexo/source/_data/style/
CHECK_COMMAND_NULL mv /app/index.less /hexo/source/_data/style/index.less
}
# 初始化页面
function INIT_PAGE() {
# 分类
CHECK_COMMAND_NULL npm install hexo-generator-category
# 页面名称
PAGE_NAME=(
"categories"
"links"
"about"
"comment"
)
# 循环创建页面
for name in ${PAGE_NAME[@]}; do
# 创建页面
CHECK_COMMAND_NULL hexo new page $name
if [ $? -eq 0 ]; then
# 创建页面成功
SEND_INFO "创建页面 $name 成功"
else
# 创建页面失败
SEND_WARN "创建页面 $name 失败"
fi
done
# 修改页面内容
# 友情链接
sed -i 's#title: links#title: 友情链接#g' /hexo/source/links/index.md
sed -i '3a\layout: links' /hexo/source/links/index.md
# 关于
sed -i 's#title: about#title: 关于#g' /hexo/source/about/index.md
sed -i '3a\layout: about' /hexo/source/about/index.md
sed -i '4a\single_column: false' /hexo/source/about/index.md
sed -i '5a\comments: false' /hexo/source/about/index.md
# 留言
sed -i 's#title: comment#title: 留言#g' /hexo/source/comment/index.md
sed -i '3a\layout: comment' /hexo/source/comment/index.md
# 分类
sed -i 's#title: categories#title: 分类#g' /hexo/source/categories/index.md
sed -i '3a\layout: category' /hexo/source/categories/index.md
sed -i '4a\single_column: true' /hexo/source/categories/index.md
sed -i '5a\comments: false' /hexo/source/categories/index.md
}
# 初始化图片
function INIT_IMAGE() {
# 存储地址
MINIO_URL="https://minio.offends.cn:9000/offends/hexo-async"
IMAGE_NAME=(
"avatar.png"
"favicon-16x16.png"
"favicon-32x32.png"
"block.png"
"desktop.png"
"wx.png"
"zfb.png"
"demo.png"
"404.gif"
"404.jpg"
)
CHECK_DIR /hexo/source/img
# 循环下载页面
for name in ${IMAGE_NAME[@]}; do
# 下载图片
CHECK_COMMAND_NULL curl -so /hexo/source/img/$name $MINIO_URL/$name
done
SEND_INFO "初始化图片成功"
}
# 收录配置
function INIT_BAIDU_SITEMAP() {
SEND_INFO "初始化收录配置"
################################## 百度Sitemap 和 Google Sitemap ##################################
CHECK_COMMAND_NULL npm install hexo-generator-sitemap
CHECK_COMMAND_NULL npm install hexo-generator-baidu-sitemap
sed -i "s#url: http://example.com#url: https://blog.offends.cn#g" /hexo/_config.yml
sed -i '/^url:/ {N; s/\n/\nroot: \/\n/;}' /hexo/_config.yml
sed -i 's/permalink: :year\/:month\/:day\/:title\//permalink: :title.html/' /hexo/_config.yml
cat << EOF >> /hexo/_config.yml
sitemap:
path: sitemap.xml
baidusitemap:
path: baidusitemap.xml
EOF
sed -i '1i<meta name="google-site-verification" content="V1iIzgHls93z_BAPofTvRD8jwh01u4Ls0fqXgGo86Ro" />' /hexo/node_modules/hexo-theme-async/layout/_partial/head.ejs
sed -i '1i<meta name="baidu-site-verification" content="codeva-MZXYU3JS1x" />' /hexo/node_modules/hexo-theme-async/layout/_partial/head.ejs
################################## 百度主动推送 ##################################
CHECK_COMMAND_NULL npm install hexo-baidu-url-submit
sed -i '/deploy:/!b;n;s/ type: \x27\x27/- type: baidu_url_submitter/' /hexo/_config.yml
cat << EOF >> /hexo/_config.yml
baidu_url_submit:
count: 200
host: blog.offends.cn
token: CRBfMzmp8EjAnQCl
path: baidu_urls.txt
EOF
}
# 添加看板娘
function ADD_TOUCH_ICON() {
SEND_INFO "添加看板娘"
git clone https://githubfast.com/stevenjoezhang/live2d-widget.git /hexo/node_modules/hexo-theme-async/source/live2d-widget
sed -i '1i<script src="/live2d-widget/autoload.js"></script>' /hexo/node_modules/hexo-theme-async/layout/_partial/head.ejs
sed -i '1i<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">' /hexo/node_modules/hexo-theme-async/layout/_partial/head.ejs
sed -i '2s/^/\/\/ /; 3s/^\/\///' /hexo/node_modules/hexo-theme-async/source/live2d-widget/autoload.js
sed -i 's/z-index: 1;/z-index: 9999;/g' /hexo/node_modules/hexo-theme-async/source/live2d-widget/waifu.css
sed -i 's/e=1/e=5/g' /hexo/node_modules/hexo-theme-async/source/live2d-widget/waifu-tips.js
}
# 音乐位置 : 符号去除
# function INIT_MUSIC() {
# sed -i 's/<%- __(item.key) %>:/<%- __(item.key) %>/g' /hexo/node_modules/hexo-theme-async/layout/_partial/sidebar/card/info.ejs
# }
# 执行全部初始化
function INIT_ALL() {
# 初始化基础信息
INIT_BASE_INFO
# 初始化页面
INIT_PAGE
# 初始化图片
INIT_IMAGE
# 收录配置
INIT_BAIDU_SITEMAP
# 添加看板娘
ADD_TOUCH_ICON
}
INIT_ALL

3
app/languages.yml Normal file
View File

@@ -0,0 +1,3 @@
zh-Hans:
site:
title: 本站信息

8
app/links.yml Normal file
View File

@@ -0,0 +1,8 @@
- name: 31100Cafe
url: https://www.biuling.top
image: https://jsd.cdn.zzko.cn/gh/CheckingChen/image-hosting@master/avatar.6awsc8i38s80.webp
desc: Creativity,起飞!
- name: 白云苍狗
url: https://www.imalun.com
image: https://www.imalun.com/images/avatar.jpg?v=1
desc: 醒,亦在人间;梦,亦在人间。

20
app/site.webmanifest Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "Offends",
"short_name": "Offends",
"icons": [
{
"src": "/img/favicon-16x16.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/img/favicon-32x32.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#fff",
"background_color": "#fff",
"display": "standalone",
"start_url": "/"
}