fix toc of github-style

This commit is contained in:
spirit 2019-10-28 17:43:19 +08:00
parent 911ddefb3d
commit 55250f8e28
2 changed files with 3 additions and 2 deletions

View File

@ -60,6 +60,7 @@ mashiro_option.entry_content_theme_src = "<?php echo get_template_directory_uri(
<?php }elseif(akina_option('entry_content_theme') == "github") {?> <?php }elseif(akina_option('entry_content_theme') == "github") {?>
mashiro_option.entry_content_theme_src = "<?php echo get_template_directory_uri() ?>/cdn/theme/github.css?<?php echo SAKURA_VERSION.akina_option('cookie_version', ''); ?>"; mashiro_option.entry_content_theme_src = "<?php echo get_template_directory_uri() ?>/cdn/theme/github.css?<?php echo SAKURA_VERSION.akina_option('cookie_version', ''); ?>";
<?php } ?> <?php } ?>
mashiro_option.entry_content_theme = "<?php echo akina_option('entry_content_theme'); ?>";
<?php if(akina_option('jsdelivr_cdn_test')){ ?> <?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', ''); ?>"; mashiro_option.jsdelivr_css_src = "<?php echo get_template_directory_uri() ?>/cdn/css/lib.css?<?php echo SAKURA_VERSION.akina_option('cookie_version', ''); ?>";

View File

@ -547,7 +547,7 @@ function tableOfContentScroll(flag) {
} else { } else {
if (flag) { if (flag) {
var id = 1, var id = 1,
heading_fix=$("article").hasClass("type-post") ? $("div").hasClass("pattern-attachment-img") ? -75 : 200 : 375; heading_fix = mashiro_option.entry_content_theme == "sakura" ? $("article").hasClass("type-post") ? $("div").hasClass("pattern-attachment-img") ? -75 : 200 : 375 : window.innerHeight / 2;
$(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function() { $(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function() {
var hyphenated = "toc-head-" + id; var hyphenated = "toc-head-" + id;
this.id = hyphenated; this.id = hyphenated;