├── screenshot.png ├── assets ├── img │ ├── head.jpg │ ├── favicon.png │ ├── avatar │ │ ├── 0.png │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ └── 9.png │ ├── praise │ │ ├── radio_normal.jpg │ │ ├── radio_select.jpg │ │ ├── wechat_pay.svg │ │ └── ali_pay.svg │ └── 404.svg ├── fonts │ ├── sapphire-fonts.eot │ ├── sapphire-fonts.ttf │ └── sapphire-fonts.woff ├── css │ ├── theme.css │ ├── tag.css │ ├── pace-minimal.css │ ├── aside.css │ ├── footer.css │ ├── category.css │ ├── 404.css │ ├── article-nav.css │ ├── automenu.css │ ├── article-main.css │ ├── prettify.css │ ├── archive.css │ ├── tag-item.css │ ├── grid.css │ ├── article-praise.css │ ├── fonts.css │ ├── sidebar.css │ ├── social.css │ ├── comments.css │ ├── article-inner.css │ ├── header.css │ └── normalize.css └── js │ ├── clicklove.js │ ├── theme.js │ ├── automenu.js │ ├── pace.min.js │ └── prettify.js ├── .gitignore ├── style.css ├── inc ├── custom-configs │ ├── theme-colorcloud.php │ ├── theme-findpage.php │ ├── theme-headmenu.php │ ├── theme-comment.php │ ├── theme-functions.php │ ├── theme-post.php │ ├── wp-optimize.php │ ├── theme-setup.php │ ├── theme-options.php │ └── theme-about.php └── custom-pages │ ├── tag.php │ ├── category.php │ └── archive.php ├── functions.php ├── LICENSE ├── footer.php ├── 404.php ├── README.md ├── comments.php ├── index.php ├── header.php ├── sidebar.php └── single.php /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/screenshot.png -------------------------------------------------------------------------------- /assets/img/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/head.jpg -------------------------------------------------------------------------------- /assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/favicon.png -------------------------------------------------------------------------------- /assets/img/avatar/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/0.png -------------------------------------------------------------------------------- /assets/img/avatar/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/1.png -------------------------------------------------------------------------------- /assets/img/avatar/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/2.png -------------------------------------------------------------------------------- /assets/img/avatar/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/3.png -------------------------------------------------------------------------------- /assets/img/avatar/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/4.png -------------------------------------------------------------------------------- /assets/img/avatar/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/5.png -------------------------------------------------------------------------------- /assets/img/avatar/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/6.png -------------------------------------------------------------------------------- /assets/img/avatar/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/7.png -------------------------------------------------------------------------------- /assets/img/avatar/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/8.png -------------------------------------------------------------------------------- /assets/img/avatar/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/avatar/9.png -------------------------------------------------------------------------------- /assets/fonts/sapphire-fonts.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/fonts/sapphire-fonts.eot -------------------------------------------------------------------------------- /assets/fonts/sapphire-fonts.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/fonts/sapphire-fonts.ttf -------------------------------------------------------------------------------- /assets/fonts/sapphire-fonts.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/fonts/sapphire-fonts.woff -------------------------------------------------------------------------------- /assets/img/praise/radio_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/praise/radio_normal.jpg -------------------------------------------------------------------------------- /assets/img/praise/radio_select.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itcharge/WordPress-Theme-Sapphire/HEAD/assets/img/praise/radio_select.jpg -------------------------------------------------------------------------------- /assets/css/theme.css: -------------------------------------------------------------------------------- 1 | @import 'normalize.css'; 2 | @import 'grid.css'; 3 | @import 'header.css'; 4 | @import 'footer.css'; 5 | @import 'comments.css'; 6 | @import 'sidebar.css'; 7 | @import 'article-inner.css'; 8 | @import 'article-main.css'; 9 | @import 'article-nav.css'; 10 | @import 'article-praise.css'; 11 | @import 'tag-item.css'; 12 | @import 'aside.css'; 13 | @import 'archive.css'; 14 | @import 'category.css'; 15 | @import 'tag.css'; 16 | @import 'social.css'; 17 | @import '404.css'; -------------------------------------------------------------------------------- /assets/css/tag.css: -------------------------------------------------------------------------------- 1 | .tag-wrap { 2 | margin: 0px; 3 | padding: 0px; 4 | margin-bottom: 20px; 5 | position: relative; 6 | background: #fff; 7 | border: 1px solid #CFCFCF; 8 | box-shadow: 0 0 5px #C6C6C6; 9 | } 10 | 11 | .tag-wrap .tag-entry { 12 | margin: 20px 30px; 13 | padding: 0px; 14 | line-height: 2; 15 | } 16 | 17 | .tag-wrap .tag-entry a { 18 | margin: 20px 4px; 19 | text-decoration: none; 20 | } 21 | 22 | .tag-wrap .tag-entry a:hover { 23 | color: #ff7242!important; 24 | text-decoration: underline; 25 | } -------------------------------------------------------------------------------- /assets/css/pace-minimal.css: -------------------------------------------------------------------------------- 1 | /* This is a compiled file, you should be editing the file in the templates directory */ 2 | .pace { 3 | -webkit-pointer-events: none; 4 | pointer-events: none; 5 | 6 | -webkit-user-select: none; 7 | -moz-user-select: none; 8 | user-select: none; 9 | } 10 | 11 | .pace-inactive { 12 | display: none; 13 | } 14 | 15 | .pace .pace-progress { 16 | background: #2299dd; 17 | position: fixed; 18 | z-index: 2000; 19 | top: 0; 20 | right: 100%; 21 | width: 100%; 22 | height: 2px; 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore everything in the root except the "wp-content" directory. 2 | !wp-content/ 3 | 4 | # ignore everything in the "wp-content" directory, except: 5 | # "mu-plugins", "plugins", "themes" directory 6 | wp-content/* 7 | !wp-content/mu-plugins/ 8 | !wp-content/plugins/ 9 | !wp-content/themes/ 10 | 11 | # ignore these plugins 12 | wp-content/plugins/hello.php 13 | 14 | # ignore specific themes 15 | wp-content/themes/twenty*/ 16 | 17 | # ignore node dependency directories 18 | node_modules/ 19 | 20 | # ignore log files and databases 21 | *.log 22 | *.sql 23 | *.sqlite 24 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Sapphire 3 | Theme URI: https://itcharge.cn/WordPress-Sapphire.html 4 | Description: 程序员充电站 5 | Tags: blog, two-column, custom-background, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, block-patterns, block-styles, wide-blocks, accessibility-ready 6 | Author: ITCharge 7 | Author URI: https://itcharge.cn/ 8 | License: GNU General Public License version 3.0 9 | License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 | Text Domain: Sapphire 11 | */ 12 | -------------------------------------------------------------------------------- /assets/css/aside.css: -------------------------------------------------------------------------------- 1 | .wrap-side-operation { 2 | position: absolute; 3 | width: 60px; 4 | height: 60px; 5 | right: 30px; 6 | bottom: 100px; 7 | } 8 | 9 | #back-top { 10 | position: fixed; 11 | width: 45px; 12 | height: 45px; 13 | bottom: 100px; 14 | right: 30px; 15 | background: #fff; 16 | text-align: center; 17 | border-radius: 100%; 18 | border: .06em solid #e6ebf5; 19 | line-height: 45px; 20 | text-decoration: none; 21 | box-shadow: 0 0 1.5em 0 rgb(0 0 0 / 12%); 22 | } 23 | 24 | #back-top .icon-plane { 25 | color: #9c9c9c; 26 | font-size: 20px; 27 | margin: 12.5px; 28 | text-align: center; 29 | display: block; 30 | } -------------------------------------------------------------------------------- /assets/css/footer.css: -------------------------------------------------------------------------------- 1 | .site-footer .footer-info { 2 | font-size: 12px; 3 | font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace; 4 | max-width: 960px; 5 | position: relative; 6 | text-align: center; 7 | margin-left: auto; 8 | margin-right: auto; 9 | color: #A1A1A1; 10 | line-height: 24px; 11 | padding-top: 16px; 12 | padding-bottom: 14px; 13 | } 14 | 15 | .site-footer .footer-info a { 16 | color: #A1A1A1; 17 | } 18 | .site-footer .outer { 19 | padding: 0 30px; 20 | } 21 | 22 | .site-footer .footer-site-uv-pv { 23 | margin: 0px; 24 | } 25 | 26 | .site-footer .footer-copyright { 27 | margin: 0px; 28 | } -------------------------------------------------------------------------------- /inc/custom-configs/theme-colorcloud.php: -------------------------------------------------------------------------------- 1 | |i', 'colorCloudCallback', $text); 4 | return $text; 5 | } 6 | function rand_color() { 7 | $red = sprintf('%02X', mt_rand(0x2E, 0x34)); 8 | $green = sprintf('%02X', mt_rand(0x30, 0x49)); 9 | $blue = sprintf('%02X', mt_rand(0x32, 0x5e)); 10 | 11 | return '#'.$red.$green.$blue; 12 | } 13 | function colorCloudCallback($matches) { 14 | $text = $matches[1]; 15 | $color = rand_color(); 16 | $pattern = '/style=(\'|\")(.*)(\'|\")/i'; 17 | $text = preg_replace($pattern, "style=\"color:$color; $2;\"", $text); 18 | return ""; 19 | } 20 | add_filter('wp_tag_cloud', 'colorCloud', 1); 21 | ?> -------------------------------------------------------------------------------- /inc/custom-pages/tag.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 |
15 | 20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /inc/custom-configs/theme-findpage.php: -------------------------------------------------------------------------------- 1 | 9 | is_page = true; 16 | $wp_query->is_single = false; 17 | $wp_query->is_home = false; 18 | $wp_query->comments = false; 19 | // if we have a 404 status 20 | if ($wp_query->is_404) { 21 | // set status of 404 to false 22 | unset($wp_query->query["error"]); 23 | $wp_query->query_vars["error"] = ""; 24 | $wp_query->is_404 = false; 25 | } 26 | // change the header to 200 OK 27 | header("HTTP/1.1 200 OK"); 28 | //load our template 29 | include($template); 30 | exit; 31 | } 32 | /** 33 | * 自定义查找链接 34 | */ 35 | function template_redirect() { 36 | $basename = basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['QUERY_STRING']); 37 | load_custom_template(TEMPLATEPATH.'/inc/custom-pages/'."/$basename.php"); 38 | } 39 | add_action('template_redirect', 'template_redirect'); 40 | ?> -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 ITCharge 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /inc/custom-pages/category.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 |
14 |
15 |
16 | 21 |
22 |
    23 | 'count', 26 | 'order' => 'DESC', 27 | 'style' => 'list', 28 | 'title_li' => '', 29 | 'depth' => 2, 30 | 'show_count'=> 1, 31 | 'hide_empty'=> 1 32 | ); 33 | wp_list_categories($args); 34 | ?> 35 |
