Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
release: 1.1
Browse files Browse the repository at this point in the history
release: 1.1
  • Loading branch information
FlyingSky-CN authored Jul 13, 2020
2 parents 5593946 + 3cf7a3c commit 7725148
Show file tree
Hide file tree
Showing 16 changed files with 1,554 additions and 1,477 deletions.
26 changes: 26 additions & 0 deletions .build.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php if (php_sapi_name() !== 'cli') exit();

define('Copyright', 'https://github.com/FlyingSky-CN/MDr');

function compressCSS($buffer)
{
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
$buffer = str_replace(
["\r", "\n", "\t", ' ', ' ', ' '],
'',
$buffer
);
$buffer = str_replace(
[' {', ': ', ', ', ';}', ' !'],
['{', ':', ',', '}', '!'],
$buffer
);
return '/* '.Copyright.' */'.PHP_EOL.$buffer;
}

file_put_contents(
'style.css',
compressCSS(
file_get_contents('style.less')
)
);
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Typecho Theme | MDr - 书写你的篇章
![Version](https://img.shields.io/badge/version-1.0.5-40c4ff.svg?style=flat)
![Typecho](https://img.shields.io/badge/Typecho-1.1%2B-467b96.svg?style=flat)
![License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat)
![QQ Group](https://img.shields.io/badge/qq%20group-1061965682-ff69b4.svg?style=flat)
![Docs](https://github.com/FlyingSky-CN/MDr-docs/workflows/docs%20publish/badge.svg?branch=master)
![Author](https://img.shields.io/badge/author-FlyingSky-6cf.svg?style=flat)

Expand All @@ -21,4 +20,12 @@ Typecho Theme | MDr - 书写你的篇章

使用指南 : <https://blog.fsky7.com/archives/93>

主题文档 : <https://mdr.docs.fsky7.com>
主题文档 : <https://mdr.docs.fsky7.com>

## 划水

QQ 群 1061965682

Telegram Group [@FlyingSky123](https://t.me/FlyingSky123)

欢迎参与讨论开发方向以及贡献代码。
235 changes: 114 additions & 121 deletions archive.php
Original file line number Diff line number Diff line change
@@ -1,131 +1,124 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<div id="main">
<div class="mdui-card" style="margin-top:20px;background-color: rgba(180, 180, 180, 0.25);">
<span class="mdui-chip-icon" style="border-radius:2px;"><i class="mdui-icon material-icons">chevron_right</i></span>
<span class="mdui-chip-title">
<a href="<?php $this->options->siteUrl(); ?>">首页</a> &raquo; <?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'date' => _t('在 %s 发布的文章'),
'author' => _t('作者 %s 发布的文章')
), '', ''); ?>
</span>
</div>
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<?php if (is_status($this) && !$this->hidden): ?>
<div class="mdui-card mdui-shadow-0 status post<?php if ($this->options->PjaxOption && $this->hidden): ?> protected<?php endif; ?>" style="margin-top: 20px;">
<div class="tag"><i class="mdui-icon material-icons">message</i></div>
<div class="time mdui-text-right"><?php $this->date(); ?></div>
<article class="inner">
<span class="mdui-typo">
<?php $this->content(); ?>
</span>
</article>
<div class="mdui-card" style="margin-top:20px;background-color: rgba(180, 180, 180, 0.25);">
<span class="mdui-chip-icon" style="border-radius:2px;"><i class="mdui-icon material-icons">chevron_right</i></span>
<span class="mdui-chip-title">
<a href="<?php $this->options->siteUrl(); ?>">首页</a> &raquo;
<?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'date' => _t('在 %s 发布的文章'),
'author' => _t('作者 %s 发布的文章')
], '', ''); ?>
</span>
</div>
<?php else: ?>
<div class="mdui-card post<?php if ($this->options->PjaxOption && $this->hidden): ?> protected<?php endif; ?>" style="margin-top: 20px;">
<?php if ($this->options->PjaxOption && !$this->hidden and postThumb($this)): ?>
<div class="mdui-card-media">
<a href="<?php $this->permalink() ?>">
<?php echo postThumb($this); ?>
</a>
<?php if ($this->options->mdrPostTitle != 'normal') { ?>
<div class="mdui-card-media-covered mdui-card-media-covered-transparent <?php if ($this->options->mdrPostTitle == 'top') { ?>mdui-card-media-covered-top<?php } ?>">
<div class="mdui-card-primary" style="padding-bottom:8px;">
<div class="mdui-card-primary-title"><?php $this->title() ?></div>
<?php if ($this->options->mdrPostInfo == 'subtitle') { ?>
<div class="mdui-card-primary-subtitle">
<?php $this->date(); ?>
| <?php $this->category(',', false); ?>
| <?php $this->commentsNum('暂无评论', '%d 条评论'); ?>
| <?php Postviews($this); ?>
<?php if ($this->options->WordCount): ?>
| <?php WordCount($this->cid); ?>
<?php endif; ?>
<?php if ($this->have()) : ?>
<?php while ($this->next()) : ?>
<?php if (is_status($this) && !$this->hidden) : ?>
<div class="mdui-card mdui-shadow-0 status post<?php if ($this->options->PjaxOption && $this->hidden) : ?> protected<?php endif; ?>" style="margin-top: 20px;">
<div class="tag"><i class="mdui-icon material-icons">message</i></div>
<div class="time mdui-text-right"><?php $this->date(); ?></div>
<article class="inner">
<span class="mdui-typo">
<?php $this->content(); ?>
</span>
</article>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<?php endif; ?>
<?php if ($this->options->mdrPostTitle == 'normal' || !postThumb($this) ) { ?>
<div class="mdui-card-primary" style="padding-bottom:8px;">
<div class="mdui-card-primary-title"><?php $this->title() ?></div>
<?php if ($this->options->mdrPostInfo == 'subtitle') { ?>
<div class="mdui-card-primary-subtitle">
<?php $this->date(); ?>
| <?php $this->category(',', false); ?>
| <?php $this->commentsNum('暂无评论', '%d 条评论'); ?>
| <?php Postviews($this); ?>
<?php if ($this->options->WordCount): ?>
| <?php WordCount($this->cid); ?>
<?php endif; ?>
</div>
<?php } ?>
</div>
<?php } ?>
<div class="mdui-card-content" style="padding: 0px 16px;">
<?php if ($this->options->PjaxOption && $this->hidden): ?>
<form method="post" style="margin: 14px 0px;">
<div class="mdui-row">
<div class="mdui-col-xs-12 mdui-col-md-6">
<div class="mdui-textfield" style="padding-bottom: 32px;">
<label class="mdui-textfield-label">请输入密码访问</label>
<input class="mdui-textfield-input" type="password" class="text" name="protectPassword"/>
<?php else : ?>
<div class="mdui-card post<?php if ($this->options->PjaxOption && $this->hidden) : ?> protected<?php endif; ?>" style="margin-top: 20px;">
<?php if ($this->options->PjaxOption && !$this->hidden and postThumb($this)) : ?>
<div class="mdui-card-media">
<a href="<?php $this->permalink() ?>">
<?php echo postThumb($this); ?>
</a>
<?php if ($this->options->mdrPostTitle != 'normal') { ?>
<div class="mdui-card-media-covered mdui-card-media-covered-transparent <?php if ($this->options->mdrPostTitle == 'top') { ?>mdui-card-media-covered-top<?php } ?>">
<div class="mdui-card-primary" style="padding-bottom:8px;">
<a href="<?php $this->permalink() ?>">
<div class="mdui-card-primary-title"><?php $this->title() ?></div>
</a>
<?php if ($this->options->mdrPostInfo == 'subtitle') { ?>
<div class="mdui-card-primary-subtitle">
<?php $this->date(); ?>
| <?php $this->category(',', false); ?>
| <?php $this->commentsNum('暂无评论', '%d 条评论'); ?>
| <?php Postviews($this); ?>
<?php if ($this->options->WordCount) : ?>
| <?php WordCount($this->cid); ?>
<?php endif; ?>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<?php endif; ?>
<?php if ($this->options->mdrPostTitle == 'normal' || !postThumb($this)) { ?>
<div class="mdui-card-primary" style="padding-bottom:8px;">
<a href="<?php $this->permalink() ?>">
<div class="mdui-card-primary-title"><?php $this->title() ?></div>
</a>
<?php if ($this->options->mdrPostInfo == 'subtitle') { ?>
<div class="mdui-card-primary-subtitle">
<?php $this->date(); ?>
| <?php $this->category(',', false); ?>
| <?php $this->commentsNum('暂无评论', '%d 条评论'); ?>
| <?php Postviews($this); ?>
<?php if ($this->options->WordCount) : ?>
| <?php WordCount($this->cid); ?>
<?php endif; ?>
</div>
<?php } ?>
</div>
<?php } ?>
<div class="mdui-card-content" style="padding: 0px 16px;">
<?php if ($this->options->PjaxOption && $this->hidden) : ?>
<p>这篇文章受密码保护,输入密码才能看哦</p>
<?php else : ?>
<p><?php $this->excerpt(200, ''); ?></p>
<?php endif; ?>
</div>
<div class="mdui-card-actions" style="text-align: center">
<?php if ($this->options->mdrPostInfo == 'menu') { ?>
<button class="mdui-float-left mdui-btn mdui-ripple" mdui-menu="{target: '#post-info-<?= $this->cid ?>', position: 'top'}" style="text-transform:none"><?php $this->date(); ?></button>
<ul class="mdui-menu" id="post-info-<?= $this->cid ?>">
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php $this->category(',', false); ?>
</a>
</li>
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php Postviews($this); ?>
</a>
</li>
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php $this->commentsNum('暂无评论', '%d 条评论'); ?>
</a>
</li>
<?php if ($this->options->WordCount) : ?>
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php WordCount($this->cid); ?>
</a>
</li>
<?php endif; ?>
</ul>
<?php } ?>
<a href="<?php $this->permalink() ?>" class="<?php if ($this->options->mdrPostInfo == 'menu') { ?>mdui-float-right <?php } ?>mdui-btn mdui-ripple" <?php if ($this->options->mdrPostInfo == 'subtitle') { ?> style="width:100%" <?php } ?>>阅读全文</a>
</div>
</div>
<div class="mdui-col-xs-12 mdui-col-md-6" style="padding-top:40px">
<input type="submit" class="mdui-btn mdui-ripple" value="提交" />
</div>
</div>
</form>
<?php else: ?>
<p><?php $this->excerpt(200, ''); ?></p>
<?php endif; ?>
</div>
<div class="mdui-card-actions" align="center">
<?php if ($this->options->mdrPostInfo == 'menu') { ?>
<button class="mdui-float-left mdui-btn mdui-ripple" mdui-menu="{target: '#post-info-<?=$this->cid ?>', position: 'top'}" style="text-transform:none"><?php $this->date(); ?></button>
<ul class="mdui-menu" id="post-info-<?=$this->cid ?>">
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php $this->category(',', false); ?>
</a>
</li>
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php Postviews($this); ?>
</a>
</li>
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php $this->commentsNum('暂无评论', '%d 条评论'); ?>
</a>
</li>
<?php if ($this->options->WordCount): ?>
<li class="mdui-menu-item">
<a class="mdui-ripple">
<?php WordCount($this->cid); ?>
</a>
</li>
<?php endif; ?>
</ul>
<?php } ?>
<a href="<?php $this->permalink() ?>" class="<?php if ($this->options->mdrPostInfo == 'menu') { ?>mdui-float-right <?php } ?>mdui-btn mdui-ripple"<?php if ($this->options->mdrPostInfo == 'subtitle') { ?> style="width:100%"<?php } ?>>阅读全文</a>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php else: ?>
<div class="error-page">
<h2 class="post-title">没有找到内容</h2>
<p>你想找的东西可能被吃了</p>
</div>
<?php endif; ?>
<?php $this->pageNav('上一页', $this->options->AjaxLoad ? '查看更多' : '下一页', 0, '..', $this->options->AjaxLoad ? array('wrapClass' => 'page-navigator ajaxload') : ''); ?>
<?php endwhile; ?>
<?php else : ?>
<div class="error-page">
<h2 class="post-title">没有找到内容</h2>
<p>你想找的东西可能被吃了</p>
</div>
<?php endif; ?>
<?php $this->pageNav('上一页', $this->options->AjaxLoad ? '查看更多' : '下一页', 0, '..', $this->options->AjaxLoad ? array('wrapClass' => 'page-navigator ajaxload') : ''); ?>
</div>
<?php $this->need('footer.php'); ?>
Loading

0 comments on commit 7725148

Please sign in to comment.