优化更新

pull/5/head
新逸Cary 2020-06-24 11:34:45 +08:00
parent a265f761dc
commit 9bdc480d27
11 changed files with 554 additions and 616 deletions

View File

@ -21,3 +21,10 @@
> 2、文章封面图支持上传图片、使用随机封面图片、关闭封面图片显示
> 3、支持增加一键灰色背景设置
> 4、支持一键使用主题静态CDNhttps://s.xinac.net
<br>
## v1.3.3--20.06.24
> 1. 页面源码优化使html源码更标准
> 2. 分享按钮去除QQ空间分享
> 3. 修复页面滚动时的一个报错问题

View File

@ -45,7 +45,7 @@
</script>
</#if>
<#if settings.social_beian?? && settings.social_beian!=''>
<p style="text-align: left; line-height: 20px;margin: 0">
<p style="text-align: left; line-height: 20px;">
<a target="_blank" href="http://beian.miit.gov.cn/" style="color: black;font-style: inherit;font-weight: inherit;">
${settings.social_beian!}
</a>
@ -53,7 +53,7 @@
</#if>
<#if settings.social_free?? && settings.social_free!=''>
<p style="text-align: left; line-height: 20px; margin: 0">
&copy; ${.now?string('yyyy')} ${user.nickname!}&nbsp;${settings.social_free!}&nbsp;&nbsp;@${version!}
&copy; ${user.nickname!}&nbsp;${settings.social_free!}
</p>
</#if>
<#if settings.caidai!true>

View File

