diff --git a/404.php b/404.php new file mode 100644 index 0000000..139e507 --- /dev/null +++ b/404.php @@ -0,0 +1,8 @@ + +need('header.php'); ?> +
+

404

+

出错了,这里什么都没有。

+

← 返回首页

+
+need('footer.php'); ?> \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8dc0124 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Writing + +主题介绍: Writing 是一款极致极简写作主题,支持自定义背景、自定义菜单、暗黑模式、自适应,保留搜索及评论功能;内置文章归档模板。主题无 JS、CSS 文件载入,对程序极简优化,仅9个文件约50kb。 + +关键词: 极简,博客,单栏,自适应,暗黑模式,免费 + +主题发布页: https://yayu.net/projects/typecho-writing + +作者: Jeff Chen + +作者网站: https://yayu.net/ + +最新版本: 1.0.0 + +授权方式: CC BY-NC-SA 4.0 DEED + +授权介绍: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hans + + +## 使用方法 + +1. 上传并激活主题,开箱即用。 + + +## 页面模板/所有文章 + +1. 创建一个新的页面,或选择一个已有页面; +2. 编辑状态,在“页面属性”的“模板”一项中选择“文章归档”模板。 + +该模板按年月展示博客所有文章。 \ No newline at end of file diff --git a/archives.php b/archives.php new file mode 100644 index 0000000..0de7bb8 --- /dev/null +++ b/archives.php @@ -0,0 +1,37 @@ + +need('header.php'); ?> + +

title() ?>


+

+widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives); +$year=0; $mon=0; $i=0; $j=0; $output=''; +while($archives->next()): +$year_tmp = date('Y',$archives->created); +$mon_tmp = date('m',$archives->created); +$y=$year; $m=$mon; +if ($mon != $mon_tmp && $mon > 0) $output .= ''; +if ($year != $year_tmp && $year > 0) $output .= ''; +if ($year != $year_tmp && $mon != $mon_tmp) { +$year = $year_tmp; +$mon = $mon_tmp; +$output .= '

'. $year .'年'. $mon .'月
'; +echo $output; +?> +

+need('footer.php'); ?> \ No newline at end of file diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..63a21ed --- /dev/null +++ b/comments.php @@ -0,0 +1,53 @@ + +
+ comments()->to($comments); ?> + have()): ?> +

commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?>

+ listComments(); ?> + pageNav('« 前一页', '后一页 »'); ?> + + allow('comment')): ?> +
+
+ cancelReply(); ?> +
+

+
+ user->hasLogin()): ?> +

user->screenName(); ?>. » +

+ +

+ + +

+

+ + options->commentsRequireMail): ?> required /> +

+

+ + options->commentsRequireURL): ?> required /> +

+ +

+ + +

+

+ +

+
+
+ +

+ +
\ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..a6780c2 --- /dev/null +++ b/footer.php @@ -0,0 +1,11 @@ + + +footer(); ?> + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..bc97a50 --- /dev/null +++ b/functions.php @@ -0,0 +1,2 @@ + + + + + + +<?php $this->archiveTitle(['category' => _t('%s'),'search' => _t('搜索结果:%s'),'tag' => _t('标签:%s'),'author' => _t('作者:%s')], '', ' - '); ?><?php $this->options->title(); ?> + +header(); ?> + + +
+ +
+
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..a7151b9 --- /dev/null +++ b/index.php @@ -0,0 +1,35 @@ + + * 发布页:https://yayu.net/projects/typecho-writing + * + * @package Writing + * @author Jeff Chen + * @version 1.0.0 + * @link https://yayu.net/ + */ +if (!defined('__TYPECHO_ROOT_DIR__')) exit; +$this->need('header.php'); ?> +is('index')){ ?> +

options->title() ?>

+
options->description() ?>
+is('archive')) { ?> +

archiveTitle(['category' => _t('%s'),'search' => _t('搜索结果'),'tag' => _t('标签:%s'),'author' => _t('作者:%s')], '', ''); ?>

+
is('search') ) { ?>关键词:archiveTitle('','',''); ?>getDescription(); ?>
+ +have()): ?> +next()): ?> +
+is('single') ? 'h1' : 'h2'; ?> +< class="title">title() ?>> +is('archive') || $this->is('index') || $this->is('post') ) { ?> +is('single') ) { ?>
content(); ?>
+
+ +is('single') ) { ?> +is('post') ) { ?>

# tags('', true, '无标签'); ?>

+

need('comments.php'); ?>
+is('archive') || $this->is('index') ) { ?> +
pageLink(' ← '); ?>pageLink(' → ','next'); ?>
+ +need('footer.php'); ?> \ No newline at end of file diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..489726f Binary files /dev/null and b/screenshot.png differ