Add headPic & notification

This commit is contained in:
Skywt2003 2021-08-01 21:52:35 +08:00
parent f805b7c69c
commit 1624653cc0
3 changed files with 13 additions and 4 deletions

View File

@ -1,8 +1,8 @@
# Sky # Sky
敬我们对生活的热爱。 > 敬我们对生活的热爱。
简约·多彩·响应式 Typecho 主题。基于 Argon 框架。 Sky 是一个简洁的 Typecho 主题,基于 Argon 框架。
demo[skywt.cn](https://skywt.cn/) demo[skywt.cn](https://skywt.cn/)

View File

@ -12,6 +12,9 @@ function themeConfig($form) {
$nisInfo = new Typecho_Widget_Helper_Form_Element_Text('nisInfo', NULL, NULL, _t('网安备案号'), _t('显示在底部,留空则不显示')); $nisInfo = new Typecho_Widget_Helper_Form_Element_Text('nisInfo', NULL, NULL, _t('网安备案号'), _t('显示在底部,留空则不显示'));
$form->addInput($nisInfo->addRule('xssCheck', _t('请不要使用特殊字符'))); $form->addInput($nisInfo->addRule('xssCheck', _t('请不要使用特殊字符')));
$notification = new Typecho_Widget_Helper_Form_Element_Text('notification', NULL, NULL, _t('网站公告'), _t('显示在首页,留空则不显示'));
$form->addInput($notification);
$travelling = new Typecho_Widget_Helper_Form_Element_Radio('travelling', $travelling = new Typecho_Widget_Helper_Form_Element_Radio('travelling',
array('able' => _t('启用'), array('able' => _t('启用'),

View File

@ -13,15 +13,20 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit;
?> ?>
<div class="col mt-5" id="main" role="main"> <div class="col mt-5" id="main" role="main">
<div class="alert alert-primary alert-dismissible fade show" role="alert"> <?php if ($this->options->notification !='') { ?>
Hi! 这是一个正在开发中的网站。原网站:<a class="text-secondary" href="https://skywt.cn/">skywt.cn</a> <div class="alert alert-primary alert-dismissible fade show shadow" role="alert">
<?php $this->options->notification(); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<?php } ?>
<?php while($this->next()): ?> <?php while($this->next()): ?>
<article class="mt-5 mb-5" itemscope itemtype="http://schema.org/BlogPosting"> <article class="mt-5 mb-5" itemscope itemtype="http://schema.org/BlogPosting">
<?php if ($this->fields->headPic !='') { ?>
<img src=<?php $this->fields->headPic(); ?> class="img-fluid mx-auto d-block shadow rounded mb-3" alt="<?php $this->title(); ?>">
<?php } ?>
<h1 class="font-weight-bold post-title" itemprop="name headline"> <h1 class="font-weight-bold post-title" itemprop="name headline">
<a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a> <a itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
</h1> </h1>
@ -38,6 +43,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit;
<?php $this->content('More...'); ?> <?php $this->content('More...'); ?>
</div> </div>
</article> </article>
<hr>
<?php endwhile; ?> <?php endwhile; ?>
<!-- 210720 pageNav 的实现方式,有待改进 --> <!-- 210720 pageNav 的实现方式,有待改进 -->