@ -33,7 +33,6 @@
<i class="${child.icon!}" aria-hidden="true"></i>&nbsp;${child.name!}
</a>
</#list>
</div>
</div>
<#else>
@ -52,10 +51,10 @@
</#if>
</#if>
</@menuTag>
</div>
<div class="navbar-end">
<#--${settings.links_top!}
${settings.links_top!}
<#--
<a class="navbar-item search" title="夜间模式" href="javascript:alert('开发中,敬请期待');">
<i class="fas fa-adjust"></i>
</a>-->
@ -66,8 +65,6 @@
</div>
</div>
</nav>
<style>
</style>
<script>
(function () {
var burger = document.querySelector('.burger');

View File

@ -1,16 +1,15 @@
<#macro layout title,canonical>
<#include "common/head.ftl">
<#include "common/navbar.ftl">
<#include "common/widget.ftl">
<#include "common/module.ftl">
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<#include "common/head.ftl">
<#include "common/navbar.ftl">
<#include "common/widget.ftl">
<#include "common/module.ftl">
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>${title!}</title>
<meta name="keywords" content="${meta_keywords!}" />
<meta name="description" content="${meta_description!}" />
<meta property="og:type" content="website" />
@ -24,25 +23,42 @@
<meta name="twitter:title" content="${title!}" />
<meta name="twitter:description" content="${meta_description!}" />
<meta name="twitter:image" content="${user.avatar!}" />
<link rel="canonical" href="${canonical!}" />
<link rel="alternative" href="${atom_url!}" title="${blog_title!}" type="application/atom+xml" />
<@global.head />
<@global.head />
<link rel="stylesheet" href="${settings.cdn_bulma_css!}" />
<link rel="stylesheet" href="${settings.cdn_fontawesome_css!}" />
<link href="${settings.cdn_google_fonts!}/css?family=Fira+Sans&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="${settings.cdn_google_fonts!}/css?family=Fira+Sans&display=swap" />
<#if is_post?? || is_sheet?? || is_journal??>
<link rel="stylesheet" href="${settings.cdn_lightgallery_css!}" />
<link rel="stylesheet" href="${settings.cdn_justifiedGallery_css!}" />
</#if>
<link rel="stylesheet" href="${theme_base!}/source/lib/outdatedbrowser/outdatedbrowser.min.css" />
<link rel="stylesheet" href="${theme_base!}/source/css/style.css" />
<link rel="stylesheet" href="${theme_base!}/source/css/bundle.css" />
<link rel="stylesheet" href="${theme_base!}/source/css/back-to-top.css" />
<#if post?? || journals??>
<link rel="stylesheet" href="${theme_base!}/source/lib/prism/css/prism-${settings.code_pretty!'Default'}.css" />
<script type="text/javascript" src="${theme_base!}/source/lib/prism/js/prism.js"></script>
</#if>
<#if is_index??>
<link rel="stylesheet" href="${theme_base!}/source/css/widget_pin.css" />
<link rel="stylesheet" href="${settings.cdn_swiper_css!}" />
</#if>
<#if settings.kanbanniang!true>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>
</#if>
<script type="text/javascript" src="${settings.cdn_pace_js!}"></script>
<#include "./plugin/style.theme.ftl">
<style>
body > .footer,
body > .navbar,
body > .section {
opacity: 0
}
</style>
<#if is_post?? || is_sheet?? || is_journal??>
<style>
.content code .number {
background-color: transparent;
border-radius: 0;
@ -52,44 +68,19 @@
padding: 0;
vertical-align: unset;
}
.tag {
font-size: 1em !important;
padding-right: 0 !important;
padding-left: 0 !important;
}
.attr-name {
padding-left: 0.75em !important;
}
</#if>
</style>
</#if>
</head>
<#if is_post?? || is_sheet?? || is_journal??>
<link rel="stylesheet" href="${settings.cdn_lightgallery_css!}" />
<link rel="stylesheet" href="${settings.cdn_justifiedGallery_css!}" />
</#if>
<link rel="stylesheet" href="${theme_base!}/source/lib/outdatedbrowser/outdatedbrowser.min.css" />
<script src="${settings.cdn_pace_js!}"></script>
<link rel="stylesheet" href="${theme_base!}/source/css/style.css" />
<link rel="stylesheet" href="${theme_base!}/source/css/bundle.css" />
<link rel="stylesheet" href="${theme_base!}/source/css/back-to-top.css" />
<#include "./plugin/style.theme.ftl">
<#if post?? || journals??>
<link rel="stylesheet" type="text/css" href="${theme_base!}/source/lib/prism/css/prism-${settings.code_pretty!'Default'}.css" />
<script type="text/javascript" src="${theme_base!}/source/lib/prism/js/prism.js"></script>
</#if>
<#if is_index??>
<link rel="stylesheet" href="${theme_base!}/source/css/widget_pin.css" />
<link rel="stylesheet" href="${settings.cdn_swiper_css!}" />
</#if>
<#if settings.kanbanniang!true>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>
</#if>
</head>
<body class="is-3-column">
<body class="is-3-column">
<@navbar 'page' />
<div class="card-normal">
<section class="section">
@ -173,9 +164,9 @@
</div>
</section>
</div>
<#include "common/footer.ftl">
<#include "common/scripts.ftl">
<#include "common/footer.ftl">
<#include "search/local.ftl">
</body>
</html>
</body>
</html>
</#macro>

View File

@ -1,4 +1,4 @@
<style>
<style>
<#if settings.site_gray!false>
html {
-webkit-filter: grayscale(100%);
@ -26,9 +26,9 @@
--link-hover-color: #1485FE;
/*code highlight*/
--code-bg-color: rgb(45,45,45);
--code-default-color: rgb(45,45,45);
--code-line-numbers-bg-color: rgb(45,45,45);
--code-bg-color: rgb(45, 45, 45);
--code-default-color: rgb(45, 45, 45);
--code-line-numbers-bg-color: rgb(45, 45, 45);
--code-line-numbers-color: skyblue;
--code-keyworks-color: #7012cc;
@ -48,8 +48,8 @@
--toc-vertical-line-color: #1485FE;
--toc-item-bg-hover: #1485FE;
}
<#if settings.auto_theme!true>
<#if settings.auto_theme!true>
/* Dark mode */
@media (prefers-color-scheme: dark) {
:root {
@ -95,123 +95,98 @@
}
}
</#if>
html {
background: var(--background);
color: var(--color);
}
body > .footer, body > .navbar {
background-color: var(--cardbgcolor);
color: var(--cardcolor);
}
a:hover {
color: var(--link-color);
}
.content a {
color: var(--link-color);
}
.content a:hover {
color: var(--link-hover-color);
font-weight: 400;
}
.card {
background-color: var(--cardbgcolor);
color: var(--cardcolor);
}
.card .card-image img,
img.thumbnail {
filter: var(--img-default-filter);
}
.card .card-image img:hover,
img.thumbnail:hover {
filter: var(--img-hover-filter);
}
.card .title {
color: var(--color) !important;
}
.navbar-dropdown {
background-color: var(--background);
}
blockquote {
background-color: var(--code-bg-color) !important;
color: #fff !important;
}
.card .content,
/*.card .title a{*/
/* color: var(--cardtitlecolor) !important;*/
/*}*/
/**
.card .title a{
color: var(--cardtitlecolor) !important;
}
*/
.pagination .pagination-link:not(.is-current),
.pagination .pagination-previous,
.pagination .pagination-next {
background-color: var(--cardbgcolor);
color: var(--cardcolor);
}
.navbar-item, .navbar-link,
.navbar-main .navbar-item .sub-menu {
color: var(--navbarcolor);
}
.has-link-black-ter {
color: var(--cardtitlecolor) !important;
}
.button {
background-color: var(--btn-bg-color) !important;
color: var(--btn-color) !important;
}
.button:hover {
background-color: var(--btn-hover-color) !important;
}
body > footer > div > div > div.level-end > div > a > i {
background-color: transparent;
color: var(--color);
}
.level .level-item.button {
background-color: var(--cardbgcolor) !important;
border-color: var(--cardbgcolor) !important;
color: var(--color) !important;
border: 0;
}
.menu-list .level {
color: var(--color);
}
.menu-list a:hover {
background-color: var(--background);
opacity: 0.6;
color: var(--link-hover-color);
}
.tag:not(body) {
background-color: var(--background) !important;
color: var(--color) !important;
}
.content .tag {
background-color: transparent !important;
color: var(--code-class-color) !important;
}
h1,
h2,
h3,
@ -222,43 +197,35 @@
strong {
color: var(--color) !important;
}
.is-active a {
color: var(--color) !important;
}
a.navbar-item:hover {
background-color: var(--cardbgcolor);
color: #3273dc;
}
code {
color: var(--color);
/*background-color: var(--code-bg-color)*/
}
code[class*="language-"],
pre[class*="language-"] {
color: var(--color);
background-color: var(--code-bg-color) !important;
}
pre[class*="language-"],
:not(pre) > code[class*="language-"] {
background: var(--background);
}
:not(pre) > code[class*="language-"] {
border: red;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: var(--code-cdata-color);
}
.token.property,
.token.tag,
.token.boolean,
@ -267,7 +234,6 @@
.token.symbol {
color: var(--code-symbol-color);
}
.token.selector,
.token.attr-name,
.token.string,
@ -276,7 +242,6 @@
.token.inserted {
color: var(--code-class-color);
}
.token.operator,
.token.entity,
.token.url,
@ -285,37 +250,29 @@
.token.variable {
color: var(--code-variable-color);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: var(--code-keyworks-color);
}
.token.regex,
.token.important {
color: var(--code-regex-color);
}
.token.deleted {
color: var(--code-deleted-color);
}
.line-numbers .line-numbers-rows {
background-color: var(--code-line-numbers-bg-color) !important;
}
.line-numbers-rows > span:before {
color: var(--code-line-numbers-color) !important;
}
.line-highlight {
background: rgba(21, 21, 21, 0.2) !important;
background: -webkit-linear-gradient(left, rgba(21, 21, 21, 0.2) 70%, rgba(21, 21, 21, 0)) !important;
background: linear-gradient(to right, rgba(21, 21, 21, 0.2) 70%, rgba(21, 21, 21, 0)) !important;
}
div.code-toolbar > .toolbar a,
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
@ -323,7 +280,6 @@
/*box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);*/
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
div.code-toolbar > .toolbar a:hover,
div.code-toolbar > .toolbar a:focus,
div.code-toolbar > .toolbar button:hover,
@ -332,87 +288,67 @@
div.code-toolbar > .toolbar span:focus {
color: var(--code-toolbar-color) !important;
}
.line-numbers-rows > span:before {
color: #fff;
}
.content table thead td,
.content table thead th {
color: var(--color);
}
#toc ul li a,
#toc ul li ul li a,
#toc ul li ul li ul li a {
color: var(--color);
}
#toc .active {
color: var(--toc-dot-active-color) !important;
}
#toc > ul li::before {
background-color: var(--toc-dot-color)
}
#toc a:hover {
color: var(--toc-dot-active-color) !important;
background-color: var(--toc-dot-active-bg-color);
}
#toc > ul:before {
background-color: var(--toc-vertical-line-color);
}
.navbar-burger {
color: var(--color);
}
.navbar-menu {
background-color: var(--cardbgcolor);
}
body > .navbar {
background-color: var(--navbarbgcolor);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
}
.content table thead td,
.content table thead th {
border: 1px solid var(--background);
}
.content table td,
.content table th {
border: 1px solid var(--background);
}
table {
border: 2px solid var(--btn-hover-color);
}
thead, tbody, tr, th {
border: 1px solid var(--background);
}
footer .title {
color: var(--color);
}
footer .button {
background-color: var(--cardbgcolor) !important;
}
.has-text-black-ter {
color: var(--color) !important;
}
blockquote ul {
padding: 0 10px !important;
margin: 0 !important;
}
</style>
</style>

