建立新模板结构

This commit is contained in:
fen 2013-10-21 21:42:35 +08:00
parent 9d064518c3
commit 1dc3b22200
13 changed files with 574 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-tb-8" id="content">
<div class="post">
<h2 class="entry-title">404 - <?php _e('页面没找到'); ?></h2>
<p>
<form method="post">
<div><input type="text" name="s" class="text" size="20" /> <input type="submit" class="submit" value="<?php _e('搜索'); ?>" /></div>
</form>
</p>
</div>
</div><!-- end #content-->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -0,0 +1,27 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-tb-8" id="content">
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<div class="post">
<h2 class="entry-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<p class="entry-data">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<span><?php _e('发布时间:'); ?><?php $this->date('F j, Y'); ?></span>
<?php _e('分类:'); ?><?php $this->category(','); ?>
</p>
<?php $this->content('阅读剩余部分...'); ?>
</div>
<?php endwhile; ?>
<?php else: ?>
<div class="post">
<h2 class="entry-title"><?php _e('没有找到内容'); ?></h2>
</div>
<?php endif; ?>
<ol class="pages clearfix">
<?php $this->pageNav(); ?>
</ol>
</div><!-- end #content-->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -0,0 +1,44 @@
<div id="comments">
<?php $this->comments()->to($comments); ?>
<?php if ($comments->have()): ?>
<h4><?php $this->commentsNum(_t('当前暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?> &raquo;</h4>
<?php $comments->pageNav(); ?>
<?php $comments->listComments(); ?>
<?php endif; ?>
<?php if($this->allow('comment')): ?>
<div id="<?php $this->respondId(); ?>" class="respond">
<div class="cancel-comment-reply">
<?php $comments->cancelReply(); ?>
</div>
<h4 id="response"><?php _e('添加新评论'); ?> &raquo;</h4>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form">
<?php if($this->user->hasLogin()): ?>
<p>Logged in as <a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a></p>
<?php else: ?>
<p>
<label for="author"><?php _e('称呼'); ?><span class="required">*</span></label>
<input type="text" name="author" id="author" class="text" size="15" value="<?php $this->remember('author'); ?>" />
</p>
<p>
<label for="mail"><?php _e('电子邮件'); ?><?php if ($this->options->commentsRequireMail): ?><span class="required">*</span><?php endif; ?></label>
<input type="text" name="mail" id="mail" class="text" size="15" value="<?php $this->remember('mail'); ?>" />
</p>
<p>
<label for="url"><?php _e('网站'); ?><?php if ($this->options->commentsRequireURL): ?><span class="required">*</span><?php endif; ?></label>
<input type="text" name="url" id="url" class="text" size="15" value="<?php $this->remember('url'); ?>" />
</p>
<?php endif; ?>
<p><textarea rows="5" cols="50" name="text" class="textarea"><?php $this->remember('text'); ?></textarea></p>
<p><input type="submit" value="<?php _e('提交评论'); ?>" class="submit" /></p>
</form>
</div>
<?php else: ?>
<h4><?php _e('评论已关闭'); ?></h4>
<?php endif; ?>
</div>

View File

@ -0,0 +1,10 @@
<footer id="footer" class="col-mb-12">
<a href="<?php $this->options->siteurl(); ?>"><?php $this->options->title(); ?></a> <?php _e('is powered by'); ?> <a href="http://www.typecho.org">Typecho)))</a><br /><a href="<?php $this->options->feedUrl(); ?>"><?php _e('文章'); ?> RSS</a> and <a href="<?php $this->options->commentsFeedUrl(); ?>"><?php _e('评论'); ?> RSS</a>
</footer><!-- end #footer -->
</div>
</div>
<?php $this->footer(); ?>
</body>
</html>

View File

@ -0,0 +1,16 @@
<?php
function themeConfig($form) {
$logoUrl = new Typecho_Widget_Helper_Form_Element_text('logoUrl', NULL, NULL, _t('站点LOGO地址'), _t('在这里填入一个图片URL地址, 以在网站标题前加上一个LOGO'));
$form->addInput($logoUrl);
$sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock',
array('ShowRecentPosts' => _t('显示最新文章'),
'ShowRecentComments' => _t('显示最近回复'),
'ShowCategory' => _t('显示分类'),
'ShowArchive' => _t('显示归档'),
'ShowOther' => _t('显示其它杂项')),
array('ShowRecentPosts', 'ShowRecentComments', 'ShowCategory', 'ShowArchive', 'ShowOther'), _t('侧边栏显示'));
$form->addInput($sidebarBlock->multiMode());
}

View File

