Skip to content

Commit

Permalink
更新至v1.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
awinds committed Sep 14, 2024
1 parent be4e5d8 commit 755ea16
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 15 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Open sourced under the MIT license.
保留Theme by Xaink,谢谢!
# 更新说明
## 1.4.8
1. 分类目录显示控制数量,增加更多下拉显示一级目录。
2. 控制台->外观->设置外观->目录显示的分类数。
3. 优化文章导读的高亮显示颜色。
4. 优化评论提示显示效果。
## 1.4.7
1. 分类目录增加自定义设置icon显示(svg)。
2. 控制台->外观->设置外观->分类对应图标SVG。
Expand Down
4 changes: 4 additions & 0 deletions assets/css/xa-ink.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
color: #f5f6f5;
}

.outline-navigator-parent .outline-navigator__main .outline-navigator_highlight {
color : rgb(59,130,246);
}

svg {
display: inline-block;
}
Expand Down
8 changes: 6 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ function threadedComments($comments, $options)
<?php endif; ?>
<div class="xa-comment-list">
<?php if ($comments->have()): ?>
<?php $comments->listComments(); ?>
<?php $comments->listComments(); ?>
<div class="flex justify-center items-center w-full py-12">没有更多啦</div>
<?php else: ?>
<?php if ($this->allow("comment")): ?>
<div class="flex justify-center items-center w-full py-12">等风等雨等你来</div>
<?php endif; ?>
<?php endif; ?>
<div class="flex justify-center items-center w-full py-12">没有更多啦</div>
</div>
</div>
<!-- 评论脚本 -->
Expand Down
38 changes: 33 additions & 5 deletions core/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,26 @@
<a href="<?php $this->options->siteUrl(); ?>" title="首页" class="xa-categories-title text-gray-500 hover:text-gray-700">首页</a>
</li>
<?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
<?php if ($categorys->have()): ?>
<?php while ($categorys->next()):
<?php if ($categorys->have()):
$idx = 1;
$maxNum = $this->options->authorInstagram ? intval($this->options->authorInstagram) : 6;
$mores = [];
while ($categorys->next()):
if($categorys->levels != 0) {
continue;
}
$childs = $categorys->getAllChildren($categorys->mid);
$svgicon = xaGetCategorySvg($categorys->mid);
?>
if($idx >= $maxNum) {
$mores[] = [
'svg' =>$svgicon,
'permalink' => $categorys->permalink,
'name' => $categorys->name,
'childs' => $childs
];
continue;
}
?>
<li class="relative flex items-center xa-categories-title <?php if(xaIsActiveCategory($this,$categorys->slug)): ?>xa-selected<?php endif; ?> ">
<?php if($svgicon != ''):?>
<i class="flex items-center"><?php echo $svgicon;?></i>
Expand All @@ -30,7 +42,7 @@
<!-- 这里增加了功能,列表目录不再显示子目录 -->
<?php if (isset($childs) && count($childs) > 0 && !xaIsListCategory($categorys->mid)): ?>
<!-- 子分类下拉框 -->
<div class="xa-categories-sub xa-theme absolute top-full left-0 w-32 bg-white rounded-md shadow-md z-11 hidden">
<div class="xa-categories-sub xa-theme absolute top-full left-0 w-32 bg-white rounded-md shadow-md z-50 hidden">
<?php
foreach ($childs as $childmid) {
$child = $categorys->getCategory($childmid);
Expand All @@ -46,7 +58,23 @@
</div>
<?php endif; ?>
</li>
<?php endwhile; ?>
<?php $idx++; endwhile; ?>
<?php if (count($mores) > 0): ?>
<li class="relative flex items-center xa-categories-title">
<a href="javascript:;" class="xa-categories-title text-gray-500 hover:text-gray-700">更多<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-dots"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg></a>
<div class="xa-categories-sub xa-theme absolute top-full left-0 w-32 bg-white rounded-md shadow-md z-50 hidden">
<?php
foreach ($mores as $more) { ?>
<div class="block flex items-center py-2 px-3">
<?php if($more['svg'] != ''):?>
<i class="flex items-center"><?php echo $more['svg'];?></i>
<?php endif; ?>
<a href="<?php echo $more['permalink']; ?>" class="rounded-full text-gray-500 hover:text-gray-700"><?php echo $more['name']; ?></a>
</div>
<?php } ?>
</div>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</div>
Expand Down
21 changes: 15 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ function themeConfig($form)
);
$form->addInput($siteFooterHtml);

$categoryListStyle = new Text(
'categoryListStyle',
$menuCategoryNum = new Text(
'menuCategoryNum',
null,
null,
_t('有子目录则显示子目录的列表,没子目录则显示文章的标题列表,列表ID(多个用半角,分隔):1,2'),
_t('所有分类:'.xaGetCategoryies())
6,
_t('目录显示的分类数(包括首页),超过使用更多下拉,更多只显示一级分类'),
_t('太多的分类显示不好看,默认6个')
);
$form->addInput($categoryListStyle);
$form->addInput($menuCategoryNum);

$categoryIconSvg = new Textarea(
'categoryIconSvg',
Expand All @@ -184,6 +184,15 @@ function themeConfig($form)
_t('所有分类:'.xaGetCategoryies())
);
$form->addInput($categoryIconSvg);

$categoryListStyle = new Text(
'categoryListStyle',
null,
null,
_t('有子目录则显示子目录的列表,没子目录则显示文章的标题列表,列表ID(多个用半角,分隔):1,2'),
_t('一般用于小说目录页,所有分类:'.xaGetCategoryies())
);
$form->addInput($categoryListStyle);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
<link href="<?php $this->options->themeUrl("assets/css/tailwind.min.css?v=" . xaGetVersion()); ?>" rel="stylesheet" />
<link href="<?php $this->options->themeUrl("assets/css/tabler-icons.min.css"); ?>" rel="stylesheet"/>
<link href="<?php $this->options->themeUrl("assets/js/OwO/OwO.min.css?v=" . xaGetVersion()); ?>" rel="stylesheet" />
<link href="<?php $this->options->themeUrl("assets/css/outline.min.css?v=" . xaGetVersion()); ?>" rel="stylesheet" />
<link href="<?php $this->options->themeUrl("assets/css/xa-ink.css?v=" . xaGetVersion()); ?>" rel="stylesheet" />
<link href="<?php $this->options->themeUrl("assets/css/xa-ink-post.css?v=" . xaGetVersion()); ?>" rel="stylesheet" />
<link href="<?php $this->options->themeUrl("assets/css/outline.min.css?v=" . xaGetVersion()); ?>" rel="stylesheet" />
<script type="text/javascript" src="<?php $this->options->themeUrl("assets/js/jquery.min.js?v=" . xaGetVersion()); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl("assets/js/jquery.lazyload.min.js?v=" . xaGetVersion()); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl("assets/js/jquery.sticky-sidebar.min.js?v=" . xaGetVersion()); ?>"></script>
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package XaInk
* @author XiaoA
* @version 1.4.7
* @version 1.4.8
* @link https://www.xa.ink/
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
Expand Down

0 comments on commit 755ea16

Please sign in to comment.