View File

@ -1,4 +1,4 @@
<div class="searchbox ins-search">
<div class="searchbox ins-search">
<div class="searchbox-container ins-search-container">
<div class="searchbox-input-wrapper">
<form method="get" action="/search">
@ -30,19 +30,18 @@
<#list categories as category>
<a href="${category.fullPath!}">
<div class="ant-tag ant-tag-purple is-primary is-focused" style="margin-bottom: 8px;"> ${category.name!}</div>
<#-- <div class="ins-selectable ins-search-item">-->
<#-- <header>-->
<#-- <i class="fa fa-folder"></i>-->
<#-- <span class="ins-title">${category.name!}</span>-->
<#-- <span class="ins-slug">${category.slug!}</span>-->
<#-- </header>-->
<#-- </div>-->
<#-- <div class="ins-selectable ins-search-item">-->
<#-- <header>-->
<#-- <i class="fa fa-folder"></i>-->
<#-- <span class="ins-title">${category.name!}</span>-->
<#-- <span class="ins-slug">${category.slug!}</span>-->
<#-- </header>-->
<#-- </div>-->
</a>
</#list>
</@categoryTag>
</div>
</div>
</section>
<section class="ins-section">
<header class="ins-section-header">标签</header>
@ -52,14 +51,13 @@
<#list tags as tag>
<a href="${tag.fullPath!}">
<div class="ant-tag ant-tag-green" style="margin-bottom: 8px;"> ${tag.name!}</div>
<#-- <div class="ins-selectable ins-search-item">-->
<#-- <header>-->
<#-- <i class="fa fa-tag"></i>-->
<#-- <span class="ins-title">${tag.name!}</span>-->
<#-- <span class="ins-slug">${tag.slugName!}</span>-->
<#-- </header>-->
<#-- </div>-->
<#-- <div class="ins-selectable ins-search-item">-->
<#-- <header>-->
<#-- <i class="fa fa-tag"></i>-->
<#-- <span class="ins-title">${tag.name!}</span>-->
<#-- <span class="ins-slug">${tag.slugName!}</span>-->
<#-- </header>-->
<#-- </div>-->
</a>
</#list>
</@tagTag>
@ -69,13 +67,12 @@
</div>
</div>
</div>
</div>
<script>
</div>
<script>
function openSearchPanel() {
$(".ins-search").addClass("show");
}
function closeSearchPanel() {
$(".ins-search").removeClass("show");
}
</script>
</script>

