fresh start

This commit is contained in:
sagrrecn
2026-02-19 13:13:03 +08:00
commit 9bbf98d0b9
322 changed files with 15696 additions and 0 deletions

25
component/logo.php Normal file
View File

@@ -0,0 +1,25 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<?php if ($this->options->logoUrl): ?>
<div class="flex justify-center relative nav-li">
<a itemprop="url" href="<?php $this->options->siteUrl(); ?>">
<img itemprop="logo"
src="<?php echo $this->options->logoUrl; ?>"
alt="<?php $this->options->title(); ?>" width="50" height="50"
loading="lazy"
class="rounded object-cover"/>
</a>
<span class="jasmine-primary-bg text-white px-2 py-1 absolute w-full rounded top-[5px] left-[90px] w-max"
style="display: none">
<?php echo getOptionValueOrDefault("logoText", $this->options->title); ?>
</span>
</div>
<?php endif; ?>
<?php if ($this->is("index")): ?>
<div class="hidden">
<h1><?php $this->options->title(); ?></h1>
<p><?php $this->options->description(); ?></p>
</div>
<?php endif; ?>

151
component/menu.php Normal file
View File

@@ -0,0 +1,151 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<div id="header-menu" class="jasmine-primary-color hidden lg:block sticky top-0 border-b bt lg:py-5 bg-[#ffffffe6] dark:bg-[rgba(22,24,41,0.9)] dark:border-neutral-600 backdrop-blur">
<div id="header-menu-wrap" class="flex justify-between hidden lg:flex z-50">
<ul class="nav flex items-center gap-x-3">
<li>
<a title="首页" href="<?php $this->options->siteUrl(); ?>"
class="rounded-full px-4 py-2 jasmine-primary-bg-hover cat-hover hover:text-white hover:shadow-lg">首页</a>
</li>
<?php $this->widget("Jasmine_Meta_Row")->to($categorys); ?>
<?php if ($categorys->have()): ?>
<?php while ($categorys->next()): ?>
<li>
<a href="<?php $categorys->permalink(); ?>"
title="<?php $categorys->name(); ?>"
class="rounded-full px-4 py-2 jasmine-primary-bg-hover cat-hover hover:text-white hover:shadow-lg">
<?php $categorys->name(); ?>
</a>
</li>
<?php endwhile; ?>
<?php endif; ?>
<!--<li><a href="https://www.shitoucuo.com/memos" class="rounded-full px-4 py-2 cat-hover jasmine-primary-bg-hover hover:text-white hover:shadow-lg">灵感</a></li> <meta itemprop="url" content="<?php $this->options->siteUrl(); ?>">-->
<!--<li><a href="https://www.shitoucuo.com/category-tushuo.html" class="rounded-full px-4 py-2 jasmine-primary-bg-hover hover:text-white hover:shadow-lg">图说</a></li>-->
<!--<li><a href="https://www.shitoucuo.com/movies.html" class="rounded-full px-4 py-2 jasmine-primary-bg-hover hover:text-white hover:shadow-lg">观影</a></li>
<li><a href="https://www.shitoucuo.com/books.html" class="rounded-full px-4 py-2 jasmine-primary-bg-hover hover:text-white hover:shadow-lg">阅读</a></li>-->
<!--<li><a href="https://www.shitoucuo.com/mailbox.html" class="rounded-full px-4 py-2 jasmine-primary-bg-hover hover:text-white hover:shadow-lg">友筒</a></li>-->
<!-- <li><a href="links.html" class="rounded-full px-4 py-2 cat-hover jasmine-primary-bg-hover hover:text-white hover:shadow-lg">友圈</a></li>-->
<?php if (Typecho_Widget::widget('Widget_User')->hasLogin()){?>
<li><a href="https://www.shitoucuo.com/sl.html" class="rounded-full px-4 py-2 cat-hover jasmine-primary-bg-hover hover:text-white hover:shadow-lg">速览</a></li>
<!--<li><a href="https://www.shitoucuo.com/rp.html" class="rounded-full px-4 py-2 cat-hover jasmine-primary-bg-hover hover:text-white hover:shadow-lg">锐评</a></li>-->
<!--<li><a href="https://www.shitoucuo.com/dw.html" class="rounded-full px-4 py-2 cat-hover jasmine-primary-bg-hover hover:text-white hover:shadow-lg">短文</a></li>-->
<li><a href="https://www.shitoucuo.com/gd.html" class="rounded-full px-4 py-2 cat-hover jasmine-primary-bg-hover hover:text-white hover:shadow-lg">归档</a></li><?php } ?>
<form method="post" action="" id="search" itemprop="potentialAction" itemscope="" itemtype="https://schema.org/SearchAction">
<meta itemprop="target" content="<?php $this->options->siteUrl(); ?>search/{s}/">
<label for="search" class="flex flex-row">
<button class="my-2 cat-hover cat-search pt-2" onclick="jasmine.clickSearch()">
<iconify-icon icon="tabler:search"
class="rounded px-1 text-lg jasmine-link-color"></iconify-icon>
</button>
<input class=" duration-300 my-2 w-0 focus:w-32 bg-transparent" itemprop="query-input" id="search-input" type="text" name="s" required="true" autocomplete="off" placeholder=" 请输入关键词">
</label>
</form>
<!--<li><a href="https://www.shitoucuo.com/aboutme.html" class="rounded-full px-4 py-2 cat-hover
jasmine-primary-bg-hover hover:text-white hover:shadow-lg">关于</a></li>-->
<!-- <li><a href="archive.html" class="rounded-full px-4 py-2 jasmine-primary-bg-hover hover:text-white hover:shadow-lg">归档</a></li>-->
<!--<li><a href="https://www.shitoucuo.com/aboutme.html" class="rounded-full px-4 py-2 cat-hover
jasmine-primary-bg-hover hover:text-white hover:shadow-lg">关于</a></li>
<li itemscope="" itemtype="https://schema.org/WebSite">-->
</ul>
<!--<ul class="nav flex items-center gap-x-3">
<li itemscope="" itemtype="https://schema.org/WebSite">
<meta itemprop="url" content="<?php $this->options->siteUrl(); ?>">
<form method="post" action="" id="search" itemprop="potentialAction" itemscope="" itemtype="https://schema.org/SearchAction">
<meta itemprop="target" content="<?php $this->options->siteUrl(); ?>search/{s}/">
<label for="search" class="flex flex-row">
<button class="my-2 pt-2" onclick="jasmine.clickSearch()">
<iconify-icon icon="tabler:search"
class="rounded px-1 text-lg jasmine-link-color"></iconify-icon>
</button>
<input class=" duration-300 my-2 w-0 focus:w-32 bg-transparent" itemprop="query-input" id="search-input" type="text" name="s" required="true" autocomplete="off" placeholder="Search">
</label>
</form>
</li>
</ul>-->
</div>
</div>
<div class="divline"></div>
<div id="header-menu-mobile" class="mbh jasmine-primary-color lg:hidden flex justify-between sticky top-0 border-b border-stone-100 py-3 z-50 bg-[#ffffffe6] dark:bg-[rgba(22,24,41,0.9)] dark:text-neutral-300 dark:border-neutral-600 backdrop-blur">
<ul class="nav flex items-center gap-x-3">
<li>
<?php $this->need("component/logo.php"); ?>
</li>
</ul>
<ul class="nav flex items-center gap-x-3">
<li>
<button onclick="jasmine.switchDark()">
<iconify-icon icon="<?php echo getOptionValueOrDefault("switchDarkIconPhone", "tabler:sun-moon"); ?>"
class="rounded px-3 py-2 text-lg"></iconify-icon>
</button>
</li>
<li>
<form method="post" action="" id="search" itemprop="potentialAction" itemscope="" itemtype="https://schema.org/SearchAction">
<meta itemprop="target" content="<?php $this->options->siteUrl(); ?>search/{s}/">
<label for="search" class="flex flex-row">
<button class="" onclick="jasmine.clickSearch()">
<iconify-icon icon="tabler:search"
class="rounded px-3 py-2 text-lg"></iconify-icon>
</button>
<input class=" duration-300 my-2 w-0 focus:w-32 bg-transparent" itemprop="query-input" id="search-input" type="text" name="s" required="true" autocomplete="off" placeholder="Search">
</label>
</form>
</li>
<li>
<button onclick="jasmine.toggleMobileMenu()">
<iconify-icon icon="tabler:menu-2"
class="rounded px-3 py-2 text-lg"></iconify-icon>
</button>
</li>
</ul>
</div>
<div id="mobile-menus-bg" class="lg:hidden hidden fixed top-0 left-0 z-[999] bg-gray-500/50 dark:bg-[#0a0c19]/50 w-full min-h-screen"></div>
<div id="mobile-menus" class="lg:hidden fixed top-0 left-0 z-[1000] translate-x-[-1000px] w-4/5 duration-300">
<div class="jasmine-primary-color bg-stone-100 min-h-screen flex flex-col gap-y-14 px-5 pt-14 dark:bg-[#161829]">
<ul class="flex flex-col items-center gap-y-3">
<li class="bg-white rounded w-full dark:bg-gray-700 ">
<a title="首页" href="<?php $this->options->siteUrl(); ?>"
class="w-full block px-4 py-2">首页</a>
</li>
<?php $this->widget("Jasmine_Meta_Row")->to($categorys); ?>
<?php if ($categorys->have()): ?>
<?php while ($categorys->next()): ?>
<li class="bg-white rounded w-full dark:bg-gray-700 ">
<a href="<?php $categorys->permalink(); ?>"
title="<?php $categorys->name(); ?>"
class="w-full block px-4 py-2">
<?php $categorys->name(); ?>
</a>
</li>
<?php endwhile; ?>
<?php endif; ?>
</ul>
<ul class="flex flex-col items-center gap-y-3 w-full">
<?php $menus = getLeftSidebarMenu(); ?>
<?php if (!empty($menus)): ?>
<?php foreach ($menus as $menu): ?>
<li class="bg-white rounded w-full dark:bg-gray-700 ">
<a class="w-full block px-4 py-2" href="<?php echo $menu["url"]; ?>" target="<?php echo $menu[
"newTab"
]
? "_blank"
: "_self"; ?>" title="<?php echo $menu["name"]; ?>">
<?php echo $menu["name"]; ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>

15
component/paging.php Normal file
View File

@@ -0,0 +1,15 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<div class="flex justify-center">
<div class="bg-block"></div>
<nav aria-label="Page navigation" id="page-nav">
<?php $this->pageNav("", "", 1, "...", [
"wrapTag" => "ul",
"wrapClass" => "flex gap-x-5",
"itemTag" => "li",
"currentClass" => "active",
]); ?>
</nav>
</div>

View File

@@ -0,0 +1,80 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<div class="flex flex-row wz" itemscope itemtype="https://schema.org/NewsArticle" style="border-radius:1rem;">
<div class=" flex flex-1 flex-col justify-between gap-y-3">
<?php
$thumbnail = getThumbnail($this->cid, "");
$autoThumbnailCategories = array('探店', '爸爸厨房', '户外'); // 需要自动获取封面的分类
// 获取当前文章的分类
$categories = $this->categories;
$currentCategory = '';
if (!empty($categories)) {
$currentCategory = $categories[0]['name'];
}
// 封面显示逻辑
$showThumbnail = false;
if ($thumbnail) {
// 如果有手动设置的封面,始终显示
$showThumbnail = true;
} elseif (in_array($currentCategory, $autoThumbnailCategories)) {
// 如果是指定分类且没有设置封面,从文章内容中提取第一张图片
preg_match_all('/<img.*?src=["\'](.*?)["\']/i', $this->content, $matches);
if (!empty($matches[1])) {
$thumbnail = $matches[1][0];
$showThumbnail = true;
}
}
if ($showThumbnail && $thumbnail): ?>
<a href="<?php $this->permalink(); ?>" title="<?php $this->title(); ?>" class="">
<img src="<?php echo $thumbnail; ?>" alt="<?php $this->title(); ?>" width="100%"
height="90"
class="h-[260px] rounded object-cover" loading="lazy"/>
</a>
<?php endif; ?>
<h2 class="jasmine-link-color-hover text-black line-clamp-1 text-xl jasmine-letter-spacing dark:text-neutral-200" itemprop="headline">
<?php echo getTimeLabel($this->date->timeStamp); ?>
<?php
// 从文章内容中统计图片标签
preg_match_all('/<img[^>]+>/i', $this->content, $matches);
$imageCount = count($matches[0]);
// 调试信息
if ($imageCount > 0) {
if ($imageCount < 20) {
echo '<span class="nwe">有图</span>';
} else {
echo '<span class="nwe">多图</span>';
}
}
?><a href="<?php $this->permalink(); ?>" class="ptitle" title="<?php $this->title(); ?>"><?php $this->title(); ?></a>
</h2>
<div class="dark:text-gray-400 tm-ca">
<span><i class="iconfont icon-zuozhe"></i> <a href="<?php $this->author->permalink(); ?> "><?php $this->author() ?></a></span>
<!--<span class="jasmine-link-color">--><span><i class="iconfont icon-fenlei"></i> <?php $this->category("·", true, "无"); ?></span>
<span> <i class="iconfont icon-shijian_o"></i> <?php echo date('Y-m-d H:i:s' , $this->created);?></span>
</div>
<p class="line-clamp-2 jasmine-letter-spacing dark:dark:text-gray-400 break-all" itemprop="abstract">
<a href="<?php $this->permalink(); ?>"
title="<?php $this->title(); ?>">
<!--摘要处理有自定义description字段显示自定义内容没有则按现有方式截取-->
<?php
// 检查是否有自定义description字段
$customDescription = $this->fields->description;
if (!empty($customDescription)) {
// 如果有自定义描述,直接显示
echo Typecho_Common::subStr(strip_tags($customDescription), 0, 100, '...');
} else {
// 如果没有自定义描述使用原有的excerpt方法
$this->excerpt(100, "");
}
?>
</a>
</p>
</div>
</div>

