挑长期维护的主题、插件,第一次搭建Ty很多不懂,用Jasmine过渡一段时间
Typecho安装配置
debug模式config.inc.php
define('__TYPECHO_DEBUG__', TRUE);
nginx配置rewrite 永久链接{slug}.html
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
主题配置
主题选择
主题 | 最后更新于 |
---|---|
Jasmine | 2023.06.17 |
Cuteen | 2023.06.05 |
Mirages | 2023.04.23 |
handsome | 2022.10.29 |
Akina | 2022.08.05 |
Nabo | 2020.08.20 |
initial | 2022.02.20 |
暂定Jasmine,Mirages比较简约好看,可能受关关哥影响。Cuteen、Handsome复杂但有时光机,问题也不大,自建memos
菜单配置
[
{
"name": "首页",
"icon": "tabler:home",
"url": "/",
"newTab": false
},
{
"name": "关于",
"icon": "tabler:user-circle",
"url": "/about.html",
"newTab": false
},
{
"name": "一百件事",
"icon": "tabler:heartbeat",
"url": "/hundred.html",
"newTab": false
},
{
"name": "归档",
"icon": "tabler:archive",
"url": "/archive.html",
"newTab": false
},
{
"name": "相册",
"icon": "tabler:photo",
"url": "/photos.html",
"newTab": false
},
{
"name": "随机",
"icon": "tabler:arrows-random",
"url": "/random.html",
"newTab": false
},
{
"name": "友链",
"icon": "tabler:plane-tilt",
"url": "/link.html",
"newTab": false
},
{
"name": "之昂张",
"icon": "tabler:mood-boy",
"url": "https://zhsher.cn",
"newTab": false
}
]
域名配置
- 域名选择、备案、提交管局、配ssl,暂定
blog.zhsher.cn
- 备案号 晋ICP备2022005322号
- cdn网络分发
插件
- RSS订阅
- AAEditor:编辑器优化
数据库备份
- benzBrake/AutoBackup
- jrotty/AutoBackup:作者已不维护
- 宝塔COS插件✅
- 邮件 1、2UI相同
- Typecho-Plugin-Notice支持Server、Qmsg、SMTP
- LoveKKCommentModify支持SMTP、Send Cloud、阿里云邮件
- Comment2Mail支持SMTP,可以配置收件人✅
- CommentNotifier支持 SMTP 阿里云推送,可以配置收件人
- 百度、谷歌、bing的分析
百度、谷歌、51la的统计,51la灵鹊
- 自定义头部
/www/wwwroot/blog/usr/themes/Jasmine/header.php
<!--自定义--> <!-- Google tag (gtag.js) --> <!--百度统计--> <!--灵鹊检测-->
- 51la-Analysis-Typecho-Plugin:51la分析
- 自定义头部
- MoePlayer/APlayer-Typecho:播放器
- Mourn:全站变灰
-
BaiduSubmit、Sitemap-For-Typecho:百度主动推送 - tagshelper:标签管理
评论脱敏
图片管理
//获取文件名 $filePath='/blog/'.date('Y').'/'.date('m').'/'.date('d').'/'; $fileName=$file['name'];
- typecho-markdown:markdown解析
友链
- 外链自动转换插件 ShortLinks - Typecho插件:外链转内链
- Typecho-AMP:Google AMP/Baidu MIP 标准页面,进一步优化谷歌和百度的搜索结果
- Lopwon IP:评论IP
- typecho-AliceStyle:美化插件 报错
defined() expects exactly 1 argument, 2 given
相关资源
魔改
统计
自定义头部/www/wwwroot/blog/usr/themes/Jasmine/header.php
自定义JS
//修改侧边栏信息
var right_img = document.querySelector("#sidebar-right .sidebar__right__inner .flex .gap-x-3");
right_img.querySelectorAll('img')[0].setAttribute("alt", "了一昂梁");
right_img.querySelectorAll('.jasmine-primary-color')[0].innerHTML = "了一昂梁";
//设置头像
var imgElements = document.querySelectorAll("img[alt='之昂张']");
imgElements.forEach(function(element) {
element.setAttribute("src", "https://imgl.zhsher.cn/blog/config/avatar-zhang.webp");
});
灯箱
自定义css
.z-\[999\] {
z-index: 500;
}
自定义js
//图片灯箱
window.ViewImage && ViewImage.init('.markdown-body img');
footer.php
+<script src="https://jsd.onmicrosoft.cn/gh/Tokinx/ViewImage/view-image.min.js"></script>
<script>
<?php $this->options->customScript(); ?>
</script>
友链
由于主题没有友链,自己小撕了一个
欢迎加入 Typecho 大家族