View File

@ -1,4 +1,4 @@
<div class="social-share column is-one-third" style="margin-left: 1.5em;" data-disabled="tencent,linkedin,douban,diandian,google">
<div class="social-share column is-one-third" style="margin-left: 1.5em;" data-disabled="tencent,linkedin,douban,diandian,google,qzone">
<#if is_post??>
<a href="#" class="social-share-icon views">
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="readme" class="svg-inline--fa fa-readme fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M528.3 46.5H388.5c-48.1 0-89.9 33.3-100.4 80.3-10.6-47-52.3-80.3-100.4-80.3H48c-26.5 0-48 21.5-48 48v245.8c0 26.5 21.5 48 48 48h89.7c102.2 0 132.7 24.4 147.3 75 .7 2.8 5.2 2.8 6 0 14.7-50.6 45.2-75 147.3-75H528c26.5 0 48-21.5 48-48V94.6c0-26.4-21.3-47.9-47.7-48.1zM242 311.9c0 1.9-1.5 3.5-3.5 3.5H78.2c-1.9 0-3.5-1.5-3.5-3.5V289c0-1.9 1.5-3.5 3.5-3.5h160.4c1.9 0 3.5 1.5 3.5 3.5v22.9zm0-60.9c0 1.9-1.5 3.5-3.5 3.5H78.2c-1.9 0-3.5-1.5-3.5-3.5v-22.9c0-1.9 1.5-3.5 3.5-3.5h160.4c1.9 0 3.5 1.5 3.5 3.5V251zm0-60.9c0 1.9-1.5 3.5-3.5 3.5H78.2c-1.9 0-3.5-1.5-3.5-3.5v-22.9c0-1.9 1.5-3.5 3.5-3.5h160.4c1.9 0 3.5 1.5 3.5 3.5v22.9zm259.3 121.7c0 1.9-1.5 3.5-3.5 3.5H337.5c-1.9 0-3.5-1.5-3.5-3.5v-22.9c0-1.9 1.5-3.5 3.5-3.5h160.4c1.9 0 3.5 1.5 3.5 3.5v22.9zm0-60.9c0 1.9-1.5 3.5-3.5 3.5H337.5c-1.9 0-3.5-1.5-3.5-3.5V228c0-1.9 1.5-3.5 3.5-3.5h160.4c1.9 0 3.5 1.5 3.5 3.5v22.9zm0-60.9c0 1.9-1.5 3.5-3.5 3.5H337.5c-1.9 0-3.5-1.5-3.5-3.5v-22.8c0-1.9 1.5-3.5 3.5-3.5h160.4c1.9 0 3.5 1.5 3.5 3.5V190z"></path></svg>

