Skip to content

Commit b44b40d

Browse files
committed
💥 1.0.0 发布
0 parents  commit b44b40d

13 files changed

+1090
-0
lines changed

404.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<?php $this->need('header.php'); ?>
3+
<article class="post">
4+
<header>
5+
<h1>404 - Page not found</h1>
6+
<h3>The content you&#39;re looking for doesn&#39;t seem to exist.</h3>
7+
</header>
8+
</article>
9+
<?php $this->need('footer.php'); ?>

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Cactus
2+
3+
一个简约的Typecho响应式主题。
4+
5+
[发布页面](https://www.iwch.me/archives/668.html)
6+
7+
## 效果
8+
9+
![screenshot.png](https://static.yecdn.com/static/blog/post/668/screenshot.png)
10+
11+
Demo: [https://typecho.iwch.me](https://typecho.iwch.me/?theme=Cactus)
12+
13+
## 相关
14+
15+
[https://github.com/digitalcraftsman/hugo-cactus-theme](https://github.com/digitalcraftsman/hugo-cactus-theme)

comments.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<div id="comments">
3+
<?php $this->comments()->to($comments); ?>
4+
<?php if ($comments->have()): ?>
5+
<p><b><?php $this->commentsNum(_t('快抢沙发'), _t('沙发被抢'), _t('已有 %d 条评论')); ?></b></p>
6+
<div data-no-instant>
7+
<?php $comments->listComments(); ?>
8+
</div>
9+
<div class="center"><?php $comments->pageNav(); ?></div>
10+
<?php endif; ?>
11+
<?php if($this->allow('comment')): ?>
12+
<div id="<?php $this->respondId(); ?>" class="respond">
13+
<div class="cancel-comment-reply">
14+
<?php $comments->cancelReply(); ?>
15+
</div>
16+
<p id="comments" class="subhead"><b><?php _e('添加新评论'); ?></b></p>
17+
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" class="form">
18+
<?php if($this->user->hasLogin()): ?>
19+
<p>登录为 <a href="<?php $this->options->profileUrl(); ?>" target="_blank" data-no-instant><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" data-no-instant><?php _e('退出'); ?> &raquo;</a></p>
20+
<?php else: ?>
21+
<p><input type="text" name="author" id="author" class="text" placeholder="称呼" value="<?php $this->remember('author'); ?>" required /></p>
22+
<p><input type="email" name="mail" id="mail" class="text" placeholder="Email" value="<?php $this->remember('mail'); ?>"<?php if ($this->options->commentsRequireMail): ?> required<?php endif; ?> /></p>
23+
<p><input type="url" name="url" id="url" class="text" placeholder="<?php _e('http://'); ?>" value="<?php $this->remember('url'); ?>"<?php if ($this->options->commentsRequireURL): ?> required<?php endif; ?> /></p>
24+
<?php endif; ?>
25+
<p><textarea rows="8" cols="50" name="text" id="textarea" class="textarea" placeholder="内容" required ><?php $this->remember('text'); ?></textarea></p>
26+
<p><button type="submit" class="submit"><?php _e('提交评论 (Ctrl+Enter)'); ?></button></p>
27+
</form>
28+
</div>
29+
<?php if ($this->options->Ic == 'o'): ?>
30+
<script type="text/javascript">(function(){window.TypechoComment={dom:function(id){return document.getElementById(id)},create:function(tag,attr){var el=document.createElement(tag);for(var key in attr){el.setAttribute(key,attr[key])}return el},reply:function(cid,coid){var comment=this.dom(cid),parent=comment.parentNode,response=this.dom("<?php $this->respondId(); ?>"),input=this.dom("comment-parent"),form="form"==response.tagName?response:response.getElementsByTagName("form")[0],textarea=response.getElementsByTagName("textarea")[0];if(null==input){input=this.create("input",{"type":"hidden","name":"parent","id":"comment-parent"});form.appendChild(input)}input.setAttribute("value",coid);if(null==this.dom("comment-form-place-holder")){var holder=this.create("div",{"id":"comment-form-place-holder"});response.parentNode.insertBefore(holder,response)}comment.appendChild(response);this.dom("cancel-comment-reply-link").style.display="";if(null!=textarea&&"text"==textarea.name){textarea.focus()}return false},cancelReply:function(){var response=this.dom("<?php $this->respondId(); ?>"),holder=this.dom("comment-form-place-holder"),input=this.dom("comment-parent");if(null!=input){input.parentNode.removeChild(input)}if(null==holder){return true}this.dom("cancel-comment-reply-link").style.display="none";holder.parentNode.insertBefore(response,holder);return false}}})();</script>
31+
<?php endif; ?>
32+
<?php else: ?>
33+
<?php _e('<div class="alert info center">Comments Disabled.</div>'); ?>
34+
<?php endif; ?>
35+
</div>

fonts/icons.svg

+18
Loading

fonts/icons.ttf

5.68 KB
Binary file not shown.

fonts/icons.woff

3.58 KB
Binary file not shown.

footer.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<footer id="footer">
3+
<p class="small">
4+
&copy; Copyright <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title() ?></a> /
5+
<a href="https://www.iwch.me/archives/668.html">Cactus</a> /
6+
<a href="http://typecho.org">Typecho</a>
7+
</p>
8+
</footer>
9+
</section>
10+
</body>
11+
</html>

header.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<!DOCTYPE html>
3+
<html lang="zh-cn">
4+
<head>
5+
<meta charset="<?php $this->options->charset(); ?>">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7+
<meta name="renderer" content="webkit">
8+
<meta name="viewport" content="width=device-width,initial-scale=1">
9+
<title><?php $this->archiveTitle(array(
10+
'category' => _t('分类 %s 下的文章'),
11+
'search' => _t('包含关键字 %s 的文章'),
12+
'tag' => _t('标签 %s 下的文章'),
13+
'author' => _t('%s 发布的文章')
14+
), '', ' - '); ?><?php $this->options->title(); ?></title>
15+
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">
16+
<?php $this->header(); ?>
17+
18+
</head>
19+
<body>
20+
<nav class="main-nav">
21+
<a href="<?php $this->options->siteUrl(); ?>">首页</a>
22+
<?php $this->widget('Widget_Contents_Page_List')->parse('<a href="{permalink}">{title}</a>'); ?>
23+
24+
<a class="cta" href="<?php $this->options->feedUrl(); ?>">订阅</a>
25+
</nav>
26+
<section id="wrapper">

index.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* 一个简约的Typecho响应式主题。
4+
*
5+
* @package Cactus
6+
* @author Zohar
7+
* @version 1.0.0
8+
* @link https://www.iwch.me/
9+
*/
10+
11+
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
12+
$this->need('header.php');
13+
?>
14+
<div class="profile">
15+
<section id="wrapper">
16+
<header id="header">
17+
<a href="<?php $this->options->siteUrl(); ?>">
18+
<img id="avatar" src="https://secure.gravatar.com/avatar/<?php echo md5(strtolower($this->author->mail)); ?>">
19+
</a>
20+
<h1><?php $this->options->title() ?></h1>
21+
<h2><?php $this->options->description() ?></h2>
22+
</header>
23+
</section>
24+
</div>
25+
<ul id="post-list">
26+
<?php while($this->next()): ?>
27+
<li>
28+
<a href="<?php $this->permalink() ?>">
29+
<aside class="dates"><?php $this->date('M j Y'); ?></aside>
30+
</a>
31+
<a href="<?php $this->permalink() ?>">
32+
<?php $this->title() ?>
33+
<h2></h2>
34+
</a>
35+
</li>
36+
<?php endwhile; ?>
37+
</ul>
38+
<nav id="post-nav">
39+
<span class="prev">
40+
<?php $this->pageLink('<span class="arrow">←</span> 上一页','prev'); ?>
41+
42+
</span>
43+
<span class="next">
44+
<?php $this->pageLink('下一页 <span class="arrow">→</span>','next'); ?>
45+
46+
</span>
47+
</nav>
48+
<?php $this->need('footer.php'); ?>

page.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<?php $this->need('header.php'); ?>
3+
<article class="post">
4+
<header>
5+
<h1><?php $this->title() ?></h1>
6+
<h2 class="headline"><?php $this->date('F j, Y'); ?></h2>
7+
</header>
8+
<section id="post-body">
9+
<?php $this->content(); ?>
10+
11+
</section>
12+
</article>
13+
<?php $this->need('comments.php'); ?>
14+
<?php $this->need('footer.php'); ?>

post.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<?php $this->need('header.php'); ?>
3+
<article class="post">
4+
<header>
5+
<h1><?php $this->title() ?></h1>
6+
<h2 class="headline">
7+
<?php $this->date('F j, Y'); ?>
8+
9+
<?php $this->category(' '); ?>
10+
11+
</h2>
12+
</header>
13+
<section id="post-body">
14+
<?php $this->content(); ?>
15+
16+
</section>
17+
</article>
18+
<?php $this->need('comments.php'); ?>
19+
<?php $this->need('footer.php'); ?>

screenshot.png

151 KB
Loading

0 commit comments

Comments
 (0)