fix default theme & update to v3.1.3
@ -2,6 +2,10 @@
|
||||
display: block
|
||||
}
|
||||
|
||||
.entry-content blockquote blockquote:before,.entry-content blockquote blockquote:after {
|
||||
display: none
|
||||
}
|
||||
|
||||
.entry-content .begin,
|
||||
.single-begin {
|
||||
float: left;
|
||||
@ -28,6 +32,11 @@
|
||||
border-radius: 10px
|
||||
}
|
||||
|
||||
.entry-content ul ul {
|
||||
border: none;
|
||||
padding: 15px 10px 15px 30px;
|
||||
}
|
||||
|
||||
.entry-content ol {
|
||||
list-style: decimal;
|
||||
border: 1px dashed #E4E4E4;
|
||||
@ -122,3 +131,261 @@ h1.entry-title {
|
||||
font-size: 28px;
|
||||
letter-spacing: .6em
|
||||
}
|
||||
|
||||
.entry-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
.entry-content th, .entry-content td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.entry-content tr:nth-child(even){background-color: #f2f2f2}
|
||||
|
||||
.entry-content th {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/*fix code block*/
|
||||
.entry-content pre th, .entry-content pre td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.entry-content pre tr:nth-child(even){
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.entry-content pre th {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.highlight-wrap:before {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
background: #fc625d;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
left: 12px;
|
||||
margin-top: -18px;
|
||||
-webkit-box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
||||
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
||||
z-index: 2
|
||||
}
|
||||
|
||||
.highlight-wrap {
|
||||
position: relative;
|
||||
background: #21252b;
|
||||
border-radius: 5px;
|
||||
font: 15px/22px "Microsoft YaHei", Arial, Sans-Serif;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 1.6em;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
text-shadow: none;
|
||||
color: #000;
|
||||
padding-top: 30px;
|
||||
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4)
|
||||
}
|
||||
|
||||
.highlight-wrap .copy-code {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
float: right;
|
||||
right: 10px;
|
||||
top: 0;
|
||||
padding-top: 4px;
|
||||
padding-right: 2px;
|
||||
z-index: 2;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.highlight-wrap .copy-code:hover {
|
||||
color: rgba(255,255,255,.5);
|
||||
}
|
||||
|
||||
.hljs-ln-line span::-moz-selection,
|
||||
.hljs-ln-line::-moz-selection {
|
||||
background: #fff;
|
||||
color: #21252b
|
||||
}
|
||||
|
||||
.hljs-ln-line span::selection,
|
||||
.hljs-ln-line::selection {
|
||||
background: #fff;
|
||||
color: #21252b
|
||||
}
|
||||
|
||||
.highlight-wrap code {
|
||||
background: #1d1f21;
|
||||
color: #fff;
|
||||
word-break: break-word;
|
||||
font-family: 'Source Code Pro', monospace, Helvetica, Tahoma, Arial, STXihei, "STHeiti Light", "Microsoft YaHei", sans-serif;
|
||||
padding: 2px;
|
||||
text-shadow: none;
|
||||
border-radius: 0 0 5px 5px;
|
||||
cursor: url(https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/cursor/texto.cur), auto
|
||||
}
|
||||
|
||||
.highlight-wrap code[data-rel]:before {
|
||||
color: #fff;
|
||||
content: attr(data-rel);
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #21252b;
|
||||
font-size: 16px;
|
||||
position: absolute;
|
||||
margin-top: -30px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
font-family: Ubuntu, sans-serif;
|
||||
font-weight: 700;
|
||||
padding: 0 80px;
|
||||
text-indent: 15px;
|
||||
text-align: center;
|
||||
float: left;
|
||||
z-index: 1;
|
||||
border-radius: 5px 5px 0 0;
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
pointer-events: none
|
||||
}
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: .5em;
|
||||
color: #abb2bf;
|
||||
background: rgba(254, 250, 199, .5);
|
||||
border-radius: 10px
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #888f96;
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-formula,
|
||||
.hljs-keyword {
|
||||
color: #c678dd
|
||||
}
|
||||
|
||||
.hljs-deletion,
|
||||
.hljs-name,
|
||||
.hljs-section,
|
||||
.hljs-selector-tag,
|
||||
.hljs-subst {
|
||||
color: #e06c75
|
||||
}
|
||||
|
||||
.hljs-literal {
|
||||
color: #56b6c2
|
||||
}
|
||||
|
||||
.hljs-addition,
|
||||
.hljs-attribute,
|
||||
.hljs-meta-string,
|
||||
.hljs-regexp,
|
||||
.hljs-string {
|
||||
color: #98c379
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-class .hljs-title {
|
||||
color: #e6c07b
|
||||
}
|
||||
|
||||
.hljs-attr,
|
||||
.hljs-number,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-template-variable,
|
||||
.hljs-type,
|
||||
.hljs-variable {
|
||||
color: #d19a66
|
||||
}
|
||||
|
||||
.hljs-bullet,
|
||||
.hljs-link,
|
||||
.hljs-meta,
|
||||
.hljs-selector-id,
|
||||
.hljs-symbol,
|
||||
.hljs-title {
|
||||
color: #61aeee
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: 700
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline
|
||||
}
|
||||
|
||||
.hljs-ln {
|
||||
margin: 6px 0 0 0 !important
|
||||
}
|
||||
|
||||
td.hljs-ln-numbers {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
text-align: center;
|
||||
color: #888f96;
|
||||
background: #1d1f21;
|
||||
font-family: 'Source Code Pro', monospace, Helvetica, Tahoma, Arial, STXihei, "STHeiti Light", "Microsoft YaHei", sans-serif;
|
||||
vertical-align: top;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 30px
|
||||
}
|
||||
|
||||
.hljs-ln-code .hljs-ln-line {
|
||||
margin-left: 25px;
|
||||
padding-left: 5px
|
||||
}
|
||||
|
||||
.hljs-ln-code .hljs-ln-line:hover {
|
||||
background-color: rgba(255, 255, 255, .1)
|
||||
}
|
||||
|
||||
.code-block-fullscreen {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 100%;
|
||||
z-index: 9999999;
|
||||
margin: 0;
|
||||
animation: elastic 1s
|
||||
}
|
||||
|
||||
.code-block-fullscreen code {
|
||||
--widthA: 100%;
|
||||
--widthB: calc(var(--widthA) - 30px);
|
||||
height: var(--widthB);
|
||||
min-height: 99%;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
height: auto
|
||||
}
|
||||
|
||||
.code-block-fullscreen-html-scroll {
|
||||
overflow: hidden
|
||||
}
|
||||
|
Before Width: | Height: | Size: 248 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 694 KiB |
Before Width: | Height: | Size: 805 KiB |
Before Width: | Height: | Size: 486 KiB After Width: | Height: | Size: 486 KiB |
Before Width: | Height: | Size: 732 KiB After Width: | Height: | Size: 732 KiB |
@ -7,7 +7,7 @@
|
||||
* @package Sakura
|
||||
*/
|
||||
|
||||
define( 'SAKURA_VERSION', '3.1.2' );
|
||||
define( 'SAKURA_VERSION', '3.1.3' );
|
||||
define( 'JSDELIVR_VERSION', '3.6.7' );
|
||||
|
||||
//ini_set('display_errors', true);
|
||||
@ -173,10 +173,16 @@ function sakura_scripts() {
|
||||
if(akina_option('jsdelivr_cdn_test')){
|
||||
wp_enqueue_script( 'js_lib', get_template_directory_uri() . '/cdn/js/lib.js', array(), SAKURA_VERSION.akina_option('cookie_version', ''), true );
|
||||
} else {
|
||||
wp_enqueue_script( 'js_lib', 'https://cdn.jsdelivr.net/gh/moezx/cdn@' . JSDELIVR_VERSION . '/sakura/js/lib.min.js', array(), SAKURA_VERSION, true );
|
||||
wp_enqueue_script( 'js_lib', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/cdn/js/lib.min.js', array(), SAKURA_VERSION, true );
|
||||
}
|
||||
if (akina_option('app_no_jsdelivr_cdn')) {
|
||||
wp_enqueue_style( 'saukra_css', get_stylesheet_uri(), array(), SAKURA_VERSION );
|
||||
wp_enqueue_script( 'app', get_template_directory_uri() . '/js/sakura-app.js', array(), SAKURA_VERSION, true );
|
||||
} else {
|
||||
wp_enqueue_style( 'saukra_css', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/style.min.css', array(), SAKURA_VERSION );
|
||||
wp_enqueue_script( 'app', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/js/sakura-app.min.js', array(), SAKURA_VERSION, true );
|
||||
}
|
||||
|
||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
}
|
||||
@ -1464,4 +1470,14 @@ function change_avatar($avatar){
|
||||
}
|
||||
}
|
||||
|
||||
// default feature image
|
||||
function DEFAULT_FEATURE_IMAGE() {
|
||||
if ( empty( akina_option('default_feature_image' )) ) {
|
||||
return get_template_directory_uri().'/feature/index.php?'.rand(1,1000);
|
||||
//return 'https://api.mashiro.top/feature/?'.rand(1,1000);
|
||||
} else {
|
||||
return akina_option('default_feature_image').'?'.rand(1,1000);
|
||||
}
|
||||
}
|
||||
|
||||
//code end
|
||||
|
@ -41,6 +41,12 @@ if ( akina_option('theme_skin') ) { ?>
|
||||
background: <?php echo akina_option('theme_skin'); ?>
|
||||
}
|
||||
|
||||
<?php if(akina_option('entry_content_theme') == "sakura"){ ?>
|
||||
.entry-content th {
|
||||
background-color: <?php echo akina_option('theme_skin'); ?>
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
<?php } // theme-skin ?>
|
||||
<?php // Custom style
|
||||
if ( akina_option('site_custom_style') ) {
|
||||
|
@ -43,7 +43,7 @@ mashiro_option.entry_content_theme_src = "<?php echo get_template_directory_uri(
|
||||
<?php if(akina_option('jsdelivr_cdn_test')){ ?>
|
||||
mashiro_option.jsdelivr_css_src = "<?php echo get_template_directory_uri() ?>/cdn/css/lib.css?<?php echo SAKURA_VERSION.akina_option('cookie_version', ''); ?>";
|
||||
<?php } else { ?>
|
||||
mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/moezx/cdn@<?php echo JSDELIVR_VERSION; ?>/sakura/css/lib.min.css";
|
||||
mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/mashirozx/Sakura@<?php echo SAKURA_VERSION; ?>/cdn/css/lib.min.css";
|
||||
<?php } ?>
|
||||
<?php if (akina_option('playlist_id', '')): ?>
|
||||
mashiro_option.float_player_on = true;
|
||||
|
29
options.php
@ -218,6 +218,13 @@ function optionsframework_options() {
|
||||
'square' => __('方形', '')
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('默认文章特色图', 'options_framework_theme'),
|
||||
'desc' => __('在未设置文章特色图的情况下展示的默认图像,留空则调用本地随机封面(要展示的图片放入 /wp-content/themes/Sakura/feature/gallery/ 目录)', 'options_framework_theme'),
|
||||
'id' => 'default_feature_image',
|
||||
'std' => 'https://api.mashiro.top/feature/',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('评论收缩', 'akina'),
|
||||
'id' => 'toggle-menu',
|
||||
@ -733,12 +740,19 @@ function optionsframework_options() {
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('CDN 本地调试', 'options_framework_theme'),
|
||||
'name' => __('本地调用前端库(lib.js、lib.css)', 'options_framework_theme'),
|
||||
'desc' => __('前端库不走 jsDelivr,不建议启用', 'options_framework_theme'),
|
||||
'id' => 'jsdelivr_cdn_test',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('本地调用主题 js、css 文件(sakura-app.js、style.css)', 'options_framework_theme'),
|
||||
'desc' => __('主题的 js、css 文件不走 jsDelivr,DIY 时请开启', 'options_framework_theme'),
|
||||
'id' => 'app_no_jsdelivr_cdn',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
//其他
|
||||
$options[] = array(
|
||||
'name' => __('其他', 'options_framework_theme'),
|
||||
@ -751,6 +765,18 @@ function optionsframework_options() {
|
||||
'std' => '',
|
||||
'type' => 'typography ');
|
||||
|
||||
$options[] = array(
|
||||
'name' => "检查更新",
|
||||
'desc' => '<a href="https://github.com/mashirozx/Sakura/releases/latest">下载最新版</a>',
|
||||
'id' => "release_info",
|
||||
'std' => "tag",
|
||||
'type' => "images",
|
||||
'options' => array(
|
||||
'tag' => 'https://img.shields.io/github/release/mashirozx/Sakura.svg?style=flat-square',
|
||||
'tag2' => 'https://img.shields.io/github/commits-since/mashirozx/Sakura/v'.SAKURA_VERSION.'.svg?style=flat-square'
|
||||
)
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('页脚悬浮播放器', 'options_framework_theme'),
|
||||
'desc' => __('如果不需要播放器留空即可。填写网易云音乐的「歌单」ID,eg:https://music.163.com/#/playlist?id=2288037900的ID是2288037900', 'options_framework_theme'),
|
||||
@ -876,5 +902,6 @@ function optionsframework_options() {
|
||||
'std' => '0',
|
||||
'type' => 'text');
|
||||
|
||||
|
||||
return $options;
|
||||
}
|
@ -5,7 +5,7 @@ Theme URI: https://2heng.xin/theme-sakura/
|
||||
Author: Mashiro, Louie, Fuzzz
|
||||
Author URI: http://2heng.xin
|
||||
Description: Akina主题分支(原版地址 http://www.akina.pw/themeakina)
|
||||
Version: 3.1.2
|
||||
Version: 3.1.3
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: akina
|
||||
|
@ -16,7 +16,7 @@
|
||||
<?php if ( has_post_thumbnail() ) { ?>
|
||||
<a href="<?php the_permalink();?>"><?php the_post_thumbnail('large'); ?></a>
|
||||
<?php } else {?>
|
||||
<a href="<?php the_permalink();?>"><img src="<?php bloginfo('template_url'); ?>/feature/index.php" /></a>
|
||||
<a href="<?php the_permalink();?>"><img src="<?php echo DEFAULT_FEATURE_IMAGE(); ?>" /></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
@ -16,7 +16,7 @@ if(has_post_thumbnail()){
|
||||
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large');
|
||||
$post_img = $large_image_url[0];
|
||||
}else{
|
||||
$post_img = get_bloginfo('template_url') . '/feature/index.php';
|
||||
$post_img = DEFAULT_FEATURE_IMAGE();
|
||||
}
|
||||
$the_cat = get_the_category();
|
||||
// 摘要字数限制
|
||||
|