36 |
37 |
38 |
39 | 40 |
41 |
42 | 43 |
44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /assets/css/category.css: -------------------------------------------------------------------------------- 1 | .category-wrap { 2 | margin: 0px; 3 | padding: 0px; 4 | margin-bottom: 20px; 5 | position: relative; 6 | background: #fff; 7 | border: 1px solid #CFCFCF; 8 | box-shadow: 0 0 5px #C6C6C6; 9 | } 10 | 11 | .category-wrap .category-list { 12 | margin-top: 20px; 13 | margin-bottom: 20px; 14 | padding: 0px; 15 | } 16 | 17 | .category-wrap .category-list li { 18 | margin-left: 30px; 19 | margin-right: 30px; 20 | padding: 15px 0px 5px 0px; 21 | } 22 | 23 | .category-wrap .category-list li a { 24 | color: #333; 25 | text-decoration: none; 26 | } 27 | 28 | .category-wrap .category-list li a:before { 29 | content: ""; 30 | width: 7px; 31 | height: 7px; 32 | background-color: #333; 33 | border-radius: 50%; 34 | display: inline-block; 35 | margin: 10px 10px 0px 1px; 36 | float: left; 37 | } 38 | 39 | .category-wrap .category-list li:hover { 40 | background-color: #ebedef; 41 | color: #ff7242; 42 | } 43 | 44 | .category-wrap .category-list li:hover a { 45 | color: #ff7242; 46 | text-decoration: underline; 47 | } 48 | 49 | .category-wrap .category-list li:hover a:before { 50 | background-color: #ff7242; 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /assets/css/404.css: -------------------------------------------------------------------------------- 1 | .site-404-box { 2 | display: flex; 3 | justify-content: center; 4 | margin-top: 180px; 5 | text-align: center; 6 | } 7 | 8 | .site-404-text { 9 | align-items: flex-start; 10 | display: flex; 11 | flex-direction: column; 12 | justify-content: center; 13 | min-width: 384px; 14 | } 15 | 16 | .site-404-title { 17 | font-size: 40px; 18 | font-weight: 600; 19 | color: #666666; 20 | line-height: 1.4; 21 | margin: 0; 22 | } 23 | 24 | .site-404-subtitle { 25 | font-size: 18px; 26 | color: #666666; 27 | line-height: 1.4; 28 | margin: 10px 0 0; 29 | } 30 | 31 | .site-404-gohome { 32 | margin-top: 20px; 33 | display: inline-block; 34 | text-align: center; 35 | color: #fff; 36 | font-size: 14px; 37 | line-height: 32px; 38 | 39 | text-decoration: none; 40 | background: none; 41 | background-color: #4D4D4D; 42 | border-radius: 3px; 43 | border-color: #4D4D4D; 44 | padding: 0 16px; 45 | } 46 | 47 | .site-404-goup { 48 | margin-top: 20px; 49 | display: flex; 50 | background: none; 51 | align-items: center; 52 | color: #0084ff; 53 | font-size: 14px; 54 | font-weight: 600; 55 | text-decoration: none; 56 | } 57 | 58 | .site-404-image-container { 59 | align-items: center; 60 | display: flex; 61 | height: 300px; 62 | width: 300px; 63 | justify-content: center; 64 | margin-top: 20px; 65 | margin-left: 20px; 66 | } 67 | 68 | .site-404-image { 69 | width: 250px; 70 | height: 250px; 71 | } -------------------------------------------------------------------------------- /assets/js/clicklove.js: -------------------------------------------------------------------------------- 1 | !function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e 15 | 16 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /inc/custom-configs/theme-headmenu.php: -------------------------------------------------------------------------------- 1 | 9 | esc_html__( 'Primary Menu', 'sapphire' ), 16 | ) ); 17 | } 18 | add_action( 'after_setup_theme', 'sapphire_setup' ); 19 | 20 | /** 21 | * 默认菜单栏. 22 | */ 23 | function sapphire_primary_menu_fb() { 24 | ?> 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /assets/css/article-nav.css: -------------------------------------------------------------------------------- 1 | #page-nav { 2 | text-align: center; 3 | margin-top: 20px; 4 | } 5 | 6 | #page-nav .page-number { 7 | padding: 0 8px; 8 | height: 25px; 9 | background: #4d4d4d; 10 | display: inline-block; 11 | color: #fff; 12 | line-height: 25px; 13 | font-size: 14px; 14 | margin: 0 5px 20px; 15 | border-radius: 2px; 16 | text-decoration: none; 17 | opacity: 1; 18 | } 19 | 20 | #page-nav .page-number:hover { 21 | background: #4d4d4d; 22 | opacity: 0.8; 23 | } 24 | 25 | #page-nav .current { 26 | background: #88acdb; 27 | cursor: default; 28 | } 29 | 30 | #page-nav .current:hover { 31 | background: #e8e8e8; 32 | color:#666; 33 | } 34 | 35 | #page-nav .extend { 36 | padding: 0 10px; 37 | height: 25px; 38 | background: #4d4d4d; 39 | display: inline-block; 40 | color: #fff; 41 | line-height: 25px; 42 | font-size: 16px; 43 | margin: 0 5px 20px; 44 | border-radius: 2px; 45 | text-decoration: none; 46 | } 47 | 48 | #page-nav .extend:hover { 49 | background: #5e5e5e; 50 | } 51 | #page-nav:hover .extend { 52 | opacity: 1; 53 | } 54 | 55 | 56 | .article-nav { 57 | margin: 0 0 20px 0; 58 | padding: 0 32px 10px; 59 | min-height: 30px; 60 | } 61 | .article-nav .article-nav-link-wrap { 62 | font-size: 14px; 63 | } 64 | #article-nav .article-nav-link-wrap .article-nav-title { 65 | display: inline-block; 66 | font-size: 16px; 67 | transition: color 0.3s; 68 | } 69 | #article-nav .article-nav-link-wrap:hover i { 70 | color: #4d4d4d; 71 | } 72 | #article-nav .article-nav-link-wrap:hover .article-nav-title { 73 | color: #4d4d4d; 74 | } 75 | #article-nav #article-nav-older { 76 | float: right; 77 | } -------------------------------------------------------------------------------- /assets/css/automenu.css: -------------------------------------------------------------------------------- 1 | /*-------main---------*/ 2 | .autoMenu { 3 | line-height: 1.3; 4 | font-size: 14px; 5 | position: relative; 6 | margin: 0px; 7 | padding: 0px; 8 | z-index: 1; 9 | text-align: left; 10 | } 11 | .autoMenu ul { 12 | line-height: 1.3; 13 | list-style-type: none; 14 | overflow-y: auto; 15 | padding: 0px 16px 0px 30px; 16 | } 17 | 18 | .autoMenu ul:before { 19 | position: absolute; 20 | content: ""; 21 | top: 14px; 22 | left: 33px; 23 | bottom: 14px; 24 | width: 2px; 25 | background-color: #ebedef; 26 | z-index: -1; 27 | } 28 | 29 | .autoMenu a:before { 30 | content: ""; 31 | width: 7px; 32 | height: 7px; 33 | background-color: #333; 34 | border-radius: 50%; 35 | display: inline-block; 36 | z-index: 100; 37 | margin: 5px 10px 0px 1px; 38 | float: left; 39 | } 40 | 41 | .autoMenu ul li.active { 42 | color: #ff7242; 43 | background-color: #ebedef; 44 | } 45 | 46 | .autoMenu li:hover { 47 | background-color: #ebedef; 48 | } 49 | 50 | .autoMenu a { 51 | text-decoration: none; 52 | font-size: 14px; 53 | } 54 | 55 | .autoMenu a:hover { 56 | text-decoration: none; 57 | } 58 | 59 | .autoMenu a:focus { 60 | outline:none; 61 | } 62 | .autoMenu ul>li.toc-heading { 63 | font-weight: bold; 64 | padding-top: 4px; 65 | padding-bottom: 4px; 66 | margin-top: 6px; 67 | margin-bottom: 6px; 68 | } 69 | .autoMenu ul>li.toc-heading-sub { 70 | padding-left: 30px; 71 | padding-top: 4px; 72 | padding-bottom: 4px; 73 | } 74 | .autoMenu ul>li>a { 75 | color: #333; 76 | } 77 | .autoMenu ul li.active>a { 78 | color: #ff7242; 79 | background-color: #ebedef; 80 | } 81 | 82 | .autoMenu ul li.active>a::before { 83 | background-color: #ff7242; 84 | } -------------------------------------------------------------------------------- /assets/css/article-main.css: -------------------------------------------------------------------------------- 1 | /*------------------------------ 2 | banner 3 | ------------------------------*/ 4 | .banner-box { 5 | margin: 0px; 6 | padding: 0px; 7 | margin-bottom: 20px; 8 | position: relative; 9 | background: #fff; 10 | border: 1px solid #CFCFCF; 11 | box-shadow: 0 0 5px #C6C6C6; 12 | } 13 | .banner-header { 14 | border-left: 5px solid #4d4d4d; 15 | padding: 20px 0px 15px 25px; 16 | } 17 | 18 | .banner-title { 19 | color: #333; 20 | font-size: 18px; 21 | font-weight: 400; 22 | margin: 0px; 23 | } 24 | 25 | 26 | /*------------------------------ 27 | article 28 | ------------------------------*/ 29 | .article { 30 | margin-bottom: 20px; 31 | position: relative; 32 | background: #fff; 33 | -webkit-transition: all 0.2s ease-in; 34 | } 35 | 36 | .article img { 37 | max-width: 100%; 38 | } 39 | 40 | .article .article-type-post { 41 | margin-bottom: 0px; 42 | } 43 | 44 | 45 | 46 | .article-more-link { 47 | margin-top: 0; 48 | margin-bottom: 0; 49 | text-align: left; 50 | float: right; 51 | } 52 | 53 | .article-more-link a { 54 | background: #4d4d4d; 55 | color: #fff; 56 | font-size: 12px; 57 | padding: 5px 8px 5px; 58 | line-height: 16px; 59 | white-space: nowrap; 60 | -webkit-border-radius: 2px; 61 | -moz-border-radius: 2px; 62 | border-radius: 2px; 63 | transition: background 0.3s; 64 | opacity: 1; 65 | text-decoration: none; 66 | } 67 | 68 | .article-more-link a:hover { 69 | background: #4d4d4d; 70 | opacity: 0.8; 71 | } 72 | 73 | .article-more-link a.hidden { 74 | visibility: hidden; 75 | } 76 | 77 | .article-info-index { 78 | padding-top: 20px; 79 | padding-bottom: 20px; 80 | margin: 0px 30px 0 30px; 81 | border-top: 1px solid #ddd; 82 | } 83 | 84 | .clearfix { 85 | *zoom: 1; 86 | } 87 | 88 | .clearfix:after { 89 | content: ""; 90 | display: table; 91 | clear: both; 92 | } 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /assets/img/praise/wechat_pay.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/img/praise/ali_pay.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/css/prettify.css: -------------------------------------------------------------------------------- 1 | /*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */ 2 | .prettyprint { 3 | background-color: rgba(0,0,0,0.03); 4 | border: 1px solid #f0f0f0; 5 | font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace; 6 | overflow: auto; 7 | } 8 | 9 | .pln { 10 | color: #333; 11 | } 12 | 13 | /* Specify class=linenums on a pre to get line numbering */ 14 | ol.linenums { 15 | margin-top: 0; 16 | margin-bottom: 0; 17 | color: rgba(0,0,0,0.3); 18 | } 19 | 20 | li.L0, 21 | li.L1, 22 | li.L2, 23 | li.L3, 24 | li.L4, 25 | li.L5, 26 | li.L6, 27 | li.L7, 28 | li.L8, 29 | li.L9 { 30 | padding-left: 1em; 31 | list-style-type: decimal; 32 | } 33 | 34 | @media screen { 35 | 36 | /* string content */ 37 | 38 | .str { 39 | color: #d14; 40 | } 41 | 42 | /* keyword */ 43 | 44 | .kwd { 45 | color: #333; 46 | } 47 | 48 | /* comment */ 49 | 50 | .com { 51 | color: #998; 52 | } 53 | 54 | /* type name */ 55 | 56 | .typ { 57 | color: #458; 58 | } 59 | 60 | /* literal value */ 61 | 62 | .lit { 63 | color: #458; 64 | } 65 | 66 | /* punctuation */ 67 | 68 | .pun { 69 | color: #333; 70 | } 71 | 72 | /* lisp open bracket */ 73 | 74 | .opn { 75 | color: #333; 76 | } 77 | 78 | /* lisp close bracket */ 79 | 80 | .clo { 81 | color: #333; 82 | } 83 | 84 | /* markup tag name */ 85 | 86 | .tag { 87 | color: #000080; 88 | } 89 | 90 | /* markup attribute name */ 91 | 92 | .atn { 93 | color: #008080; 94 | } 95 | 96 | /* markup attribute value */ 97 | 98 | .atv { 99 | color: #d14; 100 | } 101 | 102 | /* declaration */ 103 | 104 | .dec { 105 | color: #333; 106 | } 107 | 108 | /* variable name */ 109 | 110 | .var { 111 | color: #008080; 112 | } 113 | 114 | /* function name */ 115 | 116 | .fun { 117 | color: #900; 118 | } 119 | } -------------------------------------------------------------------------------- /assets/js/theme.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Initialise Menu Toggle 3 | */ 4 | ( function() { 5 | jQuery('.sapphire-menu li.menu-item-has-children').each( function() { 6 | jQuery(this).prepend(''); 7 | }); 8 | 9 | jQuery('#nav-toggle').on('click', function(event) { 10 | event.preventDefault(); 11 | jQuery('#nav-toggle').toggleClass('nav-is-visible'); 12 | jQuery('.main-navigation .sapphire-menu').toggleClass("sapphire-menu-mobile"); 13 | jQuery('.header-widget').toggleClass("header-widget-mobile"); 14 | }); 15 | 16 | jQuery('.nav-toggle-subarrow, .nav-toggle-subarrow .nav-toggle-subarrow').click( 17 | function () { 18 | jQuery(this).parent().toggleClass("nav-toggle-dropdown"); 19 | } 20 | ); 21 | } )(); 22 | 23 | 24 | /** 25 | * 滚动到顶部工具 26 | */ 27 | ( function () { 28 | var offset = 300, duration = 500, backButton = jQuery('#back-top'); 29 | var tocTop = jQuery("#side-box-article-toc").offset().top; 30 | var tocHeight = jQuery("#side-box-article-toc").height; 31 | var docHeight = jQuery(document).height; 32 | var footHeight = jQuery("#site-footer").height; 33 | 34 | // 当滚动条的垂直位置距顶部 300 像素一下时,跳转链接出现,否则消失 35 | jQuery(window).scroll(function () { 36 | var scrollTop = jQuery(window).scrollTop(); 37 | if (scrollTop > offset) { 38 | backButton.fadeIn(duration); 39 | } else { 40 | backButton.fadeOut(duration); 41 | } 42 | 43 | if (scrollTop >= tocTop) { 44 | if (scrollTop + tocHeight + footHeight + 40 <= docHeight) { 45 | jQuery("#side-box-article-toc").css({"position":"fixed"}); 46 | jQuery("#side-box-article-toc").animate({"top":'20px'}, duration); 47 | } else { 48 | console.log(jQuery(window).scrollTop()); 49 | jQuery("#side-box-article-toc").css({"position":"fixed"}); 50 | jQuery("#side-box-article-toc").animate({"top":"", "bottom":'20px'}, duration); 51 | } 52 | } else { 53 | jQuery("#side-box-article-toc").css({"position":"static", "top":"0"}); 54 | } 55 | }); 56 | 57 | jQuery('#back-top').click(function () { 58 | jQuery("html,body").animate({ 59 | scrollTop: 0 60 | }, speed); 61 | }); 62 | } )(); -------------------------------------------------------------------------------- /inc/custom-pages/archive.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 |
15 | 20 | 'DESC', 24 | 'orderby' => 'date', 25 | 'posts_per_page' => -1 26 | ); 27 | 28 | // 调用 WP_Query 新建文章查询. 29 | $the_query = new WP_Query( $args ); 30 | $last = 0000; 31 | ?> 32 | have_posts()) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> 33 |
'; 38 | } else { 39 | echo '
'; 40 | echo '
'; 41 | } 42 | $last = $year; 43 | } 44 | ?> 45 | 60 | 61 |
62 | 63 |
64 |
65 | 66 |
67 |
68 | 69 | -------------------------------------------------------------------------------- /404.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | > 13 | 14 | 15 | 16 | 17 | 404 - <?php bloginfo('name'); ?> 18 | 19 | 20 | 21 | 22 | > 23 | 24 | 46 |
47 |
48 |
49 |