View File

@ -114,7 +114,7 @@
var id = that.attr('href');
var target = $(id);
if (scrollTop >= target.offset().top - offset) {
if (target.offset() && scrollTop >= target.offset().top - offset) {
anchors.removeClass('active');
anchors.parent().removeClass("lit-active");
that.addClass('active');

View File

@ -257,6 +257,9 @@ img.thumbnail {
border-left: 0.4rem solid #4b8af3;
background-color: #e9f5fe;
}
.content blockquote {
padding: 0.25em 0.5em;
}
.rtl {
direction: rtl;
}
@ -437,6 +440,9 @@ img.thumbnail {
font-size: 0.95em;
font-family: 'Fira Sans', monospace, "Microsoft YaHei";
}
.content code {
color: #ff3860 !important;
}
.content blockquote footer strong + cite {
margin-left: 0.5em;
}

View File

@ -224,7 +224,9 @@ img.thumbnail
blockquote
border-left: .4rem solid #4b8af3
background-color: #e9f5fe
.content
blockquote
padding: 0.25em 0.5em
.rtl
direction: rtl
.level
@ -383,6 +385,8 @@ img.thumbnail
code, pre
font-size: 0.95em
font-family: family-mono
code
color: #ff3860 !important
//code
// color: hsl(348, 100%, 61%)
// background: transparent

View File

@ -7,5 +7,5 @@ description: Fantastic主题修改版https://github.com/jinqilin721/halo-them
logo: https://blog.xinac.cn/avatar
website: https://github.com/jinqilin721/halo-theme-xinac-fantastic
repo: https://github.com/jinqilin721/halo-theme-xinac-fantastic
version: 1.3.2
version: 1.3.3
require: 1.3.0