Compare commits

...

10 Commits
1.0 ... main

Author SHA1 Message Date
浪子 31838bf189 1.0.4
略微调整
2024-07-30 09:55:40 +08:00
浪子 eecbdb7a10 fix 强制换行 2024-07-18 08:49:36 +08:00
浪子 feaf42d751 1.0.3 2024-07-09 19:41:28 +08:00
浪子 5932a9ea2c 1.0.2 2024-07-09 18:54:56 +08:00
浪子 024750ffd9 fix code highlight 2024-07-09 11:14:46 +08:00
浪子 c097f8815d 1.0.2 2024-07-07 12:25:25 +08:00
浪子 d11da1106b fix 移动设备标题长
加入判断
2024-07-07 10:46:35 +08:00
浪子 d92847f23a change 版本号 2024-07-02 10:40:06 +08:00
浪子 57603382c3 Delete .gitattributes 2024-07-02 10:38:22 +08:00
浪子 01a12723ad fix 评论 2024-07-02 10:37:11 +08:00
9 changed files with 51 additions and 47 deletions

2
.gitattributes vendored
View File

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

View File

@ -6,7 +6,17 @@
评论列表参考`wordpress`主题`farallon` 评论列表参考`wordpress`主题`farallon`
## 使用
更多SNS,按以下格式
```
<a class="link-item" href="SNS地址" target="_blank"><svg> svg </svg> </a>
<a class="link-item" href="SNS地址" target="_blank"><svg> svg </svg> </a>
<a class="link-item" href="SNS地址" target="_blank"><svg> svg </svg> </a>
<a class="link-item" href="SNS地址" target="_blank"><svg> svg </svg> </a>
<a class="link-item" href="SNS地址" target="_blank"><svg> svg </svg> </a>
```
## 感谢 ## 感谢

View File

@ -12,9 +12,9 @@
d="M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z"> d="M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z">
</path> </path>
</g> </g>
</svg><?php $this->commentsNum(_t('0'), _t('1'), _t('%d')); ?> </svg>评论 (<?php $this->commentsNum(_t('0'), _t('1'), _t('%d')); ?>)
</h3> </h3>
<ol class="commentlist sulliComment--list"></ol> <ol class="commentlist"></ol>
<?php if ($comments->have()): ?> <?php if ($comments->have()): ?>
<?php $comments->listComments(); ?> <?php $comments->listComments(); ?>
<?php <?php
@ -68,7 +68,7 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php else: ?> <?php else: ?>
<?php _e(''); ?>
<?php endif; ?> <?php endif; ?>
<?php $this->options->twikoo(); ?> <?php $this->options->twikoo(); ?>
</div> </div>
@ -100,7 +100,6 @@ function threadedComments($comments, $options) {
<?php else: ?> <?php else: ?>
<?php echo $comments->gravatar('40', ''); ?> <?php echo $comments->gravatar('40', ''); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="comment--meta"> <div class="comment--meta">
<div class="comment--author"><?php echo $comments->author; ?><span class="dot"></span> <div class="comment--author"><?php echo $comments->author; ?><span class="dot"></span>

View File

@ -7,6 +7,8 @@
<?php $this->options->tongji(); ?> <?php $this->options->tongji(); ?>
</footer> </footer>
<?php if ($this->options->showprism): ?> <?php if ($this->options->showprism): ?>
<script src="<?php $this->options->themeUrl('prism.js'); ?>"></script>
<link rel="stylesheet" href="<?php $this->options->themeUrl('prism.css'); ?>" />
<script> <script>
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var defaultLanguage = 'javascript'; // 设置默认语言 var defaultLanguage = 'javascript'; // 设置默认语言

View File

@ -23,6 +23,8 @@ function themeConfig($form) {
$form->addInput($postlisttittle); $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);
$moresns= new Typecho_Widget_Helper_Form_Element_Textarea('moresns', NULL, NULL, _t('更多的SNS'), _t('支持HTML,请参考文档'));
$form->addInput($moresns);
$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('不填写则不显示'));
$form->addInput($twikoo); $form->addInput($twikoo);
$addhead = new Typecho_Widget_Helper_Form_Element_Textarea('addhead', NULL, NULL, _t('添加head'), _t('支持HTML')); $addhead = new Typecho_Widget_Helper_Form_Element_Textarea('addhead', NULL, NULL, _t('添加head'), _t('支持HTML'));
@ -143,6 +145,6 @@ function addHeaderLinks($text)
$level = $matches[1]; $level = $matches[1];
$title = $matches[2]; $title = $matches[2];
$id = htmlspecialchars(strip_tags($title), ENT_QUOTES, 'UTF-8'); $id = htmlspecialchars(strip_tags($title), ENT_QUOTES, 'UTF-8');
return sprintf('<h%s id="%s"><a href="#%s" class="headerlink" title="%s">%s</a></h%s>', $level, $id, $id, $title, $title, $level); return sprintf('<h%s id="%s"><a href="#%s" class="headerlink" title="%s"></a>%s</h%s>', $level, $id, $id, $title, $title, $level);
}, $text); }, $text);
} }