@ -0,0 +1,58 @@
<!DOCTYPE HTML>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="<?php $this->options->charset(); ?>" />
<title><?php $this->archiveTitle(' &raquo; ', '', ' - '); ?><?php $this->options->title(); ?></title>
<!-- 使用url函数转换相关路径 -->
<link rel="stylesheet" href="<?php $this->options->adminUrl('css/normalize.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->adminUrl('css/grid.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>" />
<!--[if lt IE 9]>
<script src="<?php $this->options->adminUrl('js/html5shiv.js'); ?>"></script>
<script src="<?php $this->options->adminUrl('js/respond.js'); ?>"></script>
<![endif]-->
<!-- 通过自有函数输出HTML头部信息 -->
<?php $this->header(); ?>
</head>
<body>
<header id="header" class="">
<div class="container">
<div class="col-group">
<div class="col-mb-12 col-8">
<a id="logo" href="<?php $this->options->siteUrl(); ?>">
<?php if ($this->options->logoUrl): ?>
<img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>" />
<?php endif; ?>
<?php $this->options->title() ?>
</a>
<p class="description"><?php $this->options->description() ?></p>
</div>
<section class="col-mb-12 col-offset-1 col-3">
<form id="search" method="post" action="/">
<input type="text" name="s" class="text" /> <input type="submit" class="submit" value="<?php _e('搜索'); ?>" />
</form>
</section>
<nav id="nav-menu" class="col-mb-12">
<a<?php if($this->is('index')): ?> class="current"<?php endif; ?> href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<?php while($pages->next()): ?>
<a<?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
<?php endwhile; ?>
</nav>
</div>
</div>
</header><!-- end #header -->
<div class="container">
<div class="col-group">

View File

@ -0,0 +1,34 @@
<?php
/**
* 这是 Typecho 系统的一套默认皮肤
*
* @package Typecho Default Theme
* @author fen
* @version 1.0.7
* @link http://typecho.org
*/
$this->need('header.php');
?>
<div class="col-mb-12 col-8" id="main">
<?php while($this->next()): ?>
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<span><?php _e('时间:'); ?><?php $this->date('F j, Y'); ?></span>
<span><?php _e('分类:'); ?><?php $this->category(','); ?></span>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('没有评论', '1 条评论', '%d 条评论'); ?></a>
</div>
<div class="post-content">
<?php $this->content('阅读剩余部分...'); ?>
</div>
</article>
<?php endwhile; ?>
<?php $this->pageNav(); ?>
</div><!-- end #main-->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -0,0 +1,18 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-8" id="main">
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<?php _e('发布时间:'); ?><?php $this->date('F j, Y'); ?>
</div>
<div class="post-content">
<?php $this->content(); ?>
</div>
</article>
<?php $this->need('comments.php'); ?>
</div><!-- end #main-->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

View File

@ -0,0 +1,21 @@
<?php $this->need('header.php'); ?>
<div class="col-mb-12 col-8" id="main">
<article class="post">
<h2 class="post-title"><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
<div class="post-meta">
<span><?php _e('作者:'); ?><?php $this->author(); ?></span>
<span><?php _e('发布时间:'); ?><?php $this->date('F j, Y'); ?></span>
<?php _e('分类:'); ?><?php $this->category(','); ?>
</div>
<div class="post-content">
<?php $this->content(); ?>
</div>
<div class="tags"><?php _e('标签'); ?>: <?php $this->tags(', ', true, 'none'); ?></div>
</article>
<?php $this->need('comments.php'); ?>
</div><!-- end #main-->
<?php $this->need('sidebar.php'); ?>
<?php $this->need('footer.php'); ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,59 @@
<div class="col-mb-12 col-offset-1 col-3" id="sidebar">
<?php if (empty($this->options->sidebarBlock) || in_array('ShowRecentPosts', $this->options->sidebarBlock)): ?>
<section class="widget">
<h3 class="widget-title"><?php _e('最新文章'); ?></h3>
<ul class="widget-list">
<?php $this->widget('Widget_Contents_Post_Recent')
->parse('<li><a href="{permalink}">{title}</a></li>'); ?>
</ul>
</section>
<?php endif; ?>
<!--<?php if (empty($this->options->sidebarBlock) || in_array('ShowRecentComments', $this->options->sidebarBlock)): ?>
<section class="widget">
<h3 class="widget-title"><?php _e('最近回复'); ?></h3>
<ul class="widget-list">
<?php $this->widget('Widget_Comments_Recent')->to($comments); ?>
<?php while($comments->next()): ?>
<li><a href="<?php $comments->permalink(); ?>"><?php $comments->author(false); ?></a>: <?php $comments->excerpt(50, '...'); ?></li>
<?php endwhile; ?>
</ul>
</section>
<?php endif; ?>-->
<?php if (empty($this->options->sidebarBlock) || in_array('ShowCategory', $this->options->sidebarBlock)): ?>
<section class="widget">
<h3 class="widget-title"><?php _e('分类'); ?></h3>
<ul class="widget-list">
<?php $this->widget('Widget_Metas_Category_List')
->parse('<li><a href="{permalink}">{name}</a> ({count})</li>'); ?>
</ul>
</section>
<?php endif; ?>
<?php if (empty($this->options->sidebarBlock) || in_array('ShowArchive', $this->options->sidebarBlock)): ?>
<section class="widget">
<h3 class="widget-title"><?php _e('归档'); ?></h3>
<ul class="widget-list">
<?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=F Y')
->parse('<li><a href="{permalink}">{date}</a></li>'); ?>
</ul>
</section>
<?php endif; ?>
<?php if (empty($this->options->sidebarBlock) || in_array('ShowOther', $this->options->sidebarBlock)): ?>
<section class="widget">
<h3 class="widget-title"><?php _e('其它'); ?></h3>
<ul class="widget-list">
<?php if($this->user->hasLogin()): ?>
<li class="last"><a href="<?php $this->options->adminUrl(); ?>"><?php _e('进入后台'); ?> (<?php $this->user->screenName(); ?>)</a></li>
<li><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a></li>
<?php else: ?>
<li class="last"><a href="<?php $this->options->adminUrl('login.php'); ?>"><?php _e('登录'); ?></a></li>
<?php endif; ?>
<li><a href="http://www.typecho.org">Typecho</a></li>
</ul>
</section>
<?php endif; ?>
</div><!-- end #sidebar -->