View File

@@ -0,0 +1,29 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<style>
.post-TianliGPT{display:none;}
</style>
<div class="flex flex-col gap-y-3" itemscope itemtype="https://schema.org/NewsArticle">
<!-- 2023.7.28 干掉说说头像日期等 <div class="flex flex-row gap-x-3 item-center">
<img class="rounded object-cover w-[42px] h-[42px]" width="42" height="42"
src="<?php echo getAvatarByMail($this->author->mail, true); ?>"
loading="lazy"
alt="<?php $this->author->screenName(); ?>">
<div class="flex flex-col justify-center">
<span class=""><?php $this->author->screenName(); ?></span>
<span class=" text-sm"><?php echo getHumanizedDate($this->created); ?></span>
</div>
</div>-->
<div class="markdown-body markdown-body-list !bg-stone-100 rounded p-5 relative dark:!bg-[#0d1117] !text-neutral-900 dark:!text-neutral-200" id="moment" style="margin-top:0px;">
<div class="dark:text-gray-400 tm-ca" style="padding-bottom:10px;">
<span><i class="iconfont icon-shijian_o"></i> <?php echo date('Y/m/d H:i:s' , $this->created);?></span>
</br><span><i class="iconfont icon-zuozhe"></i> <?php $this->author() ?></span>
</div>
<?php echo handleContent($this->content);?>
<div class="btt"> <a href="<?php $this->permalink(); ?>" title="<?php $this->title(); ?>"><?php $this->title(); ?></a></div>
</div>
</div>