404

50 |

从前有个页面,现在他走丢了 ~

51 | 去往首页 52 | 55 |
56 |
57 | page error 58 |
59 |
60 |
61 | 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordPress-Theme-Sapphire 2 | > 基于 WordPress 开发的双栏博客主题 Sapphire 3 | 4 | ![](./screenshot.png) 5 | 6 | 7 | ## 1. 环境要求 8 | 9 | | 主题名称 | Sapphire | 最新版本 | v1.0 | 10 | | ---------- | ------------------------------- | ---------- | ------------------------------------------------------------ | 11 | | 环境要求 | Wordpress 5.8+,PHP 5.6+ | 服务器支持 | Linux / Windows / Mac | 12 | | 浏览器支持 | 主流浏览器(除 IE 外) | 页面模板 | 归档页面、分类页面、标签页面 | 13 | | 演示地址 | [点击查看](https://itcharge.cn) | 下载地址 | [点击跳转下载链接](https://github.com/itcharge/WordPress-Theme-Sapphire/releases) | 14 | 15 | ## 2. 主题简介 16 | 17 | **Sapphire** 是一款简约好用的双栏 Wordpress 主题,适用于个人博客类网站使用。在设计上遵循着 **「简约至上」** 的设计原则,在保证网站功能完整、内容清楚的前提下,做到尽可能的简单。 18 | 19 | Sapphire 主题界面简洁大气,外表简洁而不简单,内置归档、分类、标签模板页面,还有最新文章、热门标签等多功能边栏面板。网站采用响应式设计,完美支持手机、平板和电脑浏览。Sapphire 主题采用了纯代码级的 SEO 优化,可以让你的网站推广事半功倍。本主题内置主题设置页面,支持自定义网站效果,小白站长也能轻松的创建自己的网站。 20 | 21 | ## 3. 主题特色 22 | 23 | - 响应式设计:完美兼容手机、平板、电脑等各类设备访问。 24 | - 简洁大气:界面简洁大气,首页支持自定义展现方式。 25 | - SEO 支持:纯代码级优化,文章关键词自动内链。 26 | - 主题后台设置:支持后台自定义选项设置,小白也能轻松建站。 27 | - 文章页面支持代码高亮、支持 LaTex 数学公式。 28 | 29 | ## 4. 所有功能 30 | 31 | - 响应式设置:兼容手机、平板、电脑等各类设备访问。 32 | - 网站图标设置:favicion 图标、顶部 Logo、边栏 Logo。 33 | - 页面模板支持:增加归档、分类、标签等页面模板。 34 | - 页面效果优化:页面点击小红心效果、加载进度条显示。 35 | - 网站底部自定义:网站成立年份、备案号。 36 | - 网站访问数统计:总访问量统计、总访客数统计。 37 | - 边栏自定义显示:最新文章、热门标签、联系方式、文章页目录显示。 38 | - SEO 优化:标题连接符号设置、网站关键词设置、网站面熟设置、文章关键词自动内链。 39 | - 文章效果显示优化:代码高亮、LaTex 公式、阅读时长、字数统计、文章目录自动生成、目录跟随功能。 40 | - 文章页底部增加赞赏功能:支持微信、支付宝。 41 | - 文章页底部增加版权说明:原文作者、原文地址、版权协议、版权链接。 42 | - 联系方式自定义:支持微博、知乎、CSDN 等多个社交方式设置。 43 | 44 | ## 5. 更新记录 45 | 46 | ###### 1. V1.0 2021-07-30(最新版本) 47 | 48 | - 实现主题的基本功能,包含页面搭建、基本设置、主题设置。 49 | - 支持归档、分类、标签页面显示。 50 | - 网站自定义备案信息、访问数统计。 51 | - 页面效果优化、边栏自定义、联系方式自定义。 52 | - 响应式设置:兼容手机、平板、电脑等各类设备访问。 53 | - 文章显示效果优化、底部赞赏功能、版权说明。 54 | 55 | ## 6. 关于主题 56 | 57 | > 特别说明: 58 | > 59 | > 本主题在部分界面设计上参考了:[hexo-theme-yilia](https://github.com/litten/hexo-theme-yilia)。除此之外还借鉴了 [mkBlog](https://mkblog.cn/theme-mkblog/)、[Simple](https://www.topicnote.com/1621.html)、[OnePress](https://cn.wordpress.org/themes/onepress/)、[Dashscroll](https://wordpress.org/themes/dashscroll/) 等优秀主题的设计理念。 60 | > 61 | > 主题中使用了[jQuery](https://jquery.com/)、 [Google Code Prettify](https://github.com/googlearchive/code-prettify)、[Normalize.css](https://necolas.github.io/normalize.css/)、[PACE](https://codebyzach.github.io/pace/)、[blogMenu](https://github.com/cry101/blogMenu)、[MathJax](https://www.mathjax.org/) 等第三方插件。 62 | -------------------------------------------------------------------------------- /assets/css/archive.css: -------------------------------------------------------------------------------- 1 | .archive-wrap { 2 | position: relative; 3 | border: 1px solid #CFCFCF; 4 | box-shadow: 0 0 5px #C6C6C6; 5 | background: #fff; 6 | margin-bottom: 20px; 7 | } 8 | 9 | .archive-wrap .archive-year-wrap { 10 | line-height: 35px; 11 | width: 200px; 12 | border-left: ; 13 | position: relative; 14 | border-left: 5px solid #4d4d4d; 15 | padding-top: 15px; 16 | font-size: 1.8em; 17 | z-index: 1; 18 | } 19 | 20 | .archive-wrap .archive-year-wrap .archive-year { 21 | color: #666; 22 | font-weight: bold; 23 | padding-left: 25px; 24 | text-decoration: none; 25 | } 26 | 27 | .archive-articles { 28 | margin-top: 20px; 29 | } 30 | 31 | .archive-article { 32 | margin-left: 25px; 33 | border-top: 1px solid #eee; 34 | position: relative; 35 | } 36 | 37 | .archive-type-post { 38 | position:relative; 39 | } 40 | 41 | .archive-article-header { 42 | width: 500px; 43 | } 44 | 45 | 46 | .archive-article-title { 47 | font-size: 16px; 48 | color: #333; 49 | transition: color 0.3s; 50 | } 51 | 52 | .archive-article-title .article-title-url { 53 | color: #17181a; 54 | margin-left: 0px; 55 | font-weight: 300; 56 | line-height: 35px; 57 | font-size: 18px; 58 | -webkit-transition: color 0.3s; 59 | -moz-transition: color 0.3s; 60 | -o-transition: color 0.3s; 61 | transition: color 0.3s; 62 | text-decoration: none; 63 | } 64 | 65 | .archive-article-title .article-title-url:hover { 66 | color: #ff7242; 67 | text-decoration:underline; 68 | } 69 | 70 | .archive-article-header .icon-clock { 71 | margin-right: 5px; 72 | } 73 | 74 | .archive-article-header .archive-article-date { 75 | position: absolute; 76 | right: 0; 77 | top: 17px; 78 | width: 12rem; 79 | padding-right: 1.2rem; 80 | font-size: 14px; 81 | text-align: right; 82 | z-index: 1; 83 | } 84 | 85 | .archive-article-header .archive-article-date time { 86 | color: #aaa; 87 | float: right; 88 | } 89 | 90 | 91 | /*归档页:分类、标签*/ 92 | 93 | .archive-article-inner .article-category:before { 94 | float: left; 95 | margin-top: 1px; 96 | left: 15px; 97 | } 98 | 99 | .archive-article-inner .article-category .article-category-link { 100 | width: auto; 101 | max-width: 83px; 102 | padding-left: 10px; 103 | } 104 | 105 | .archive-article-inner .article-tag-list { 106 | margin-top: 0px; 107 | } 108 | 109 | .archive-article-inner .article-tag-list:before { 110 | left: 15px; 111 | } 112 | 113 | .archive-article-inner .article-tag-list .article-tag-list-item { 114 | display: inline-block; 115 | width: auto; 116 | max-width: 83px; 117 | padding-left: 8px; 118 | font-size: 12px; 119 | } 120 | 121 | .article-read-count { 122 | color: #999; 123 | height: 20px; 124 | } 125 | 126 | .read-count { 127 | line-height: 20px; 128 | } 129 | 130 | .read-count .icon { 131 | margin-right: 10px; 132 | margin-top: 0px; 133 | } 134 | -------------------------------------------------------------------------------- /inc/custom-configs/theme-comment.php: -------------------------------------------------------------------------------- 1 | user_email; // 用户邮箱 14 | $alt = $user->user_nicename; // 用户昵称 15 | $random = string_covert_hashnum($alt); 16 | } else { 17 | $random = rand(1, 10); 18 | } 19 | 20 | $avatar = ''.get_template_directory_uri().'/assets/img/avatar/'. $random .'.png'; 21 | $avatar = "{$alt}"; 22 | return $avatar; 23 | } 24 | 25 | function sa_theme_is_administrator($user_id) { 26 | $user = get_userdata($user_id); 27 | if( !empty($user->roles) && in_array('administrator', $user->roles) ) { 28 | return true; // 是管理员 29 | } else { 30 | return false; // 非管理员 31 | } 32 | } 33 | 34 | 35 | function string_covert_hashnum($user_id) { 36 | $range = 9; 37 | $hashslot = bcmod(base_convert(md5($user_id), 16, 10), $range); 38 | return $hashslot + 1; 39 | } 40 | 41 | function sa_theme_comment($comment, $args, $depth) { 42 | $GLOBALS['comment'] = $comment; 43 | $author = get_comment_author(); 44 | ?> 45 |
  • 46 |
    47 |
    48 | user_id)) { 51 | $sa_sidebar_logo = sa_theme_option('sa_sidebar_logo'); 52 | echo ''.$author.''; 53 | } else { 54 | echo get_avatar($comment->user_id, 48); 55 | } 56 | } 57 | ?> 58 |
    59 |
    60 | '; 62 | echo ''.$author.''; 63 | if ( sa_theme_is_administrator($comment->user_id) ) { 64 | echo '站长'; 65 | } 66 | echo '

    '; 67 | 68 | if ($comment->comment_approved == '0') { 69 | echo '评论等待审核...
    '; 70 | } 71 | comment_text(); 72 | ?> 73 |
    74 |
    75 | 83 | -------------------------------------------------------------------------------- /assets/css/tag-item.css: -------------------------------------------------------------------------------- 1 | /* 置顶 */ 2 | .article-pop-out { 3 | float: left; 4 | } 5 | 6 | .article-pop-out .icon-tuding { 7 | color: #999; 8 | float: left; 9 | margin-right: 10px; 10 | margin-top: 8px; 11 | } 12 | 13 | .article-pop-out { 14 | float: left; 15 | } 16 | 17 | /* 标签 / 分类 */ 18 | .article-cat-tag { 19 | float: left; 20 | } 21 | 22 | .article-cat-tag .icon { 23 | color: #999; 24 | float: left; 25 | margin-right: 10px; 26 | margin-top: 8px; 27 | } 28 | 29 | .tagcloud a { 30 | display:inline-block; 31 | text-decoration:none; 32 | font-weight: normal; 33 | font-size:10px; 34 | color:#fff; 35 | height:20px; 36 | line-height:20px; 37 | float: left; 38 | padding:0 8px 0px 10px; 39 | position:relative; 40 | border-radius:0 5px 5px 0; 41 | margin: 5px 9px 5px 8px; 42 | opacity: 1; 43 | } 44 | 45 | .tagcloud a:hover { 46 | opacity: 0.8; 47 | } 48 | 49 | .tagcloud a:before { 50 | content: " "; 51 | width: 0px; 52 | height: 0px; 53 | position: absolute; 54 | top: 0; 55 | left: -20px; 56 | border: 10px solid transparent; 57 | } 58 | 59 | .tagcloud a:after { 60 | content: " "; 61 | width: 4px; 62 | height: 4px; 63 | background-color: #fff; 64 | border-radius: 4px; 65 | box-shadow: 0px 0px 0px 1px rgba(0,0,0,.3); 66 | position: absolute; 67 | top: 8px; 68 | left: 2px; 69 | } 70 | 71 | .tagcloud a.color0 { 72 | background: #f08080; 73 | } 74 | 75 | .tagcloud a.color0:before { 76 | border-right-color: #f08080; 77 | } 78 | 79 | .tagcloud a.color1 { 80 | background: #88acdb; 81 | } 82 | 83 | .tagcloud a.color1:before { 84 | border-right-color: #88acdb; 85 | } 86 | 87 | .tagcloud a.color2 { 88 | background: #ffa07a; 89 | } 90 | 91 | .tagcloud a.color2:before { 92 | border-right-color: #ffa07a; 93 | } 94 | 95 | .tagcloud a.color3 { 96 | background: #76becc; 97 | } 98 | 99 | .tagcloud a.color3:before { 100 | border-right-color: #76becc; 101 | } 102 | 103 | .tagcloud a.color4 { 104 | background: #918597; 105 | } 106 | 107 | .tagcloud a.color4:before { 108 | border-right-color: #918597; 109 | } 110 | 111 | .tagcloud a.color5 { 112 | background: #6fc0e4; 113 | } 114 | 115 | .tagcloud a.color5:before { 116 | border-right-color:#6fc0e4; 117 | } 118 | 119 | .tagcloud a.color6 { 120 | background: #bc8f8f; 121 | } 122 | 123 | .tagcloud a.color6:before { 124 | border-right-color: #bc8f8f; 125 | } 126 | 127 | .tagcloud a.color7 { 128 | background: #2ec4b6; 129 | } 130 | 131 | .tagcloud a.color7:before { 132 | border-right-color: #2ec4b6; 133 | } 134 | 135 | .tagcloud a.color8 { 136 | background: #5c677d; 137 | } 138 | 139 | .tagcloud a.color8:before { 140 | border-right-color: #5c677d; 141 | } 142 | 143 | .tagcloud a.color9 { 144 | background: #8d99ae; 145 | } 146 | 147 | .tagcloud a.color9:before { 148 | border-right-color: #8d99ae; 149 | } 150 | 151 | .tagcloud a.color10 { 152 | background: #8cb369; 153 | } 154 | 155 | .tagcloud a.color10:before { 156 | border-right-color: #8cb369; 157 | } 158 | 159 | 160 | .cat-tag-list { 161 | float: left; 162 | padding: 0; 163 | margin: 0; 164 | } 165 | 166 | .cat-tag-list .cat-tag-list-item { 167 | float: left; 168 | } 169 | 170 | -------------------------------------------------------------------------------- /inc/custom-configs/theme-functions.php: -------------------------------------------------------------------------------- 1 | 9 | 44 | 60 | 62 | 68 | '; 71 | // wp_enqueue_script( 'sapphire-mathjax-js', 'https://cdn.bootcdn.net/ajax/libs/mathjax/2.7.9/config/TeX-AMS-MML_HTMLorMML.min.js'); 72 | } 73 | 74 | $sa_sidebar_post_toc = sa_theme_option('sa_sidebar_post_toc'); 75 | if ($sa_sidebar_post_toc && $sa_sidebar_post_toc == 'open') { 76 | // 目录模块 77 | wp_enqueue_style( 'sapphire-automenu-css', get_template_directory_uri() . '/assets/css/automenu.css' ); 78 | wp_enqueue_script( 'sapphire-automenu-js', get_template_directory_uri() . '/assets/js/automenu.js' ); 79 | } 80 | } 81 | add_action( 'wp_enqueue_scripts', 'sapphire_scripts' ); 82 | ?> -------------------------------------------------------------------------------- /comments.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 18 | 19 |
    20 | 21 | 22 |
    23 |

    评论(

    24 |
    25 | 26 | 27 |
    28 |
      29 | 'ol', 32 | 'short_ping' => true, 33 | 'avater_size' => 48, 34 | 'type' => 'comment', 35 | 'callback' => 'sa_theme_comment', 36 | ); 37 | wp_list_comments($args); 38 | ?> 39 |
    40 |
    41 | 42 | 1 && get_option('page_comments')) : ?> 43 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |

    您必须 [登录] 才能发表评论.

    54 |
    55 | 56 |
    57 |
    58 | 59 | 60 |

    身份登录 | 注销 »

    61 | 62 | 63 | 64 | 65 |
    66 | 67 | 68 |
    69 | 70 |
    71 |
    72 | 73 |
    74 |
    75 | 76 | 77 |
    78 |
    -------------------------------------------------------------------------------- /assets/css/grid.css: -------------------------------------------------------------------------------- 1 | body, button, input, select, textarea { 2 | color: #1a1a1a; 3 | font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; 4 | font-size: 16px; 5 | font-size: 1rem; 6 | line-height: 1.75; 7 | } 8 | body { 9 | background: #eaeaea; 10 | min-height: 100%; 11 | } 12 | html { 13 | -ms-text-size-adjust: 100%; 14 | -webkit-text-size-adjust: 100%; 15 | } 16 | html, body { 17 | height: auto; 18 | overflow-x: hidden; 19 | overflow-y: auto; 20 | } 21 | 22 | #mobile-nav { 23 | display: none; 24 | } 25 | 26 | @-webkit-keyframes cd-bounce-1 { 27 | 0% { 28 | opacity: 0; 29 | -webkit-transform: scale(1); 30 | } 31 | 60% { 32 | opacity: 1; 33 | -webkit-transform: scale(1.01); 34 | } 35 | 100% { 36 | -webkit-transform: scale(1); 37 | } 38 | } 39 | @-moz-keyframes cd-bounce-1 { 40 | 0% { 41 | opacity: 0; 42 | -moz-transform: scale(1); 43 | } 44 | 60% { 45 | opacity: 1; 46 | -moz-transform: scale(1.01); 47 | } 48 | 100% { 49 | -moz-transform: scale(1); 50 | } 51 | } 52 | @keyframes cd-bounce-1 { 53 | 0% { 54 | opacity: 0; 55 | -webkit-transform: scale(1); 56 | -moz-transform: scale(1); 57 | -ms-transform: scale(1); 58 | -o-transform: scale(1); 59 | transform: scale(1); 60 | } 61 | 60% { 62 | opacity: 1; 63 | -webkit-transform: scale(1.01); 64 | -moz-transform: scale(1.01); 65 | -ms-transform: scale(1.01); 66 | -o-transform: scale(1.01); 67 | transform: scale(1.01); 68 | } 69 | 100% { 70 | -webkit-transform: scale(1); 71 | -moz-transform: scale(1); 72 | -ms-transform: scale(1); 73 | -o-transform: scale(1); 74 | transform: scale(1); 75 | } 76 | } 77 | 78 | /*------------------------------ 79 | Content 80 | ------------------------------*/ 81 | .site-content { 82 | margin: 0px auto 0px; 83 | padding: 0px; 84 | clear: both; 85 | width: 1000px; 86 | max-width: 1000px; 87 | min-height: 100%; 88 | display: block; 89 | position: relative; 90 | } 91 | 92 | .site-content.no-border { 93 | border-top: none; 94 | } 95 | 96 | /*---------------------- 97 | header 98 | ----------------------*/ 99 | .site-header { 100 | line-height: 75px; 101 | position: relative; 102 | width: 100%; 103 | background: #fff; 104 | border-bottom: 1px solid #DDDDDD; 105 | } 106 | 107 | /*---------------------- 108 | left-box 109 | ----------------------*/ 110 | #left-box { 111 | float: left; 112 | width: 640px; 113 | margin: 20px 20px 0px 20px; 114 | padding: 0px; 115 | } 116 | 117 | /*---------------------- 118 | right-box 119 | ----------------------*/ 120 | #right-box { 121 | float: left; 122 | width: 300px; 123 | margin: 20px 20px 0px 0px; 124 | } 125 | 126 | /*---------------------- 127 | comments 128 | ----------------------*/ 129 | .comments-box { 130 | background-color: #FFFFFF; 131 | border: 1px solid #CFCFCF; 132 | box-shadow: 0 0 5px #C6C6C6; 133 | margin-bottom: 20px; 134 | } 135 | 136 | /*---------------------- 137 | footer 138 | ----------------------*/ 139 | .site-footer { 140 | margin: 0; 141 | padding: 0; 142 | position: relative; 143 | width: 100%; 144 | background-color: #FFFFFF; 145 | border-top: 1px solid #DDDDDD; 146 | } 147 | 148 | /*---------------------- 149 | 屏幕适配 150 | ----------------------*/ 151 | @media screen and (max-width: 1000px) { 152 | .site-content { 153 | width: 100%; 154 | } 155 | #left-box { 156 | width: calc(100% - 360px); 157 | } 158 | } 159 | 160 | @media screen and (max-width: 640px) { 161 | .site-content { 162 | width: 100%; 163 | } 164 | #left-box { 165 | width: calc(100% - 40px); 166 | } 167 | #right-box { 168 | display: none; 169 | } 170 | } -------------------------------------------------------------------------------- /assets/css/article-praise.css: -------------------------------------------------------------------------------- 1 | /* 赞赏按钮 */ 2 | .article-praise { 3 | margin: 0px 0px 30px 0px; 4 | text-align: center; 5 | } 6 | 7 | .article-praise .article-praise-btn { 8 | position: relative; 9 | display: inline-block; 10 | width: 56px; 11 | height: 56px; 12 | line-height: 56px; 13 | font-size: 20px; 14 | color: #fff; 15 | background: #f44336; 16 | border-radius: 50%; 17 | box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); 18 | -webkit-transition: .4s ease-in-out; 19 | transition: .4s ease-in-out; 20 | text-decoration: none; 21 | } 22 | 23 | .article-praise .article-praise-btn:hover { 24 | box-shadow: 0 6px 12px rgba(0,0,0,0.2),0 4px 15px rgba(0,0,0,0.2); 25 | } 26 | 27 | .article-praise .article-praise-btn:active { 28 | box-shadow: 0 6px 12px rgba(0,0,0,0.2),0 4px 15px rgba(0,0,0,0.2); 29 | } 30 | 31 | /* 赞赏遮罩 */ 32 | .article-praise-mask { 33 | z-index: 999; 34 | filter: alpha(opacity=50); 35 | background: #666; 36 | opacity: 0.5; 37 | -moz-opacity: 0.5; 38 | left: 0; 39 | top: 0; 40 | height: 99%; 41 | width: 100%; 42 | position: fixed; 43 | display: none; 44 | } 45 | 46 | /* 赞赏控件 */ 47 | .article-praise-box { 48 | width: 540px; 49 | height: 540px; 50 | padding: 10px; 51 | background-color: #fff; 52 | border-radius: 10px; 53 | position: fixed; 54 | z-index: 1000; 55 | left: 50%; 56 | top: 50%; 57 | margin-left: -280px; 58 | margin-top: -280px; 59 | border: 1px dotted #dedede; 60 | display: none; 61 | } 62 | 63 | .article-praise-box img { 64 | border: none; 65 | border-width: 0; 66 | } 67 | 68 | .article-praise-box .article-praise-p { 69 | color: #aaaaaa; 70 | } 71 | 72 | .article-praise-box .article-praise-p .icon { 73 | margin: 0 20px; 74 | width: 40px; 75 | height: 40px; 76 | color: #aaaaaa; 77 | } 78 | 79 | .article-praise-close { 80 | float: right; 81 | display: inline-block; 82 | color: #aaaaaa; 83 | text-decoration: none; 84 | } 85 | 86 | .article-praise-title { 87 | width: 100%; 88 | height: 75px; 89 | text-align: center; 90 | line-height: 66px; 91 | color: #aaaaaa; 92 | font-size: 16px; 93 | font-family: 'Microsoft YaHei'; 94 | margin-top: 7px; 95 | margin-right: 2px; 96 | } 97 | 98 | .article-praise-box-title p { 99 | color: #aaaaaa; 100 | text-align: center; 101 | font-size: 16px; 102 | } 103 | 104 | .article-praise-explain { 105 | text-align: center; 106 | margin: 10px auto; 107 | font-size: 12px; 108 | color: #aaaaaa; 109 | } 110 | 111 | .article-praise-payimg { 112 | width: 200px; 113 | height: 200px; 114 | padding: 10px; 115 | margin: 0 auto; 116 | border-radius: 3px; 117 | } 118 | 119 | .article-praise-payimg img { 120 | width: 100%; 121 | height: 100%; 122 | text-align: center; 123 | display: none; 124 | } 125 | 126 | .radiobox { 127 | width: 16px; 128 | height: 16px; 129 | display: block; 130 | float: left; 131 | margin-top: 5px; 132 | margin-right: 14px; 133 | background:url('/wp-content/themes/Sapphire/assets/img/praise/radio_normal.jpg'); 134 | } 135 | 136 | .checked .radiobox { 137 | background:url('/wp-content/themes/Sapphire/assets/img/praise/radio_select.jpg'); 138 | } 139 | 140 | .pay-type { 141 | float: left; 142 | display: block; 143 | } 144 | 145 | .pay-title { 146 | height: 16px; 147 | display: block; 148 | float: left; 149 | margin-left: 5px; 150 | } 151 | 152 | .article-praise-payselect { 153 | text-align: center; 154 | margin: 0 auto; 155 | margin-top: 40px; 156 | cursor: pointer; 157 | height: 60px; 158 | } 159 | 160 | .article-praise-payselect .article-praise-item { 161 | display: inline-block; 162 | margin: 0 10px; 163 | } 164 | 165 | .article-praise-info { 166 | clear: both; 167 | } 168 | 169 | .article-praise-info p,.article-praise-info a { 170 | color: #C3C3C3; 171 | text-align: center; 172 | font-size: 12px; 173 | text-decoration: none; 174 | line-height: 2em; 175 | } 176 | -------------------------------------------------------------------------------- /inc/custom-configs/theme-post.php: -------------------------------------------------------------------------------- 1 | 9 | post_content; 17 | } 18 | if (mb_strlen($text, 'UTF-8') > 0) { 19 | $count = mb_strlen(preg_replace('/\s/','',html_entity_decode(strip_tags($post->post_content))),'UTF-8'); 20 | } else { 21 | $count = 0; 22 | } 23 | if ($count < 1000) { 24 | echo '
    '.$count.' 字'; 25 | } else { 26 | $k_count = round($count / 100.0, 2) / 10; 27 | echo '
    '.$k_count.'k 字'; 28 | } 29 | echo '  |  '; 30 | $read_time = ceil($count / 300); // 修改数字 300 调整时间 31 | echo ''.$read_time.' 分钟
    '; 32 | } 33 | 34 | /** 35 | * 自定义数字分页函数 36 | * @Param int $range 数字分页的宽度 37 | * @Return string|empty 输出分页的HTML代码 38 | */ 39 | function pagenav($type=null, $archive_pages=0) { 40 | global $paged, $wp_query; 41 | $range = 4; 42 | if ($type) { 43 | $max_page = $archive_pages / 10; 44 | } else { 45 | $max_page = $wp_query->max_num_pages; 46 | } 47 | if ($max_page > 1) { 48 | echo ''; 99 | } 100 | } 101 | 102 | /** 103 | * 获取文章摘要 104 | */ 105 | function sa_post_excerpt($width_or_words, $more = '...', $words = false) { 106 | global $post; 107 | 108 | if ($post->post_password) { // 密码保护 109 | $excerpt = '本文已加密,请输入密码后访问'; 110 | } else if ($post->post_excerpt) { // 有摘要,获取摘要 111 | $excerpt = $post->post_excerpt; 112 | } else { 113 | $excerpt = apply_filters('the_content', $post->post_content); 114 | } 115 | 116 | $excerpt = strip_tags($excerpt); 117 | $excerpt = str_replace(array("\r\n", "\r", "\n"), '', $excerpt); 118 | 119 | if($words) { 120 | $excerpt = wp_trim_words($excerpt, $width_or_words, $more); // 按字数截取 121 | } else { 122 | $excerpt = mb_strimwidth($excerpt, 0, $width_or_words, $more); // 按字符串宽度截断 123 | } 124 | 125 | return $excerpt; 126 | } 127 | 128 | /** 129 | * 自定义文章摘要长度 130 | */ 131 | function sa_excerpt_length(){ 132 | return 100; 133 | } 134 | add_filter( 'excerpt_length', 'sa_excerpt_length'); 135 | ?> -------------------------------------------------------------------------------- /assets/css/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "sapphire-fonts"; 3 | src: url('../fonts/sapphire-fonts.eot'); /* IE9*/ 4 | src: url('../fonts/sapphire-fonts.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('../fonts/sapphire-fonts.woff') format('woff'), /* chrome, firefox */ 6 | url('../fonts/sapphire-fonts.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('../fonts/sapphire-fonts.svg#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | [class^="icon-"], [class*=" icon-"] { 11 | /* use !important to prevent issues with browser extensions that change fonts */ 12 | font-family: 'sapphire-fonts' !important; 13 | speak: none; 14 | font-style: normal; 15 | font-weight: normal; 16 | font-variant: normal; 17 | text-transform: none; 18 | line-height: 1; 19 | 20 | /* Better Font Rendering =========== */ 21 | -webkit-font-smoothing: antialiased; 22 | -moz-osx-font-smoothing: grayscale; 23 | } 24 | 25 | .icon-x:before { 26 | content: "\78"; 27 | } 28 | 29 | .icon-twitter:before { 30 | content: "\e600"; 31 | } 32 | 33 | .icon-facebook:before { 34 | content: "\e601"; 35 | } 36 | 37 | .icon-clock:before { 38 | content: "\e602"; 39 | } 40 | 41 | .icon-mail:before { 42 | content: "\e609"; 43 | } 44 | 45 | .icon-link:before { 46 | content: "\e6ab"; 47 | } 48 | 49 | .icon-search:before { 50 | content: "\e65b"; 51 | } 52 | 53 | .icon-smile:before { 54 | content: "\e64a"; 55 | } 56 | 57 | .icon-roundrightfill:before { 58 | content: "\e65a"; 59 | } 60 | 61 | .icon-list:before { 62 | content: "\e682"; 63 | } 64 | 65 | .icon-book:before { 66 | content: "\e6fe"; 67 | } 68 | 69 | .icon-home:before { 70 | content: "\e6bb"; 71 | } 72 | 73 | .icon-share:before { 74 | content: "\e618"; 75 | } 76 | 77 | .icon-back:before { 78 | content: "\e625"; 79 | } 80 | 81 | .icon-qq:before { 82 | content: "\e62d"; 83 | } 84 | 85 | .icon-weibo:before { 86 | content: "\e619"; 87 | } 88 | 89 | .icon-segmentfault:before { 90 | content: "\e603"; 91 | } 92 | 93 | .icon-sort:before { 94 | content: "\e700"; 95 | } 96 | 97 | .icon-jianshu:before { 98 | content: "\e613"; 99 | } 100 | 101 | .icon-circle-left:before { 102 | content: "\e71f"; 103 | } 104 | 105 | .icon-circle-right:before { 106 | content: "\e720"; 107 | } 108 | 109 | .icon-loading:before { 110 | content: "\e614"; 111 | } 112 | 113 | .icon-acfun:before { 114 | content: "\e604"; 115 | } 116 | 117 | .icon-close:before { 118 | content: "\e60c"; 119 | } 120 | 121 | .icon-tumblr:before { 122 | content: "\e6b0"; 123 | } 124 | 125 | .icon-calendar:before { 126 | content: "\e667"; 127 | } 128 | 129 | .icon-rss:before { 130 | content: "\e877"; 131 | } 132 | 133 | .icon-price-tags:before { 134 | content: "\e6f9"; 135 | } 136 | 137 | .icon-quo-left:before { 138 | content: "\e7f5"; 139 | } 140 | 141 | .icon-quo-right:before { 142 | content: "\e7f6"; 143 | } 144 | 145 | .icon-back1:before { 146 | content: "\e64e"; 147 | } 148 | 149 | .icon-github:before { 150 | content: "\e735"; 151 | } 152 | 153 | .icon-film:before { 154 | content: "\e7b7"; 155 | } 156 | 157 | .icon-weixin:before { 158 | content: "\e61f"; 159 | } 160 | 161 | .icon-qzone:before { 162 | content: "\e680"; 163 | } 164 | 165 | .icon-category:before { 166 | content: "\e605"; 167 | } 168 | 169 | .icon-douban:before { 170 | content: "\e64c"; 171 | } 172 | 173 | .icon-roundleftfill:before { 174 | content: "\e799"; 175 | } 176 | 177 | .icon-tuding:before { 178 | content: "\e651"; 179 | } 180 | 181 | .icon-zhihu:before { 182 | content: "\e61b"; 183 | } 184 | 185 | .icon-linkedin:before { 186 | content: "\e6d4"; 187 | } 188 | 189 | .icon-google:before { 190 | content: "\e635"; 191 | } 192 | 193 | .icon-plane:before { 194 | content: "\e62f"; 195 | } 196 | 197 | .icon-bilibili:before { 198 | content: "\e622"; 199 | } 200 | 201 | .icon-psp:before { 202 | content: "\e6c7"; 203 | } 204 | 205 | .icon-csdn:before { 206 | content: "\e879"; 207 | } 208 | 209 | .icon-gitee:before { 210 | content: "\e87a"; 211 | } 212 | 213 | .icon-statistics:before { 214 | content: "\e89f"; 215 | } 216 | 217 | .icon-user:before { 218 | content: "\e745"; 219 | } 220 | 221 | .icon-eye:before { 222 | content: "\e6b7"; 223 | } 224 | 225 | .icon-nintendo-switch:before { 226 | content: "\e7ce"; 227 | } 228 | 229 | .icon-cnblogs:before { 230 | content: "\e515"; 231 | } 232 | 233 | .icon-blog:before { 234 | content: "\ebbe"; 235 | } 236 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 12 |
    13 |
    14 |
    15 | found_posts; 44 | if($counts) { 45 | $banner_sub_title = '找到 ' . $counts . '+ 与『'.get_search_query().'』相关的内容'; 46 | } else { 47 | $banner_sub_title = '没找到与『'.get_search_query().'』相关的内容'; 48 | } 49 | $flag = true; 50 | } 51 | 52 | if ( $flag ) { 53 | echo ''; 54 | } 55 | ?> 56 | 57 |
    58 |
    59 |
    60 |

    61 | 62 |

    63 | 69 |
    70 |
    71 | 72 |
    73 | 74 | '; 94 | } 95 | $tags = get_the_tags(); 96 | if ($tags) { 97 | echo '
    '; 98 | echo ''; 99 | echo '
      '; 100 | foreach ($tags as $key => $tag) { 101 | echo '
    • '; 102 | echo ''; 103 | echo '
    • '; 104 | } 105 | echo '
    '; 106 | echo '
    '; 107 | } 108 | ?> 109 | 110 | 111 | 阅读全文 >> 112 | 113 |
    114 |
    115 |
    116 | 117 | 118 | 119 | 120 |
    121 |
    122 | 123 |
    124 |
    125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /assets/css/sidebar.css: -------------------------------------------------------------------------------- 1 | .intro-inner { 2 | position: relative; 3 | padding: 20px; 4 | border: 1px solid #CFCFCF; 5 | box-shadow: 3px 2px 8px rgba(0, 0, 0, 0.07); 6 | margin-bottom: 20px; 7 | font-size:12px; 8 | background: rgba(255, 255, 255, 1); 9 | } 10 | 11 | .intro-inner .overlay { 12 | left: 0px; 13 | top: 0px; 14 | width: 300px; 15 | height: 160px; 16 | position: absolute; 17 | background: #4D4D4D; 18 | } 19 | 20 | .intro-header { 21 | margin-top: 80px; 22 | width: 100%; 23 | min-height: 260px; 24 | position: relative; 25 | border-bottom: 1px solid color-border; 26 | } 27 | 28 | .intro-header a { 29 | color: #666; 30 | font-weight: 400; 31 | } 32 | 33 | .intro-header a:hover { 34 | color: #ff7242; 35 | } 36 | 37 | .intro-header .profilepic { 38 | text-align: center; 39 | display: block; 40 | border: 5px solid #fff; 41 | border-radius: 50%; 42 | width: 128px; 43 | height: 128px; 44 | margin: 0 auto; 45 | position: relative; 46 | overflow: hidden; 47 | background: #fff; 48 | -webkit-transition: all 0.2s ease-in; 49 | display: -webkit-box; 50 | -webkit-box-orient: horizontal; 51 | -webkit-box-pack: center; 52 | -webkit-box-align: center; 53 | } 54 | 55 | .intro-header .profilepic .intro-portrait { 56 | width: 100%; 57 | height: 100%; 58 | border-radius: 50%; 59 | border: 0; 60 | -webkit-transition: -webkit-transform 1s ease-out; 61 | -moz-transition: -moz-transform 1s ease-out; 62 | -o-transition: -o-transform 1s ease-out; 63 | -ms-transition: -ms-transform 1s ease-out; 64 | } 65 | 66 | .intro-header .profilepic .intro-portrait:show { 67 | width: 100%; 68 | height: 100%; 69 | opacity: 1; 70 | } 71 | 72 | .intro-header .profilepic .intro-portrait:hover { 73 | -webkit-transform: rotateZ(360deg); 74 | -moz-transform: rotateZ(360deg); 75 | -o-transform: rotateZ(360deg); 76 | -ms-transform: rotateZ(360deg); 77 | transform: rotateZ(360deg); 78 | } 79 | 80 | .intro-header .header-author { 81 | text-align: center; 82 | margin: 0.5em 0; 83 | font-size: 30px; 84 | transition: 0.3s; 85 | } 86 | 87 | .intro-header .header-author a { 88 | text-decoration: none; 89 | } 90 | 91 | .intro-header .intro-subtitle { 92 | text-align: center; 93 | color: #999; 94 | font-size: 14px; 95 | line-height: 25px; 96 | overflow: hidden; 97 | text-overflow: ellipsis; 98 | display: -webkit-box; 99 | -webkit-line-clamp: 2; 100 | -webkit-box-orient: vertical; 101 | } 102 | 103 | 104 | .intro-site-state { 105 | overflow: hidden; 106 | line-height: 1.4; 107 | white-space: nowrap; 108 | text-align: center; 109 | margin-top: 15px; 110 | margin-bottom: 15px; 111 | } 112 | 113 | .intro-site-state-item { 114 | display: inline-block; 115 | padding: 0 25px; 116 | border-left: 1px solid #999; 117 | } 118 | 119 | .intro-site-state-item:first-child { 120 | border-left: none; 121 | } 122 | 123 | .intro-site-state-item a { 124 | color: #696969; 125 | border-bottom: none; 126 | text-decoration: none; 127 | } 128 | 129 | .intro-site-state-item a:hover { 130 | color: #ff7242; 131 | } 132 | 133 | .intro-site-state-item-count { 134 | display: block; 135 | text-align: center; 136 | color: inherit; 137 | font-weight: 600; 138 | font-size: 18px; 139 | } 140 | 141 | .intro-site-state-item-name { 142 | font-size: 13px; 143 | color: inherit; 144 | } 145 | 146 | /* 侧边栏栏目 */ 147 | .side-box { 148 | position: relative; 149 | border: 1px solid #CFCFCF; 150 | box-shadow: 0 0 5px #C6C6C6; 151 | border: 1px solid #CFCFCF; 152 | box-shadow: 3px 2px 8px rgba(0, 0, 0, 0.07); 153 | margin-bottom: 20px; 154 | background: rgba(255, 255, 255, 1); 155 | } 156 | .side-box .side-box-header { 157 | border-left: 5px solid #4d4d4d; 158 | font-weight: 400; 159 | padding: 15px 0px 10px 25px; 160 | } 161 | 162 | .side-box h1.side-box-title { 163 | color: #333; 164 | margin: 0px; 165 | font-weight: 400; 166 | line-height: 18px; 167 | font-size: 18px; 168 | -webkit-transition: color 0.3s; 169 | -moz-transition: color 0.3s; 170 | -o-transition: color 0.3s; 171 | transition: color 0.3s; 172 | text-decoration: none; 173 | } 174 | 175 | /* 最近文章 */ 176 | .side-box-entry .recent-posts { 177 | margin-top: 20px; 178 | margin-bottom: 0px; 179 | padding: 0px; 180 | } 181 | 182 | .side-box-entry .recent-post { 183 | margin-left: 30px; 184 | margin-right: 30px; 185 | padding: 10px 0px; 186 | border-top: 1px solid #eee; 187 | } 188 | 189 | .side-box-entry .recent-post-link { 190 | color: #17181a; 191 | font-size: 16px; 192 | font-weight: 300; 193 | text-decoration: none; 194 | } 195 | 196 | .side-box-entry .recent-post-link:hover { 197 | color: #ff7242; 198 | text-decoration: underline; 199 | } 200 | 201 | 202 | /* 热门标签 */ 203 | .side-box-entry .side-info-index { 204 | padding-top: 15px; 205 | padding-bottom: 15px; 206 | margin: 20px 30px 0 30px; 207 | border-top: 1px solid #ddd; 208 | } 209 | 210 | 211 | .side-box-entry .side-tag { 212 | float: left; 213 | } 214 | 215 | .side-box-entry .side-tag .icon { 216 | color: #999; 217 | float: left; 218 | margin-right: 10px; 219 | margin-top: 6px; 220 | } -------------------------------------------------------------------------------- /assets/css/social.css: -------------------------------------------------------------------------------- 1 | .social-header-nav { 2 | width: 100%; 3 | position: relative; 4 | transition: transform .3s ease-in; 5 | } 6 | 7 | .social-header-nav .social { 8 | margin: 0px; 9 | text-align: center; 10 | display: flex; 11 | flex-wrap: wrap; 12 | justify-content: center; 13 | } 14 | 15 | .social-header-nav .social a { 16 | border-radius: 50%; 17 | display: -moz-inline-stack; 18 | display: inline-block; 19 | vertical-align: middle; 20 | vertical-align: auto; 21 | zoom: 1; 22 | display: inline; 23 | margin: 0 8px 15px 8px; 24 | transition: 0.3s; 25 | text-align: center; 26 | color: #fff; 27 | opacity: 1; 28 | width: 28px; 29 | height: 28px; 30 | line-height: 26px; 31 | text-decoration: none; 32 | } 33 | 34 | .social-header-nav .social a:hover { 35 | opacity: 0.8; 36 | } 37 | 38 | .social-header-nav .social a.weibo { 39 | background: #ef182e; 40 | border:1px solid #ef182e; 41 | } 42 | .social-header-nav .social a.weibo:hover { 43 | border:1px solid #ef182e; 44 | } 45 | 46 | .social-header-nav .social a.segmentfault { 47 | background: #009a61; 48 | border:1px solid #009a61; 49 | } 50 | .social-header-nav .social a.segmentfault:hover { 51 | border:1px solid #009a61; 52 | } 53 | 54 | .social-header-nav .social a.rss { 55 | background: #ef7522; 56 | border:1px solid #ef7522; 57 | } 58 | .social-header-nav .social a.rss:hover { 59 | border:1px solid #cf5d0f; 60 | } 61 | 62 | .social-header-nav .social a.github { 63 | background: #829aa4; 64 | border:1px solid #829aa4; 65 | } 66 | .social-header-nav .social a.github:hover { 67 | border:1px solid #829aa4; 68 | } 69 | 70 | .social-header-nav .social a.facebook { 71 | background: #3b5998; 72 | border:1px solid #3b5998; 73 | } 74 | .social-header-nav .social a.facebook:hover { 75 | border:1px solid #2d4373; 76 | } 77 | 78 | .social-header-nav .social a.google { 79 | background: #c83d20; 80 | border:1px solid #c83d20; 81 | } 82 | .social-header-nav .social a.google:hover { 83 | border:1px solid #9c3019; 84 | } 85 | 86 | .social-header-nav .social a.twitter { 87 | background: #55cff8; 88 | border:1px solid #55cff8; 89 | } 90 | .social-header-nav .social a.twitter:hover { 91 | border:1px solid #24c1f6; 92 | } 93 | 94 | .social-header-nav .social a.linkedin { 95 | background: #005a87; 96 | border:1px solid #005a87; 97 | } 98 | .social-header-nav .social a.linkedin:hover { 99 | border:1px solid #006b98; 100 | } 101 | 102 | .social-header-nav .social a.acfun { 103 | background: #fd4c5d; 104 | border:1px solid #fd4c5d; 105 | } 106 | .social-header-nav .social a.acfun:hover { 107 | border:1px solid #fd4c5d; 108 | } 109 | 110 | .social-header-nav .social a.bilibili { 111 | background: #e15280; 112 | border:1px solid #e15280; 113 | } 114 | .social-header-nav .social a.bilibili:hover { 115 | border:1px solid #e15280; 116 | } 117 | 118 | .social-header-nav .social a.zhihu { 119 | background: #0078d8; 120 | border:1px solid #0078d8; 121 | } 122 | .social-header-nav .social a.zhihu:hover { 123 | border:1px solid #0078d8; 124 | } 125 | 126 | .social-header-nav .social a.douban { 127 | background: #06c611; 128 | border:1px solid #06c611; 129 | } 130 | .social-header-nav .social a.douban:hover { 131 | border:1px solid #06c611; 132 | } 133 | 134 | .social-header-nav .social a.mail { 135 | background: #005a87; 136 | border:1px solid #005a87; 137 | } 138 | .social-header-nav .social a.mail:hover { 139 | border:1px solid #006b98; 140 | } 141 | 142 | .social-header-nav .social a.jianshu { 143 | background: #ff5722; 144 | border:1px solid #ff5722; 145 | } 146 | .social-header-nav .social a.jianshu:hover { 147 | border:1px solid #ff5722; 148 | } 149 | 150 | .social-header-nav .social a.weixin { 151 | background: #4caf50; 152 | border:1px solid #4caf50; 153 | } 154 | .social-header-nav .social a.weixin:hover { 155 | border:1px solid #4caf50; 156 | } 157 | 158 | .social-header-nav .social a.qq { 159 | background: #28a6e2; 160 | border:1px solid #28a6e2; 161 | } 162 | .social-header-nav .social a.qq:hover { 163 | border:1px solid #28a6e2; 164 | } 165 | 166 | .social-header-nav .social a.psn { 167 | background: #086ef6; 168 | border:1px solid #086ef6; 169 | } 170 | .social-header-nav .social a.psn:hover { 171 | border:1px solid #086ef6; 172 | } 173 | 174 | .social-header-nav .social a.csdn { 175 | background: #c71d23; 176 | border: 1px solid #c71d23; 177 | } 178 | .social-header-nav .social a.csdn:hover { 179 | border: 1px solid #c71d23; 180 | } 181 | 182 | .social-header-nav .social a.gitee { 183 | background: #c71d23; 184 | border: 1px solid #c71d23; 185 | } 186 | .social-header-nav .social a.gitee:hover { 187 | border: 1px solid #c71d23; 188 | } 189 | 190 | .social-header-nav .social a.cnblogs { 191 | background: #2e7dcc; 192 | border: 1px solid #2e7dcc; 193 | } 194 | .social-header-nav .social a.cnblogs:hover { 195 | border: 1px solid #2e7dcc; 196 | } 197 | 198 | .social-header-nav .social a.nintendo-switch { 199 | background: #d81e06; 200 | border: 1px solid #d81e06; 201 | } 202 | .social-header-nav .social a.nintendo-switch:hover { 203 | border: 1px solid #d81e06; 204 | } 205 | 206 | .social-header-nav .social a.blog { 207 | background: #ff8346; 208 | border: 1px solid #ff8346; 209 | } 210 | .social-header-nav .social a.blog:hover { 211 | border: 1px solid #ff8346; 212 | } -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | section and everything up until main. 8 | * @package Sapphire 9 | * @since Sapphire 1.0 10 | */ 11 | ?> 12 | 13 | > 14 | 15 | 16 | 17 | 18 | 19 | '; 21 | $sa_seo_connector = sa_theme_option('sa_seo_connector'); 22 | if ($sa_seo_connector == 'midline') { 23 | $connector = ' - '; 24 | } elseif ($sa_seo_connector == 'underline') { 25 | $connector = ' _ '; 26 | } elseif ($sa_seo_connector == 'verticalline') { 27 | $connector = ' | '; 28 | } else { 29 | $connector = ' - '; 30 | } 31 | $blog_title = get_bloginfo('name'); 32 | if ( is_home() ) { 33 | echo $blog_title.$connector.get_bloginfo('description'); 34 | } elseif ( is_single() || is_page() ) { 35 | $post_url = $_SERVER['REQUEST_URI'].""; 36 | if ($post_url == '/tag') { 37 | echo '标签'.$connector.$blog_title; 38 | } elseif ($post_url == '/category') { 39 | echo '分类'.$connector.$blog_title; 40 | } elseif ($post_url == '/archive') { 41 | echo '归档'.$connector.$blog_title; 42 | } else { 43 | echo single_post_title().$connector.$blog_title; 44 | } 45 | } elseif ( is_category() ) { 46 | echo single_cat_title().$connector.$blog_title; 47 | } elseif ( is_tag() ) { 48 | echo single_tag_title().$connector.$blog_title; 49 | } elseif ( is_search() ) { 50 | echo get_search_query()." 的搜索结果".$connector.$blog_title; 51 | } elseif ( is_year() ) { 52 | echo the_time('Y年')." 所有文章".$connector.$blog_title; 53 | } elseif ( is_month() ) { 54 | echo the_time('Y年n月')." 份所有文章".$connector.$blog_title; 55 | } elseif ( is_day() ) { 56 | echo the_time('Y年n月j日'); echo "所有文章".$connector.$blog_title; 57 | } elseif ( is_404() ) { 58 | echo '404'.$connector.$blog_title; 59 | } elseif ( is_author() ) { 60 | echo the_author()." 的所有文章".$connector.$blog_title; 61 | } else { 62 | wp_title(''); 63 | } 64 | echo ''; 65 | ?> 66 | 67 | ID, 'description', true); 70 | if ( !$description ) { 71 | $description = sa_post_excerpt(100, '...'. true); 72 | } 73 | 74 | $keywords = get_post_meta($post->ID, 'keywords', true); 75 | $tags = wp_get_post_tags($post->ID); 76 | $categories = get_the_category(); 77 | foreach ($tags as $tag) { 78 | $keywords = $keywords . $tag->name . ","; 79 | } 80 | foreach ($categories as $category) { 81 | $keywords = $keywords . $category->cat_name . ","; 82 | } 83 | $keywords = rtrim($keywords, ','); 84 | $keywords = htmlspecialchars($keywords); 85 | } elseif ( is_category() ) { 86 | $description = trim(strip_tags(category_description())); 87 | $keywords = trim(strip_tags(single_cat_title('', false))); 88 | } elseif ( is_tag() ) { 89 | $description = trim(strip_tags(tag_description())); 90 | $keywords = trim(strip_tags(single_tag_title('', false))); 91 | } elseif ( is_home() ) { 92 | $description = sa_theme_option('sa_seo_site_desc'); 93 | $keywords = sa_theme_option('sa_seo_site_keywords'); 94 | } else { 95 | $description = sa_theme_option('sa_seo_site_desc'); 96 | $keywords = sa_theme_option('sa_seo_site_keywords'); 97 | } 98 | ?> 99 | 100 | 101 | 102 | 103 | 108 | onload="prettyPrint()"> 109 | 110 | > 111 | 112 | 113 | > 114 | 115 | 116 | -------------------------------------------------------------------------------- /assets/css/comments.css: -------------------------------------------------------------------------------- 1 | .comment-header { 2 | border-left: 5px solid #4d4d4d; 3 | padding: 20px 0px 15px 25px; 4 | } 5 | 6 | .comment-header { 7 | border-left: 5px solid #4d4d4d; 8 | font-weight: 400; 9 | padding: 15px 0px 10px 25px; 10 | } 11 | 12 | .comment-title { 13 | color: #333; 14 | margin: 0px; 15 | font-weight: 400; 16 | line-height: 18px; 17 | font-size: 18px; 18 | -webkit-transition: color 0.3s; 19 | -moz-transition: color 0.3s; 20 | -o-transition: color 0.3s; 21 | transition: color 0.3s; 22 | text-decoration: none; 23 | } 24 | 25 | .comment-list-box { 26 | margin: 0px 30px 15px 30px; 27 | line-height: 1; 28 | } 29 | 30 | .comment-reply-title { 31 | position: relative; 32 | padding-bottom: 10px; 33 | font-size: 18px; 34 | color: #666; 35 | border-bottom: 1px solid #f1f1f1; 36 | } 37 | h3.comment-reply-title:after { 38 | position: absolute; 39 | content:''; 40 | top: 29px; 41 | left: 0; 42 | width: 135px; 43 | height: 1px; 44 | background: #4d4d4d;/*main-color*/ 45 | } 46 | 47 | .comment-list { 48 | list-style: none; 49 | margin:20px 0 0; 50 | padding: 0; 51 | border-bottom: 1px solid #eee; 52 | } 53 | .comment-list-li { 54 | padding:10px 0 5px; 55 | } 56 | .comment-list-li .media-left { 57 | display: table-cell; 58 | vertical-align: top; 59 | padding-right: 10px; 60 | } 61 | .comment-list-li .media-left img { 62 | border-radius: 50%; 63 | } 64 | .comment-list-li .media-body { 65 | display: table-cell; 66 | vertical-align: top; 67 | } 68 | .comment-list-li .media-body .media-author { 69 | margin-top: 0px; 70 | margin-bottom: 5px; 71 | } 72 | .comment-list-li .media-body .author-name { 73 | font-size:14px; 74 | color: #666; 75 | } 76 | .comment-list-li .media-body .author-name-label { 77 | margin-left: 10px; 78 | padding: 4px 8px; 79 | background: #4d4d4d; 80 | color: #fff; 81 | border-radius: 5px; 82 | border: 0; 83 | opacity: 0.75; 84 | } 85 | 86 | 87 | .comment-list-li .media-body p { 88 | margin-top: 0px; 89 | margin-bottom: 0px; 90 | padding: 0px; 91 | font-size:14px; 92 | line-height:1.5em; 93 | color: #666; 94 | } 95 | 96 | .comment-list-li .comment-metadata { 97 | margin-left:58px; 98 | padding:5px 0; 99 | } 100 | .comment-list-li .comment-metadata span { 101 | margin-right:15px; 102 | font-size:13px; 103 | } 104 | .comment-list-li .comment-metadata span { 105 | font-size:12px; 106 | color:#999; 107 | } 108 | .comment-list-li .comment-metadata span.comment-btn-reply a:hover { 109 | color:#666; 110 | } 111 | .comment-list-li .comment-metadata span.comment-btn-reply i { 112 | color:#d1d1d1; 113 | } 114 | .comment-list-li .comment-metadata span.comment-btn-reply a { 115 | color:#999; 116 | } 117 | .comment-list > .comment-list-li { 118 | border-top: 1px solid #eee; 119 | } 120 | .comment-list .children { 121 | padding-left:58px; 122 | } 123 | .comment-list .children > .comment-list-li { 124 | border-top:1px solid #eee; 125 | } 126 | .comment-reply-title { 127 | font-size: 14px; 128 | color: #666; 129 | border-bottom: 0; 130 | color: #999; 131 | } 132 | .comment-reply-title a:first-child,.warning-text a:first-child { 133 | display:inline-block; 134 | margin:0 2px; 135 | padding:2px 8px; 136 | border-radius: 5px; 137 | background:#4d4d4d; /*main-color*/ 138 | color:#fff; 139 | font-size: 14px; 140 | text-decoration: none; 141 | } 142 | .warning-text { 143 | color:#999; 144 | } 145 | .link-logout { 146 | color:#999; 147 | } 148 | 149 | .comments-nav { 150 | width:100%; 151 | margin-top: 20px; 152 | text-align: center; 153 | } 154 | .comments-nav .page-numbers { 155 | padding: 0 8px; 156 | height: 25px; 157 | background: #4d4d4d; 158 | display:inline-block; 159 | color: #fff; 160 | line-height: 25px; 161 | font-size: 14px; 162 | margin: 0 5px 20px; 163 | border-radius: 2px; 164 | text-decoration: none; 165 | opacity: 1; 166 | } 167 | .comments-nav .page-numbers:hover { 168 | background:#4d4d4d; 169 | opacity: 0.8; 170 | } 171 | .comments-nav .current { 172 | background:#88acdb; 173 | cursor: default; 174 | } 175 | .comments-nav .current:hover { 176 | background: #e8e8e8; 177 | color:#666; 178 | } 179 | 180 | .comment-form-box { 181 | margin: 0px 30px 30px 30px; 182 | padding: 0px; 183 | } 184 | .comment-form-content { 185 | display: block; 186 | font-size: 14px; 187 | width: calc(100% - 20px); 188 | margin-bottom: 15px; 189 | background:#f5f5f5; 190 | color: #777; 191 | border:0; 192 | box-shadow:none; 193 | height:90px; 194 | padding: 10px 10px; 195 | resize: none; 196 | border-radius:5px; 197 | transition:background .3s; 198 | } 199 | .comment-form-content:focus { 200 | background: #e9e9e9; 201 | } 202 | .comment-form-info { 203 | float:left; 204 | font-size: 0px; 205 | } 206 | .comment-form-info input { 207 | float:left; 208 | font-size: 14px; 209 | margin: 0px 10px 0px 0px; 210 | padding: 5px 10px 5px 10px; 211 | width: 205px; 212 | border:0; 213 | border-radius:0; 214 | box-shadow:none; 215 | background: #f5f5f5; 216 | border-radius:5px; 217 | transition: background .5s; 218 | } 219 | .comment-form-info input:focus { 220 | box-shadow: none; 221 | background: #e9e9e9; 222 | } 223 | 224 | .comment-submit-button .submit-button { 225 | padding: 0px; 226 | width: 105px; 227 | height: 34px; 228 | font-size: 14px; 229 | text-align: center; 230 | background: #4d4d4d; 231 | opacity: 1; 232 | border-radius: 5px; 233 | border:0; 234 | } 235 | .comment-submit-button .submit-button:hover { 236 | background: #4d4d4d; 237 | opacity: 0.8; 238 | } 239 | input#submit{ 240 | color: #fff; 241 | } -------------------------------------------------------------------------------- /sidebar.php: -------------------------------------------------------------------------------- 1 | 11 |
    12 | 13 |
    14 |
    15 |
    16 | 17 | 18 | 19 | 20 |
    21 |

    22 | 23 |

    24 |
    25 |

    26 |
    27 | 47 |
    48 | 52 | 77 | 82 | 106 | 111 | 136 | 141 |
    142 | 145 |
    146 |
    147 | 148 | 149 |
    -------------------------------------------------------------------------------- /inc/custom-configs/wp-optimize.php: -------------------------------------------------------------------------------- 1 | 9 | public_query_vars = array_diff( $wp->public_query_vars, array( 61 | 'embed', 62 | ) ); 63 | 64 | // Remove the REST API endpoint. 65 | remove_action( 'rest_api_init', 'wp_oembed_register_route' ); 66 | 67 | // Turn off oEmbed auto discovery. 68 | add_filter( 'embed_oembed_discover', '__return_false' ); 69 | 70 | // Don't filter oEmbed results. 71 | remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 ); 72 | 73 | // Remove oEmbed discovery links. 74 | remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); 75 | 76 | // Remove oEmbed-specific JavaScript from the front-end and back-end. 77 | remove_action( 'wp_head', 'wp_oembed_add_host_js' ); 78 | add_filter( 'tiny_mce_plugins', 'disable_embeds_tiny_mce_plugin' ); 79 | 80 | // Remove all embeds rewrite rules. 81 | add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 82 | 83 | // Remove filter of the oEmbed result before any HTTP requests are made. 84 | remove_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10 ); 85 | } 86 | 87 | add_action( 'init', 'disable_embeds_init', 9999 ); 88 | 89 | /** 90 | * Removes the 'wpembed' TinyMCE plugin. 91 | * 92 | * @since 1.0.0 93 | * 94 | * @param array $plugins List of TinyMCE plugins. 95 | * @return array The modified list. 96 | */ 97 | function disable_embeds_tiny_mce_plugin( $plugins ) { 98 | return array_diff( $plugins, array( 'wpembed' ) ); 99 | } 100 | 101 | /** 102 | * Remove all rewrite rules related to embeds. 103 | * 104 | * @since 1.2.0 105 | * 106 | * @param array $rules WordPress rewrite rules. 107 | * @return array Rewrite rules without embeds rules. 108 | */ 109 | function disable_embeds_rewrites( $rules ) { 110 | foreach ( $rules as $rule => $rewrite ) { 111 | if ( false !== strpos( $rewrite, 'embed=true' ) ) { 112 | unset( $rules[ $rule ] ); 113 | } 114 | } 115 | 116 | return $rules; 117 | } 118 | 119 | /** 120 | * Remove embeds rewrite rules on plugin activation. 121 | * 122 | * @since 1.2.0 123 | */ 124 | function disable_embeds_remove_rewrite_rules() { 125 | add_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 126 | flush_rewrite_rules(); 127 | } 128 | 129 | register_activation_hook( __FILE__, 'disable_embeds_remove_rewrite_rules' ); 130 | 131 | /** 132 | * Flush rewrite rules on plugin deactivation. 133 | * 134 | * @since 1.2.0 135 | */ 136 | function disable_embeds_flush_rewrite_rules() { 137 | remove_filter( 'rewrite_rules_array', 'disable_embeds_rewrites' ); 138 | flush_rewrite_rules(); 139 | } 140 | 141 | register_deactivation_hook( __FILE__, 'disable_embeds_flush_rewrite_rules' ); 142 | endif; 143 | 144 | add_filter('wpseo_robots', 'yoast_no_home_noindex', 999); 145 | function yoast_no_home_noindex($string="") { 146 | if (is_home() || is_front_page() || is_search()) { 147 | $string="index,follow"; 148 | } 149 | return $string; 150 | } 151 | ?> -------------------------------------------------------------------------------- /assets/css/article-inner.css: -------------------------------------------------------------------------------- 1 | /* 文章基本 */ 2 | .article-inner { 3 | position: relative; 4 | margin-bottom: 0px; 5 | word-break: break-word; 6 | border: 1px solid #CFCFCF; 7 | box-shadow: 0 0 5px #C6C6C6; 8 | } 9 | 10 | .article-inner .article-header { 11 | border-left: 5px solid #4d4d4d; 12 | padding: 20px 130px 15px 25px; 13 | } 14 | 15 | .article-header .article-title { 16 | color: #696969; 17 | margin: 0px; 18 | font-weight: 400; 19 | line-height: 1.3; 20 | font-size: 26px; 21 | -webkit-transition: color 0.3s; 22 | -moz-transition: color 0.3s; 23 | -o-transition: color 0.3s; 24 | transition: color 0.3s; 25 | } 26 | 27 | .article-header .article-title .article-title-url { 28 | color: #696969; 29 | text-decoration: none; 30 | } 31 | 32 | .article-header .article-title .article-title-url:hover { 33 | color: #ff7242; 34 | text-decoration:underline; 35 | } 36 | 37 | .article-inner .article-read-words-times { 38 | margin: 20px 30px 0px 30px; 39 | padding-top: 10px; 40 | border-top: 1px solid #DDD; 41 | } 42 | 43 | .article-date { 44 | position: absolute; 45 | right: 0; 46 | top: 24px; 47 | width: 12rem; 48 | padding-right: 1.2rem; 49 | font-size: 14px; 50 | text-align: right; 51 | z-index: 1; 52 | } 53 | 54 | .article-date time { 55 | color: #aaa; 56 | float: right; 57 | } 58 | 59 | 60 | /* 文章内容 CSS */ 61 | .article-entry { 62 | font-size: 16px; 63 | color: #333; 64 | line-height: 1.6; 65 | word-spacing: 0px; 66 | letter-spacing: 0px; 67 | word-break: break-word; 68 | word-wrap: break-word; 69 | text-align: justify; 70 | } 71 | 72 | #article-entry-excerpt { 73 | padding: 10px 30px; 74 | } 75 | 76 | #article-entry-content { 77 | padding: 20px 30px; 78 | } 79 | 80 | .article-entry p { 81 | font-size: 16px; 82 | padding-top: 8px; 83 | padding-bottom: 8px; 84 | margin: 0; 85 | line-height: 26px; 86 | } 87 | 88 | .article-entry blockquote { 89 | font-size: 14px; 90 | overflow: auto; 91 | border-left: 3px solid rgba(0, 0, 0, 0.4); 92 | background: rgba(0, 0, 0, 0.05); 93 | color: #6a737d; 94 | padding: 10px 10px 10px 20px; 95 | margin: 20px 0px 20px 0px; 96 | } 97 | 98 | .article-entry blockquote p { 99 | color: #333; 100 | margin: 0px; 101 | line-height: 26px; 102 | } 103 | 104 | .article-entry p code { 105 | font-size: 14px; 106 | word-wrap: break-word; 107 | word-break: break-all; 108 | padding: 2px 4px; 109 | border-radius: 4px; 110 | margin: 0 2px; 111 | color: #1e6bb8; 112 | background-color: rgba(27,31,35,.05); 113 | } 114 | 115 | .article-entry em { 116 | font-style: italic; 117 | } 118 | 119 | 120 | .article-entry ul { 121 | list-style-type: disc; 122 | margin-top: 8px; 123 | margin-bottom: 8px; 124 | padding-left: 25px; 125 | } 126 | 127 | .article-entry ol { 128 | list-style-type: decimal; 129 | margin-top: 8px; 130 | margin-bottom: 8px; 131 | padding-left: 25px; 132 | counter-reset: item; 133 | } 134 | 135 | .article-entry li { 136 | margin-top: 5px; 137 | margin-bottom: 5px; 138 | line-height: 26px; 139 | text-align: left; 140 | } 141 | 142 | .article-entry li code { 143 | font-size: 14px; 144 | word-wrap: break-word; 145 | word-break: break-all; 146 | padding: 2px 4px; 147 | border-radius: 4px; 148 | margin: 0 2px; 149 | color: #1e6bb8; 150 | background-color: rgba(27,31,35,.05); 151 | } 152 | 153 | .article-entry li .language-objc { 154 | background-color: transparent; 155 | padding: 0px; 156 | margin: 0px; 157 | } 158 | 159 | .article-entry a { 160 | text-decoration: none; 161 | color: #1e6bb8; 162 | word-wrap: break-word; 163 | font-weight: bold; 164 | border-bottom: 1px solid #1e6bb8; 165 | } 166 | 167 | .article-entry a:hover { 168 | color: #ff7242; 169 | border-bottom: 1px solid #ff7242; 170 | } 171 | 172 | .article-entry img { 173 | display: block; 174 | margin: 0 auto; 175 | width: auto; 176 | max-width: 100%; 177 | vertical-align: middle; 178 | border-style: none; 179 | } 180 | 181 | .article-entry figcaption { 182 | margin-top: 5px; 183 | text-align: center; 184 | color: #888; 185 | font-size: 14px; 186 | } 187 | 188 | .article-entry h1,h2,h3,h4,h5,h6 { 189 | margin-top: 30px; 190 | margin-bottom: 15px; 191 | font-weight: bold; 192 | color: #333; 193 | } 194 | 195 | .article-entry h1 { 196 | text-align: center; 197 | font-size: 24px; 198 | } 199 | 200 | .article-entry h2 { 201 | font-size: 22px; 202 | border-bottom: 1px solid #ddd; 203 | } 204 | 205 | .article-entry h3 { 206 | font-size: 20px; 207 | border-bottom: 1px solid #ddd; 208 | } 209 | 210 | .article-entry h4 { 211 | font-size: 18px; 212 | } 213 | 214 | .article-entry h5,h6 { 215 | font-size: 16px; 216 | } 217 | 218 | .article-entry video { 219 | max-width: 100%; 220 | } 221 | 222 | .article-entry strong { 223 | font-weight: bold; 224 | color: #ff7242; 225 | } 226 | 227 | .article-entry .caption { 228 | display: block; 229 | font-size: 0.8em; 230 | color: #aaa; 231 | } 232 | .article-entry hr { 233 | height: 1px; 234 | margin: 10px 0px 10px 0px; 235 | border-left: 0; 236 | border-right: 0; 237 | border-top: 1px solid #DDD; 238 | border-bottom: 0; 239 | } 240 | 241 | .article-entry pre { 242 | padding: 16px 16px 16px 28px; 243 | margin: 10px 0px; 244 | font-size: 14px; 245 | background-color: rgba(0,0,0,0.03); 246 | border: 1px solid #f0f0f0; 247 | } 248 | 249 | .article-entry pre code { 250 | line-height: 26px; 251 | } 252 | 253 | .article-entry table { 254 | border: none; 255 | width: auto; 256 | margin: auto; 257 | text-align: left; 258 | border-collapse: collapse; 259 | } 260 | 261 | .article-entry table tr { 262 | border: 0; 263 | border-top: 1px solid #ccc; 264 | background-color: white; 265 | } 266 | .article-entry table tr th { 267 | font-weight: bold; 268 | text-align: center; 269 | background-color: #f0f0f0; 270 | } 271 | 272 | .article-entry table tr th,td { 273 | font-size: 16px; 274 | padding: 5px 10px; 275 | border: 1px solid #ccc; 276 | } 277 | 278 | .article-copyright { 279 | margin: 0px 30px 25px 30px; 280 | border-left: 3px solid rgba(0, 0, 0, 0.4); 281 | background-color: rgba(0, 0, 0, 0.05); 282 | list-style: none; 283 | } 284 | 285 | .article-copyright ul { 286 | margin-top: 0px; 287 | margin-bottom: 0px; 288 | padding: 20px 10px 20px 35px; 289 | font-size: 14px; 290 | list-style-type: disc; 291 | } 292 | 293 | .article-copyright a { 294 | text-decoration: none; 295 | color: #1e6bb8; 296 | word-wrap: break-word; 297 | font-weight: bold; 298 | border-bottom: 1px solid #1e6bb8; 299 | } 300 | 301 | .article-copyright a:hover { 302 | color: #ff7242; 303 | border-bottom: 1px solid #ff7242; 304 | } -------------------------------------------------------------------------------- /assets/js/automenu.js: -------------------------------------------------------------------------------- 1 | /* 2 | * blogMenu plugin 1.0 2017-09-01 by cary 3 | * 说明:自动根据标签(h3,h4)生成博客目录 4 | */ 5 | (function ($) { 6 | 7 | var Menu = (function () { 8 | /** 9 | * 插件实例化部分,初始化时调用的代码可以放这里 10 | * @param element 传入jq对象的选择器,如 $("#J_plugin").plugin() ,其中 $("#J_plugin") 即是 element 11 | * @param options 插件的一些参数神马的 12 | * @constructor 13 | */ 14 | var Plugin = function(element, options) { 15 | //将dom jquery对象赋值给插件,方便后续调用 16 | this.$element = $(element); 17 | 18 | //将插件的默认参数及用户定义的参数合并到一个新的obj里 19 | this.settings = $.extend({}, $.fn.autoMenu.defaults, typeof options === 'object' && options) 20 | //如果将参数设置在dom的自定义属性里,也可以这样写 21 | //this.settings = $.extend({}, $.fn.plugin.defaults, this.$element.data(), options); 22 | 23 | this.init(); 24 | } 25 | 26 | /** 27 | * 将插件所有函数放在prototype的大对象里 28 | * 插件的公共方法,相当于接口函数,用于给外部调用 29 | * @type {{}} 30 | */ 31 | Plugin.prototype = { 32 | init: function () { 33 | var opts = this.settings; 34 | 35 | //console.log(opts) 36 | this.$element.html(this.createHtml()); 37 | this.setActive(); 38 | this.bindEvent(); 39 | }, 40 | createHtml: function() { 41 | var that = this; 42 | var opts = that.settings; 43 | var width = typeof opts.width === 'number' && opts.width; 44 | var height = typeof opts.height === 'number' && opts.height; 45 | 46 | var footHeight = $("#site-footer").height(); 47 | var windowHeight = $(window).height(); 48 | if (height > windowHeight - footHeight - 40 - 28 - 42.78) { 49 | height = windowHeight - footHeight - 40 - 28 - 42.78; 50 | } 51 | that.$element.width(width); 52 | var html = ''; 53 | var num = 0; 54 | var num1 = 0; 55 | var num2 = 0; 56 | $('*').each(function(){ 57 | var _this = $(this); 58 | if (_this.get(0).tagName == opts.levelOne.toUpperCase()) { 59 | _this.attr('id',num); 60 | var nodetext = that.handleTxt(_this.html()); 61 | html += '
  • '+ nodetext +'
  • '; 62 | num++; 63 | num1++; 64 | } else if (_this.get(0).tagName == opts.levelTwo.toUpperCase()) { 65 | _this.attr('id',num); 66 | var nodetext = that.handleTxt(_this.html()); 67 | html += '
  • '+ nodetext +'
  • '; 68 | num++; 69 | num2++; 70 | } 71 | }) 72 | html += ''; 73 | if (height > 14*2 + 38*num1 + 26*num2) { 74 | height = 14*2 + 38*num1 + 26*num2; 75 | } 76 | var htmlStart = '