View File

@ -0,0 +1,272 @@
/* ------------------------------------
* Typecho Default Theme
*
* @author fen1211@gmail.com
* @link http: //typecho.net/
* @update 2009-03-29 14: 30
* --------------------------------- */
/* ------------------
* gobal settings
* --------------- */
html {
background-color: #F6F6F3;
}
body {
background-color: #FFF;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: .875em;
}
.container {
color: #444;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
a {
color: #467B96;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre, code {
font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
}
.serif {
font-family: Cambria, Georgia, "Times New Roman", Times, STHeiti, serif;
}
/* ------------------
* header
* --------------- */
#header {
padding-top: 50px;
border-bottom: 1px solid #DDD;
}
#logo {
color: #333;
font-size: 2em;
font-weight: bold;
}
.description {
margin: 0;
color: #999;
}
/* navigation menu */
#nav-menu {
}
#nav-menu a {
display: inline-block;
margin-top: 20px;
padding: 10px 20px;
}
#nav-menu .current {
}
/* ------------------
* content
* --------------- */
#main {
}
.post {
padding: 20px 0;
border-bottom: 1px solid #E9E9E6;
}
.post-title {
}
.post-meta {
margin-top: -0.5em;
color: #999;
}
.post-meta a {
}
.post-content {
line-height: 1.5;
}
.post-content img {
max-width: 100%;
}
/* = pages nav */
/* ------------------
* comment list
* --------------- */
#comments {
margin-top: 20px;
}
#comments h4 {
}
ol.comment-list, ol.comment-list ol {
margin: 0;
list-style: none;
}
ol.comment-list ol {
padding-top: 10px;
}
ol.comment-list li {
margin: 0;
padding-bottom: 10px;
}
ol.comment-list li {
padding: 10px 15px;
margin-top: 10px;
border: 1px solid #eee;
background: #FAFAFA;
overflow: hidden;
}
ol.comment-list li.comment-level-odd {
background: #fff;
}
ol.comment-list li.comment-level-even {
background: #FAFAFA;
}
ol.comment-list li.comment-by-author {
border: 1px dashed #AAA;
}
ol.comment-list li .comment-reply {
text-align: right;
}
ol.comment-list li .comment-reply a {
border: none;
color: #aaa;
}
ol.comment-list li .comment-reply a: hover {
color: #444;
}
.comment-meta {
padding-bottom: 8px;
/*border-bottom: 1px dashed #eee;
*/
color: #999;
}
.comment-author {
display: block;
color: #444;
}
.comment-author cite.fn {
}
.comment-body {
overflow: hidden;
}
img.avatar {
float: left;
margin: 6px 10px 0 0;
}
.respond {
margin-top: 20px;
}
ol.comment-list li .respond {
border-top: 1px solid #ddd;
padding-top: 10px;
}
#comment-form {
padding-right: 8px;
}
.respond .cancel-comment-reply {
float: right;
}
.respond .cancel-comment-reply a {
border: none;
color: #aaa;
}
.respond .cancel-comment-reply a: hover {
color: #444;
}
#comment-form label {
color: #555;
display: block;
}
#comment-form label .required {
color: #C04E37;
padding-left: 5px;
}
#comment-form .text {
width: 100%;
margin-right: 15px;
}
#comment-form textarea {
width: 100%;
height: 180px;
}
ol#comment-list li .respond .text {
-width: 400px;
}
ol#comment-list li .respond textarea {
-width: 400px;
}
/* ------------------
* sidebar
* --------------- */
#sidebar {
}
.widget {
}
.widget-title {
font-size: 1em;
}
.widget-list {
list-style: none;
padding: 0;
line-height: 1.5;
}
.widget-list li {
}
.widget-list a {
color: #999;
}
/* ------------------
* footer
* --------------- */
#footer {
}
#footer a {
}
/* -----------------
* misc
*--------------- */
.aligncenter, div.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
.alignleft {
float: left;
}
.alignright {
float: right;
}
img.alignleft {
margin: 4px 15px 0 0;
}
img.alignright {
margin: 4px 0 0 15px;
}
.alt {
color: #666;
}
@media (min-width: 768px) {
.container {
}
}
@media (min-width: 992px) {
.container {
}
}
@media (min-width: 1200px) {
.container {
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB