修改一下设置

This commit is contained in:
浪子 2024-07-01 19:08:53 +08:00
parent 8ed2e647a1
commit 1525097b87
3 changed files with 6 additions and 52 deletions

View File

@ -15,8 +15,10 @@ function themeConfig($form) {
$form->addInput($twitterurl); $form->addInput($twitterurl);
$mastodonurl = new Typecho_Widget_Helper_Form_Element_Text('mastodonurl', NULL, NULL, _t('mastodon'), _t('会在个人信息显示')); $mastodonurl = new Typecho_Widget_Helper_Form_Element_Text('mastodonurl', NULL, NULL, _t('mastodon'), _t('会在个人信息显示'));
$form->addInput($mastodonurl); $form->addInput($mastodonurl);
$sitemapurl = new Typecho_Widget_Helper_Form_Element_Text('sitemapurl', NULL, NULL, _t('sitemap'), _t('会在页脚显示')); $posturl = new Typecho_Widget_Helper_Form_Element_Text('posturl', NULL, NULL, _t('文章列表地址'), _t('自定义文章列表的地址'));
$form->addInput($sitemapurl); $form->addInput($posturl);
$postlisttittle = new Typecho_Widget_Helper_Form_Element_Text('postlisttittle', NULL, NULL, _t('文章列表名称'), _t('自定义文章列表的标题'));
$form->addInput($postlisttittle);
$cnavatar = new Typecho_Widget_Helper_Form_Element_Text('cnavatar', NULL, 'https://cravatar.cn/avatar/', _t('Gravatar镜像'), _t('默认https://cravatar.cn/avatar/,建议保持默认')); $cnavatar = new Typecho_Widget_Helper_Form_Element_Text('cnavatar', NULL, 'https://cravatar.cn/avatar/', _t('Gravatar镜像'), _t('默认https://cravatar.cn/avatar/,建议保持默认'));
$form->addInput($cnavatar); $form->addInput($cnavatar);
$twikoo = new Typecho_Widget_Helper_Form_Element_Textarea('twikoo', NULL, NULL, _t('引用第三方评论'), _t('不填写则不显示')); $twikoo = new Typecho_Widget_Helper_Form_Element_Textarea('twikoo', NULL, NULL, _t('引用第三方评论'), _t('不填写则不显示'));

View File

@ -36,6 +36,7 @@
</div> </div>
<div class="menu navbar-right"> <div class="menu navbar-right">
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?> <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<a class="menu-item" href="<?php $this->options->posturl() ?>"><?php $this->options->postlisttittle() ?></a>
<?php while($pages->next()): ?> <?php while($pages->next()): ?>
<a <?php if($this->is('page', $pages->slug)): ?> <?php endif; ?>class="menu-item" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a> <a <?php if($this->is('page', $pages->slug)): ?> <?php endif; ?>class="menu-item" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
<?php endwhile; ?> <?php endwhile; ?>
@ -56,6 +57,7 @@
<div class="menu" id="mobile-menu"> <div class="menu" id="mobile-menu">
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?> <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<?php while($pages->next()): ?> <?php while($pages->next()): ?>
<a class="menu-item" href="<?php $this->options->posturl() ?>">文章列表</a>
<a <?php if($this->is('page', $pages->slug)): ?> <?php endif; ?>class="menu-item" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a> <a <?php if($this->is('page', $pages->slug)): ?> <?php endif; ?>class="menu-item" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
<?php endwhile; ?> <?php endwhile; ?>
</div> </div>

View File

@ -1,50 +0,0 @@
<?php
/**
* 文章归档
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?>
<div class="main">
<div class="post-wrap archive">
<h2 class="post-title">-&nbsp;&nbsp;<?php $this->title() ?>&nbsp;&nbsp;-</h2>
<?php
$stat = Typecho_Widget::widget('Widget_Stat');
Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
$year = 0; $mon = 0;
$output = '<div class="post-wrap archive">'; // Start archives container
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
$mon_tmp = date('m', $archives->created);
// 检查是否需要新的年份标题
if ($year != $year_tmp) {
if ($year > 0) {
$output .= '</ul> '; // 结束上一个年份的月份列表和包裹的div
}
$year = $year_tmp;
$mon = 0; // 重置月份
$output .= '<h3>' . $year . '</h3>'; // 开始新的年份div
}
// 输出文章项
$output .= '<article class="archive-item">';
$output .= '<a class="archive-item-link" href="' . $archives->permalink . '">' . $archives->title . '</a>';
$output .= '<span class="archive-item-date">' . date('m月d,Y', $archives->created) . '</span></article>';
}
// 循环后,确保所有标签都已经关闭
if ($mon > 0) {
$output .= '</ul>'; // 结束最后一个月份的列表
}
if ($year > 0) {
$output .= '</div>'; // 结束最后一个年份的div
}
$output .= '</div>'; // End archives container
echo $output;
?>
</div>
</div>
<br>
<?php $this->need('footer.php'); ?>