View File

@ -1,10 +1,10 @@
<?php <?php
/** /**
* 移植自Hexo主题 Chic * 移植自 Hexo主题 Chic
* @package Chic * @package Chic
* @author 老孙 * @author 老孙
* @version 0.2 * @version 1.0.4
* @link https://imsun.org * @link https://www.imsun.org
*/ */
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?> <?php $this->need('header.php'); ?>
@ -52,4 +52,21 @@ while($this->next()):
); );
?> ?>
</div> </div>
<script>
function truncateTitle() {
var links = document.getElementsByClassName('archive-item-link');
var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
if (width < 420) {
for (var i = 0; i < links.length; i++) {
var title = links[i].innerHTML;
if (title.length > 20) {
links[i].innerHTML = title.substring(0, 20) + '...';
}
}
}
}
window.addEventListener('resize', truncateTitle);
truncateTitle();
</script>
<?php $this->need('footer.php'); ?> <?php $this->need('footer.php'); ?>

View File

@ -42,6 +42,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="32" height="32" fill="currentColor"><path d="M3.019 12.0075C2.98744 10.7478 3.00692 9.5598 3.00692 8.56644C3.00692 4.22767 5.84954 2.95597 5.84954 2.95597C7.28286 2.29767 9.74238 2.0209 12.2993 2H12.3621C14.919 2.0209 17.3801 2.29767 18.8134 2.95597C18.8134 2.95597 21.656 4.22767 21.656 8.56644C21.656 8.56644 21.6916 11.7674 21.2596 13.9898C20.9852 15.4007 18.8034 16.9446 16.2974 17.2438C14.9906 17.3999 13.7042 17.5431 12.3322 17.4802C10.0885 17.3775 8.31815 16.9446 8.31815 16.9446C8.31815 17.1631 8.33166 17.3711 8.35853 17.5655C8.44182 18.1978 8.65659 18.6604 8.96296 19C9.72944 19.8497 11.0692 19.9301 12.3577 19.9743C14.178 20.0366 15.7986 19.5254 15.7986 19.5254L15.8735 21.1712C15.8735 21.1712 14.6003 21.8548 12.3322 21.9805C11.0815 22.0493 9.52858 21.9491 7.71969 21.4704C6.18802 21.065 5.15153 20.1804 4.45091 19C3.35714 17.1573 3.08191 14.5938 3.019 12.0075ZM6.31815 16.9446V14.3967L8.79316 15.0018C8.8405 15.0134 8.95098 15.0383 9.11692 15.0723C9.40521 15.1313 9.73416 15.1908 10.0959 15.2467C10.8485 15.3628 11.6341 15.4462 12.4237 15.4823C13.4425 15.529 14.3249 15.4652 16.0603 15.2579C17.7233 15.0594 19.208 14.0622 19.2963 13.6082C19.3783 13.1861 19.4472 12.6858 19.5021 12.1261C19.5714 11.4205 19.6155 10.6558 19.6388 9.88068C19.654 9.37026 19.6582 8.93648 19.6564 8.62452L19.656 8.56644C19.656 7.1368 19.2873 6.12756 18.6928 5.40793C18.5008 5.17553 18.3004 4.99408 18.1087 4.85958C18.0183 4.79617 17.9737 4.77136 17.9787 4.77345C16.9662 4.30844 14.8859 4.02069 12.3621 3.99993H12.3156C9.77596 4.02069 7.6969 4.30836 6.66627 4.78161C6.68919 4.77136 6.64459 4.79617 6.55423 4.85958C6.36257 4.99408 6.16214 5.17553 5.97016 5.40793C5.37568 6.12756 5.00692 7.1368 5.00692 8.56644C5.00692 8.7976 5.00628 8.96339 5.00392 9.44137C4.9981 10.6238 5.00004 11.2256 5.01841 11.9589C5.07185 14.156 5.2822 15.7941 5.71797 17C5.93023 17.5874 6.19005 18.0709 6.49741 18.4507C6.37791 18.0162 6.31815 17.5142 6.31815 16.9446ZM8.08576 6.37135C8.71735 6.37135 9.22924 6.88324 9.22924 7.51482C9.22924 8.14626 8.71735 8.6583 8.08576 8.6583C7.45432 8.6583 6.94229 8.14626 6.94229 7.51482C6.94229 6.88324 7.45432 6.37135 8.08576 6.37135Z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="32" height="32" fill="currentColor"><path d="M3.019 12.0075C2.98744 10.7478 3.00692 9.5598 3.00692 8.56644C3.00692 4.22767 5.84954 2.95597 5.84954 2.95597C7.28286 2.29767 9.74238 2.0209 12.2993 2H12.3621C14.919 2.0209 17.3801 2.29767 18.8134 2.95597C18.8134 2.95597 21.656 4.22767 21.656 8.56644C21.656 8.56644 21.6916 11.7674 21.2596 13.9898C20.9852 15.4007 18.8034 16.9446 16.2974 17.2438C14.9906 17.3999 13.7042 17.5431 12.3322 17.4802C10.0885 17.3775 8.31815 16.9446 8.31815 16.9446C8.31815 17.1631 8.33166 17.3711 8.35853 17.5655C8.44182 18.1978 8.65659 18.6604 8.96296 19C9.72944 19.8497 11.0692 19.9301 12.3577 19.9743C14.178 20.0366 15.7986 19.5254 15.7986 19.5254L15.8735 21.1712C15.8735 21.1712 14.6003 21.8548 12.3322 21.9805C11.0815 22.0493 9.52858 21.9491 7.71969 21.4704C6.18802 21.065 5.15153 20.1804 4.45091 19C3.35714 17.1573 3.08191 14.5938 3.019 12.0075ZM6.31815 16.9446V14.3967L8.79316 15.0018C8.8405 15.0134 8.95098 15.0383 9.11692 15.0723C9.40521 15.1313 9.73416 15.1908 10.0959 15.2467C10.8485 15.3628 11.6341 15.4462 12.4237 15.4823C13.4425 15.529 14.3249 15.4652 16.0603 15.2579C17.7233 15.0594 19.208 14.0622 19.2963 13.6082C19.3783 13.1861 19.4472 12.6858 19.5021 12.1261C19.5714 11.4205 19.6155 10.6558 19.6388 9.88068C19.654 9.37026 19.6582 8.93648 19.6564 8.62452L19.656 8.56644C19.656 7.1368 19.2873 6.12756 18.6928 5.40793C18.5008 5.17553 18.3004 4.99408 18.1087 4.85958C18.0183 4.79617 17.9737 4.77136 17.9787 4.77345C16.9662 4.30844 14.8859 4.02069 12.3621 3.99993H12.3156C9.77596 4.02069 7.6969 4.30836 6.66627 4.78161C6.68919 4.77136 6.64459 4.79617 6.55423 4.85958C6.36257 4.99408 6.16214 5.17553 5.97016 5.40793C5.37568 6.12756 5.00692 7.1368 5.00692 8.56644C5.00692 8.7976 5.00628 8.96339 5.00392 9.44137C4.9981 10.6238 5.00004 11.2256 5.01841 11.9589C5.07185 14.156 5.2822 15.7941 5.71797 17C5.93023 17.5874 6.19005 18.0709 6.49741 18.4507C6.37791 18.0162 6.31815 17.5142 6.31815 16.9446ZM8.08576 6.37135C8.71735 6.37135 9.22924 6.88324 9.22924 7.51482C9.22924 8.14626 8.71735 8.6583 8.08576 8.6583C7.45432 8.6583 6.94229 8.14626 6.94229 7.51482C6.94229 6.88324 7.45432 6.37135 8.08576 6.37135Z"></path></svg>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php $this->options->moresns() ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,9 +1,5 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> <?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header.php'); ?> <?php $this->need('header.php'); ?>
<?php if ($this->options->showprism): ?>
<script src="<?php $this->options->themeUrl('prism.js'); ?>"></script>
<link rel="stylesheet" href="<?php $this->options->themeUrl('prism.css'); ?>" />
<?php endif; ?>
<div class="main"> <div class="main">
<div class="container"> <div class="container">
<?php if ($this->options->showtoc): ?> <?php if ($this->options->showtoc): ?>
@ -47,10 +43,12 @@
<span class="tag"> <span class="tag">
<?php if ($this->tags): ?> <?php if ($this->tags): ?>
<?php foreach ($this->tags as $tag): ?> <?php foreach ($this->tags as $tag): ?>
<a href="<?php echo $tag['permalink']; ?>">#<?php echo $tag['name']; ?></a> <a href="<?php echo $tag['permalink']; ?>">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14" fill="rgba(87,107,79,1)"><path d="M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z"></path></svg>
<?php echo $tag['name']; ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php else: ?> <?php else: ?>
无标签
<?php endif; ?> <?php endif; ?>
</span> </span>
</div> </div>