16
component/post-item.php Normal file
View File

@@ -0,0 +1,16 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<div class="mx-1 flex flex-col gap-y-12 pb-12 border-stone-100 dark:border-neutral-600">
<div></div>
<?php while ($this->next()): ?>
<?php if (isShuoShuoType($this->cid)): ?>
<?php $this->need("component/post-item-moment.php"); ?>
<?php elseif ($this->fields->Postype==1): ?>
<?php $this->need("component/post-item-tu.php"); ?>
<?php else: ?>
<?php $this->need("component/post-item-default.php"); ?>
<?php endif; ?>
<?php endwhile; ?>
</div>

49
component/post-title.php Normal file
View File

@@ -0,0 +1,49 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<style>
.mr-3 {
margin-right:0rem!important;
}
.dark .markdown-body{margin-top:0px!important;}
</style>
<div class="mx-1 flex flex-col">
<?php SimpleBreadcrumb_Plugin::show(); ?>
<div></div>
<div class="flex flex-row" itemscope itemtype="https://schema.org/NewsArticle">
<div class="mr-3 flex flex-1 flex-col justify-center gap-y-5" style="text-align:center;">
<h1 class="text-2xl ntitle font-semibold jasmine-primary-color jasmine-letter-spacing" itemprop="headline">
<?php $this->title(); ?>
</h1>
<div class="dark:text-gray-400" style="text-align:center;">
<div class="ICON">
<!--<span><i class="iconfont icon-xiugai"></i> <?php echo date('Y-m-d H:i' , $this->created); ?></span>-->
<span><i class="iconfont icon-xiugai"></i> <?php $weekday = date('w', $this->created); // 获取数字0(周日)到6(周六)
$weekday_cn = ['日', '一', '二', '三', '四', '五', '六'];
echo date('Y-m-d H:i', $this->created) . ' 星期' . $weekday_cn[$weekday];
;?></span>
<span><i class="iconfont icon-iddenglu"></i> <?php $this->cid(); ?></span><br>
<?php if ($this->is('post')) : ?>
<span><<?php $this->category(','); ?>></span>
<?php endif; ?>
<?php
// 自动显示(已内置)
// 或手动调用
echo ArticleWeather_Plugin::show($this->cid);
?>
<?php if (class_exists('EditHistory_Plugin')): ?>
<?php echo EditHistory_Plugin::output(); ?>
<?php endif; ?>
</div>
</div>
<span class="hidden" itemprop="author" itemscope itemtype="https://schema.org/Person">
<meta itemprop="url" content="<?php $this->author->permalink(); ?>"/>
<a itemprop="url" href="<?php $this->author->permalink(); ?>">
<span itemprop="name"><?php $this->author->screenName(); ?></span>
</a>
</span>
</div>
</div>
</div>

28
component/post-top.php Normal file
View File

@@ -0,0 +1,28 @@
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<?php
$cids = getStickyPost();
if (null != $cids): ?>
<div class="flex zd flex-wrap flex-col lg:flex-row gap-y-12 border-stone-100 dark:border-neutral-600">
<?php foreach ($cids as $cid): ?>
<?php $this->widget("Widget_Archive@jasmine" . $cid, "pageSize=1&type=post", "cid=" . $cid)->to($item); ?>
<div class="zdwz" style="width:100%;">
<?php if ($thumbnail = getThumbnail($item->cid, "")): ?>
<a href="<?php $item->permalink(); ?>" title="<?php $item->title(); ?>" class=""
title="<?php $item->title(); ?>">
<img
src="<?php echo $thumbnail; ?>"
alt="" width="100%"
height="260"
alt="<?php $item->title(); ?>"
loading="lazy"
class="h-[260px] rounded object-cover"/ style="margin-bottom:0px;">
</a>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif;?>