1.0
This commit is contained in:
19
404.php
Normal file
19
404.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
|
||||
<main class="container">
|
||||
<div class="container-thin">
|
||||
<h1 class="text-center" style="font-size: 4rem; margin-bottom: 2rem">404</h1>
|
||||
<ul style="margin-bottom: 2rem">
|
||||
<li>当前页面无法访问,可能没权限或已删除。</li>
|
||||
<li>The current page is not accessible, may not have permission or has been deleted.</li>
|
||||
<li>La page actuelle n'est pas accessible, elle n'a peut-être pas de droits ou a été supprimée.</li>
|
||||
<li>No se puede acceder a la página actual, puede que no tenga permiso o que haya sido eliminada.</li>
|
||||
<li>Доступ к текущей странице невозможен, возможно, у нее нет разрешения или она была удалена.</li>
|
||||
<li>現在のページにアクセスできない、権限がない、または削除された可能性があります。</li>
|
||||
</ul>
|
||||
<p class="text-center"><a href="<?php $this->options->siteUrl(); ?>" role="button" class="outline"><?php _e('回首页'); ?></a></p>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php $this->need('footer.php'); ?>
|
||||
46
comments.php
Normal file
46
comments.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div id="comments">
|
||||
<?php $this->comments()->to($comments); ?>
|
||||
<?php if ($comments->have()): ?>
|
||||
<h2 class="text-center"><?php $this->commentsNum(_t('暂无评论'), _t('1 条评论'), _t('%d 条评论')); ?></h2>
|
||||
|
||||
<?php $comments->listComments(array(
|
||||
'commentStatus' => _t('你的评论正等待审核'),
|
||||
'avatarSize' => 64,
|
||||
'defaultAvatar' => 'identicon'
|
||||
)); ?>
|
||||
|
||||
<nav><?php $comments->pageNav(_t('前一页'), _t('后一页'), 3, '...', array('wrapTag' => 'ul', 'itemTag' => 'li')); ?></nav>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->allow('comment')): ?>
|
||||
<div id="<?php $this->respondId(); ?>" class="respond">
|
||||
<div class="cancel-comment-reply">
|
||||
<?php $comments->cancelReply(); ?>
|
||||
</div>
|
||||
|
||||
<h5 id="response"><?php _e('你的评论'); ?></h5>
|
||||
|
||||
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
|
||||
<div class="grid">
|
||||
<textarea placeholder="<?php _e('评论内容...'); ?>" rows="4" cols="300" name="text" id="textarea" required><?php $this->remember('text'); ?></textarea>
|
||||
</div>
|
||||
<?php if ($this->user->hasLogin()): ?>
|
||||
<p>
|
||||
<?php _e('登录身份:'); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a><span class="mx-2 text-muted">·</span><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a>
|
||||
</p>
|
||||
<?php else: ?>
|
||||
<div class="grid">
|
||||
<input type="text" placeholder="<?php _e('名字'); ?>" name="author" id="author" value="<?php $this->remember('author'); ?>" required/>
|
||||
<input type="email" placeholder="<?php _e('Email'); ?>" name="mail" id="mail" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> />
|
||||
<input type="url" placeholder="<?php _e('http://网站'); ?><?php if (!$this->options->commentsRequireUrl): ?><?php _e('(选填)'); ?><?php endif; ?>" name="url" id="url" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireUrl): ?> required<?php endif; ?> />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button type="submit"><?php _e('提交评论'); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="text-center text-muted"><?php _e('评论已关闭'); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
19
footer.php
Normal file
19
footer.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<footer class="site-footer container-fluid">
|
||||
<div class="d-flex justify-content-between">
|
||||
<ul class="list-inline text-muted">
|
||||
<li>© <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><!--<?php $this->options->title(); ?>--> SANGUSHUI.COM</a></li>
|
||||
<!--<li><a href="<?php $this->options->feedUrl(); ?>"><?php _e('RSS'); ?></a></li>-->
|
||||
</ul>
|
||||
<ul class="list-inline text-muted">
|
||||
<li>
|
||||
SINCE 2026.01.26
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php $this->footer(); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
51
functions.php
Normal file
51
functions.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
|
||||
function themeConfig($form)
|
||||
{
|
||||
$logoUrl = new \Typecho\Widget\Helper\Form\Element\Text(
|
||||
'logoUrl',
|
||||
null,
|
||||
null,
|
||||
_t('网站 Logo'),
|
||||
_t('在这里填写图片 URL,网站将显示 Logo')
|
||||
);
|
||||
|
||||
$form->addInput($logoUrl->addRule('url', _t('请填写正确的 URL 地址')));
|
||||
|
||||
$colorSchema = new \Typecho\Widget\Helper\Form\Element\Select(
|
||||
'colorSchema',
|
||||
array(
|
||||
null => _t('自动'),
|
||||
'light' => _t('浅色'),
|
||||
'dark' => _t('深色'),
|
||||
'customize' => _t('自定义'),
|
||||
),
|
||||
null,
|
||||
_t('外观风格'),
|
||||
_t('如果选择了自定义,主题将使用 theme.css 的样式')
|
||||
);
|
||||
|
||||
$form->addInput($colorSchema);
|
||||
}
|
||||
|
||||
function postMeta(
|
||||
\Widget\Archive $archive,
|
||||
string $metaType = 'archive'
|
||||
)
|
||||
{
|
||||
?>
|
||||
<header class="entry-header text-center">
|
||||
<h1 class="entry-title" itemprop="name headline">
|
||||
<a href="<?php $archive->permalink() ?>" itemprop="url"><?php $archive->title() ?></a>
|
||||
</h1>
|
||||
<?php if ($metaType != 'page'): ?>
|
||||
<ul class="entry-meta list-inline text-muted">
|
||||
<li class="feather-calendar"><time datetime="<?php $archive->date('c'); ?>" itemprop="datePublished"><?php $archive->date(); ?></time></li>
|
||||
<li class="feather-folder"><?php $archive->category(', '); ?></li>
|
||||
<li class="feather-message"><a href="<?php $archive->permalink() ?>#comments" itemprop="discussionUrl"><?php $archive->commentsNum(_t('暂无评论'), _t('1 条评论'), _t('%d 条评论')); ?></a></li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
<?php
|
||||
}
|
||||
68
header.php
Normal file
68
header.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans"<?php if ($this->options->colorSchema): ?> data-theme="<?php $this->options->colorSchema(); ?>"<?php endif; ?>>
|
||||
<head>
|
||||
<meta charset="<?php $this->options->charset(); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php $this->archiveTitle('', '', ' | '); ?><?php $this->options->title(); ?><?php if ($this->is('index')): ?> | <?php $this->options->description() ?><?php endif; ?></title>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('static/css/style.css'); ?>">
|
||||
<!--<script src="https://www.sangushui.com/usr/plugins/FontLibs/static//css/css.php?type=3&path=https://qcm.xgsd.cc/font/"></script>-->
|
||||
<?php if ($this->options->colorSchema == 'customize'): ?>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('theme.css'); ?>">
|
||||
<?php endif; ?>
|
||||
<?php $this->header(); ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header class="site-navbar container-fluid">
|
||||
<nav>
|
||||
<ul class="site-name">
|
||||
<?php if ($this->options->logoUrl): ?>
|
||||
<li><a href="<?php $this->options->siteUrl(); ?>" class="brand"><img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>"></a></li>
|
||||
<?php else: ?>
|
||||
<li>
|
||||
<a href="<?php $this->options->siteUrl(); ?>" class="brand"><?php $this->options->title() ?></a>
|
||||
</li>
|
||||
<li class="desc"><?php $this->options->description() ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<label for="nav-toggler" class="nav-toggler-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" /></svg>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<nav class="site-nav">
|
||||
<input type="checkbox" id="nav-toggler">
|
||||
|
||||
<ul class="nav-menu">
|
||||
<li>
|
||||
<a href="<?php $this->options->siteUrl(); ?>"<?php if ($this->is('index')): ?> class="active"<?php endif; ?>><?php _e('首页'); ?></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://www.sangushui.com/category-gongju.html">工具</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.sangushui.com/category-kuozhan.html">扩展</a>
|
||||
</li>
|
||||
|
||||
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
|
||||
<?php while ($pages->next()): ?>
|
||||
<li>
|
||||
<a href="<?php $pages->permalink(); ?>"<?php if ($this->is('page', $pages->slug)): ?> class="active"<?php endif; ?>><?php $pages->title(); ?></a>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
<!--<li>
|
||||
<form method="post" action="<?php $this->options->siteUrl(); ?>">
|
||||
<input type="search" id="s" name="s">
|
||||
</form>
|
||||
</li>-->
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
48
index.php
Normal file
48
index.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* SANGUSHUI.COM
|
||||
*
|
||||
* @package SANGUSHUI
|
||||
* @author sangushui
|
||||
* @version 1.0
|
||||
* @link https://www.sangushui.com/
|
||||
*/
|
||||
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
$this->need('header.php');
|
||||
?>
|
||||
|
||||
<main class="container">
|
||||
<div class="container-thin">
|
||||
<!--<?php if (!($this->is('index')) && !($this->is('post'))): ?>
|
||||
<h6 class="text-center text-muted">
|
||||
<?php $this->archiveTitle([
|
||||
'category' => _t('分类 %s 下的文章'),
|
||||
'search' => _t('包含关键字 %s 的文章'),
|
||||
'tag' => _t('标签 %s 下的文章'),
|
||||
'author' => _t('%s 发布的文章')
|
||||
], '', ''); ?>
|
||||
</h6>
|
||||
<?php endif; ?>-->
|
||||
|
||||
<?php while ($this->next()): ?>
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<?php postMeta($this); ?>
|
||||
|
||||
<div class="entry-content fmt" itemprop="articleBody">
|
||||
<?php
|
||||
// 直接使用 content() 方法的摘要模式
|
||||
$this->excerpt(200, '...');
|
||||
?>
|
||||
<p><a href="<?php $this->permalink(); ?>" class="more-link"><?php _e('< 阅读全文 >'); ?></a></p>
|
||||
</div>
|
||||
</article>
|
||||
<hr class="post-separator">
|
||||
<?php endwhile; ?>
|
||||
|
||||
<nav><?php $this->pageNav(_t('前一页'), _t('后一页'), 2, '...', array('wrapTag' => 'ul', 'itemTag' => 'li')); ?></nav>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<?php $this->need('footer.php'); ?>
|
||||
24
page.php
Normal file
24
page.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
.post{padding:40px 40px 20px 40px!important;}
|
||||
</style>
|
||||
<main class="container">
|
||||
<div class="container-thin">
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<!--<?php postMeta($this, 'page'); ?>-->
|
||||
|
||||
<div class="entry-content fmt" itemprop="articleBody">
|
||||
<?php $this->content(); ?>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<!--<?php $this->need('comments.php'); ?>-->
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php $this->need('footer.php'); ?>
|
||||
31
post.php
Normal file
31
post.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<style>
|
||||
.tags a::before {
|
||||
content: "#";
|
||||
}
|
||||
</style>
|
||||
<main class="container">
|
||||
<div class="container-thin">
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<?php postMeta($this, 'post'); ?>
|
||||
|
||||
<div class="entry-content fmt" itemprop="articleBody">
|
||||
<?php $this->content(); ?>
|
||||
<p itemprop="keywords" class=“tags” style="text-align:center;padding-top:20px;text-decoration:none;"><?php _e('标签'); ?>:<?php $this->tags(' ', true, _t('无')); ?>
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<!--<nav class="post-nav">
|
||||
<ul class="page-navigator">
|
||||
<li class="prev"><?php $this->thePrev('%s', _t('没有了')); ?></li>
|
||||
<li class="next"><?php $this->theNext('%s', _t('没有了')); ?></li>
|
||||
</ul>
|
||||
</nav>-->
|
||||
|
||||
<!--<?php $this->need('comments.php'); ?>-->
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php $this->need('footer.php'); ?>
|
||||
BIN
screenshot.png
Normal file
BIN
screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
42
search.php
Normal file
42
search.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
|
||||
<main class="container">
|
||||
<div class="container-thin">
|
||||
|
||||
<h1 class="text-center"><?php _e('搜索'); ?></h1>
|
||||
|
||||
<form method="post" action="<?php $this->options->siteUrl(); ?>">
|
||||
<input type="search" id="s" name="s" placeholder="<?php _e('搜索关键字'); ?>" value="<?php $this->archiveTitle('','',''); ?>">
|
||||
</form>
|
||||
|
||||
<div class="text-center">
|
||||
<?php \Widget\Metas\Category\Rows::alloc()->listCategories('wrapClass=list-inline'); ?>
|
||||
</div>
|
||||
|
||||
<hr class="post-separator">
|
||||
|
||||
<?php if ($this->have()): ?>
|
||||
<?php while ($this->next()): ?>
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<?php postMeta($this); ?>
|
||||
|
||||
<div class="entry-content fmt" itemprop="articleBody">
|
||||
<?php $this->content('阅读全文'); ?>
|
||||
</div>
|
||||
</article>
|
||||
<hr class="post-separator">
|
||||
<?php endwhile; ?>
|
||||
<?php else: ?>
|
||||
<article class="post">
|
||||
<div class="entry-content fmt text-center" itemprop="articleBody">
|
||||
<p><?php _e('没有找到内容'); ?></p>
|
||||
</div>
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php $this->pageNav('« 前一页', '后一页 »'); ?>
|
||||
</main>
|
||||
|
||||
<?php $this->need('footer.php'); ?>
|
||||
1968
static/css/style.css
Normal file
1968
static/css/style.css
Normal file
File diff suppressed because it is too large
Load Diff
16
static/img/calendar.svg
Normal file
16
static/img/calendar.svg
Normal file
@@ -0,0 +1,16 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="#64748b"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
|
||||
<line x1="16" y1="2" x2="16" y2="6" />
|
||||
<line x1="8" y1="2" x2="8" y2="6" />
|
||||
<line x1="3" y1="10" x2="21" y2="10" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 385 B |
13
static/img/folder.svg
Normal file
13
static/img/folder.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="#64748b"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 294 B |
13
static/img/message-circle.svg
Normal file
13
static/img/message-circle.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="#64748b"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 403 B |
30
theme.css
Normal file
30
theme.css
Normal file
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* This is an example of a color scheme
|
||||
* You can define your color scheme below
|
||||
*/
|
||||
|
||||
[data-theme="customize"] {
|
||||
--pico-primary: #017FC0 !important;
|
||||
--pico-primary-hover: #02659A !important;
|
||||
--pico-background-color: #fffbeb !important;
|
||||
--pico-muted-border-color: rgba(0, 0, 0, .1) !important;
|
||||
--pico-form-element-border-color: rgba(0, 0, 0, .2) !important;
|
||||
--pico-code-background-color: rgba(0, 0, 0, .05) !important;
|
||||
}
|
||||
|
||||
.site-navbar {
|
||||
background-color: var(--pico-primary);
|
||||
}
|
||||
|
||||
.site-navbar a,
|
||||
.site-navbar .nav-toggler-btn {
|
||||
color: var(--pico-primary-inverse);
|
||||
}
|
||||
|
||||
.site-navbar .desc {
|
||||
color: rgba(255, 255, 255, .5);
|
||||
}
|
||||
|
||||
.site-navbar input[type="search"]:not(:focus) {
|
||||
--pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
|
||||
}
|
||||
Reference in New Issue
Block a user