View File

@ -1263,10 +1263,6 @@ html {
width: auto width: auto
} }
.comment-form .submit:hover {
background-color: var(--farallon-text-light)
}
.comment-form p { .comment-form p {
margin-bottom: 15px margin-bottom: 15px
} }
@ -1278,7 +1274,6 @@ html {
.comment-form .comment-notes, .comment-form .comment-notes,
.comment-form .logged-in-as { .comment-form .logged-in-as {
font-size: 12px; font-size: 12px;
color: var(--farallon-text-gray)
} }
.comment-reply-title { .comment-reply-title {
@ -1295,7 +1290,7 @@ html {
} }
.commentlist { .commentlist {
border-top: 1px solid var(--farallon-border-color-light); border-top: 1px solid var(--theme);
list-style: none; list-style: none;
padding-top: 10px padding-top: 10px
} }
@ -1307,7 +1302,6 @@ html {
.commentlist .comment-respond { .commentlist .comment-respond {
margin-top: 20px; margin-top: 20px;
padding: 20px; padding: 20px;
background-color: var(--farallon-background-gray);
border-radius: 5px border-radius: 5px
} }
@ -1326,7 +1320,7 @@ html {
} }
.comment.parent { .comment.parent {
border-bottom: 1px solid var(--farallon-border-color-light) border-bottom: 1px solid var(--theme)
} }
.comment.parent:last-child { .comment.parent:last-child {
@ -1347,7 +1341,7 @@ html {
} }
.comment-body:hover .avatar { .comment-body:hover .avatar {
box-shadow: 0 0 3px 0 var(--farallon-hover-color) box-shadow: 0 0 3px 0
} }
.comment--avatar { .comment--avatar {
@ -1367,21 +1361,11 @@ html {
} }
.comment--author .comment-reply-link svg { .comment--author .comment-reply-link svg {
fill: var(--farallon-text-gray);
width: 15px; width: 15px;
height: 15px height: 15px
} }
.comment--author .comment-reply-link:hover svg {
fill: var(--farallon-hover-color)
}
.comment--author a {
color: var(--farallon-main-color)
}
.comment--author a:hover { .comment--author a:hover {
color: var(--farallon-hover-color);
text-decoration: underline text-decoration: underline
} }
@ -1391,10 +1375,6 @@ html {
flex: auto flex: auto
} }
.comment--time {
color: var(--farallon-text-light)
}
.comment-meta { .comment-meta {
display: flex; display: flex;
align-items: center align-items: center
@ -1413,17 +1393,12 @@ div.cancel-comment-reply.cancel-comment-reply-link {
word-wrap: break-word !important; word-wrap: break-word !important;
overflow-wrap: break-word !important; overflow-wrap: break-word !important;
white-space: normal !important; white-space: normal !important;
color: var(--farallon-text-light)
} }
.comment-content a { .comment-content a {
text-decoration: underline text-decoration: underline
} }
.comment-content a:hover {
color: var(--farallon-hover-color)
}
.children { .children {
margin-left: 0; margin-left: 0;
padding-bottom: 10px padding-bottom: 10px
@ -1482,7 +1457,6 @@ div.cancel-comment-reply.cancel-comment-reply-link {
margin-right: 5px; margin-right: 5px;
position: relative; position: relative;
transform: translate3d(0, 1px, 0); transform: translate3d(0, 1px, 0);
fill: var(--farallon-text-color)
} }
.comment-respond { .comment-respond {
@ -1495,7 +1469,6 @@ div.cancel-comment-reply.cancel-comment-reply-link {
.comment-form-cookies-consent label { .comment-form-cookies-consent label {
font-size: 14px; font-size: 14px;
color: var(--farallon-text-gray);
display: flex; display: flex;
align-items: center; align-items: center;
position: relative position: relative
@ -1519,7 +1492,6 @@ div.cancel-comment-reply.cancel-comment-reply-link {
} }
.comment-form-cookies-consent input:checked+label::after { .comment-form-cookies-consent input:checked+label::after {
background-color: var(--farallon-main-color);
border-radius: 100%; border-radius: 100%;
content: ""; content: "";
position: absolute; position: absolute;
@ -1544,4 +1516,9 @@ ul.comment-list {
/* 适用于所有嵌套的评论列表 */ /* 适用于所有嵌套的评论列表 */
ol.comment-list li, ul.comment-list li { ol.comment-list li, ul.comment-list li {
list-style-type: none; list-style-type: none;
}
/* 文章中强制换行 */
article p {
word-wrap:break-word;
} }