diff --git a/layout/_common/config.pug b/layout/_common/config.pug index ad111045a85f0b9886dab4f7a61d18fa8865d338..90c85e7ca5e54abfeede4a9d768da18912bdf944 100644 --- a/layout/_common/config.pug +++ b/layout/_common/config.pug @@ -1,5 +1,5 @@ - - var algolia = 'undefined'; + var algolia = "undefined"; var env = process.env; if (theme.algolia_search.enable) { algolia = JSON.stringify({ @@ -15,14 +15,14 @@ }); } - var sidebar = 'undefined'; + var sidebar = "undefined"; if (theme.sidebar.enable) { sidebar = JSON.stringify({ offsetTop: theme.sidebar.offsetTop }); } - var back2top = 'undefined'; + var back2top = "undefined"; if (theme.back2top.enable) { back2top = JSON.stringify({ enable: theme.back2top.enable, @@ -30,22 +30,22 @@ }); } - var gallery_waterfall = 'undefined'; + var gallery_waterfall = "undefined"; if (theme.gallery_waterfall.enable) { gallery_waterfall = JSON.stringify(theme.gallery_waterfall); } - var lazyload = 'undefined'; + var lazyload = "undefined"; if (theme.lazyload.enable) { lazyload = JSON.stringify(theme.lazyload); } - var zoom_image = 'undefined'; + var zoom_image = "undefined"; if (theme.zoom_image.enable) { zoom_image = JSON.stringify(theme.zoom_image); } - var external_link = 'undefined'; + var external_link = "undefined"; if (theme.external_link.icon.enable) { external_link = JSON.stringify({ icon: { diff --git a/layout/_common/footer.pug b/layout/_common/footer.pug index 57f09b916a13322699f2aa0dba91663f8f402dfa..dca7742d1775301c2b9f36f60c73e451ac09fdbf 100644 --- a/layout/_common/footer.pug +++ b/layout/_common/footer.pug @@ -18,12 +18,12 @@ footer#footer ).footer-separator else span= " " - + span= footer.copyright.text || config.author + "." if footer.copyright.enable && footer.beian.enable span.footer-separator= "|" - + if footer.beian.enable span!= footer.beian.icp @@ -33,10 +33,10 @@ footer#footer span.footer-powered - var HEXO_URL = "http://hexo.io/"; != _p("footer.powered", link_to(HEXO_URL, "hexo", { external: true })) - + if footer.powered.version span= " v" + hexo_env("version") + "." - + if footer.powered.enable && footer.theme.enable span.footer-separator= "|" @@ -44,10 +44,10 @@ footer#footer span= _p("footer.theme") + " - " - var STUN_URL = "https://github.com/liuyib/hexo-theme-stun/"; != link_to(STUN_URL, "stun", { external: true }) - + if footer.theme.version span= " v" + stun_env("version") + "." - + if theme.busuanzi.enable include ../_components/analytics/busuanzi.pug diff --git a/layout/_common/head.pug b/layout/_common/head.pug index bbefa7150765e3aea4e9d6ff339e06aa51cf7823..51f094a6679f8ecfa3b9fc750d488cd7da9e1300 100644 --- a/layout/_common/head.pug +++ b/layout/_common/head.pug @@ -32,7 +32,7 @@ meta(name="apple-mobile-web-app-status-bar-style" content="black") if theme.pwa && theme.pwa.enable if theme.pwa.theme_color meta(name="theme-color" content=theme.pwa.theme_color) - + if theme.pwa.manifest link(rel="manifest" href=`${url_for(theme.pwa.manifest)}?v=${stun_env("version")}`) diff --git a/layout/_common/layout.pug b/layout/_common/layout.pug index ad937da5e82deed817c211a6a6363af1cce91019..524d4a8d9bc2a0251aba9ed7b6ddf298071f165c 100644 --- a/layout/_common/layout.pug +++ b/layout/_common/layout.pug @@ -10,7 +10,7 @@ html(lang=config.language) if theme.back2top.enable include ../_components/back2top.pug - + include ../_components/search/index.pug include ../_scripts/cdn.pug include ../_scripts/common.pug diff --git a/layout/_common/main.pug b/layout/_common/main.pug index c3384981975c58e72c8726ef0114e79286f8eb1e..f11e04d7b910a384b0cfede8c0750e56329f15eb 100644 --- a/layout/_common/main.pug +++ b/layout/_common/main.pug @@ -2,13 +2,13 @@ main#main div.main-inner if theme.sidebar.enable include ./sidebar.pug - + if body div!= body else block content - + if page.comments include ../_components/comments.pug - + div.clearfix diff --git a/layout/_components/analytics/busuanzi.pug b/layout/_components/analytics/busuanzi.pug index 2bb85b1f333a4632ba33d08264871c3c237a833a..b85329b076c71ef6818acca1725f98a6694263e9 100644 --- a/layout/_components/analytics/busuanzi.pug +++ b/layout/_components/analytics/busuanzi.pug @@ -5,17 +5,17 @@ div.busuanzi if !theme.busuanzi.site.icon_only span= _p("footer.uv") + " " - + span#busuanzi_value_site_uv - + if theme.busuanzi.site.uv.enable && theme.busuanzi.site.pv.enable span.separator= "|" if theme.busuanzi.site.pv.enable span.busuanzi-pv i.fa.fa-eye - + if !theme.busuanzi.site.icon_only span= _p("footer.pv") + " " - + span#busuanzi_value_site_pv diff --git a/layout/_components/pagination.pug b/layout/_components/pagination.pug index e84af961fd44f0c93ddcfb54a3f9678596b2ba13..3d10d7e2c26ac06e6b952433b9975e4b15809b49 100644 --- a/layout/_components/pagination.pug +++ b/layout/_components/pagination.pug @@ -15,7 +15,7 @@ nav#paginator a(href=url_for(page.prev.path)) i.fa.fa-chevron-left span.title= page.prev.title || _p("post.untitled") - + if (page.next) div.article-next.pull-right a(href=url_for(page.next.path)) diff --git a/layout/_components/recent-posts.pug b/layout/_components/recent-posts.pug index bc871f0324ac3279514f8240d147fcb7bedbb469..933884a485d922d22c14fe8c13bf80106eda8e77 100644 --- a/layout/_components/recent-posts.pug +++ b/layout/_components/recent-posts.pug @@ -5,14 +5,14 @@ section#recent-posts.recent-posts - postLists.each(function (post) { article(class=`${post.link ? 'post-link' : ''}`).post +postHeader(post) - + div.post-body if theme.post_list.cover_image.home && post.top_image img(src=post.top_image) - + if post.photos && post.photos.length +gallery(post) - + if theme.auto_excerpt && theme.auto_excerpt.enable - const content = strip_html(post.content) - var excerpt = content.substring(0, theme.auto_excerpt.length) diff --git a/layout/_components/search/algolia.pug b/layout/_components/search/algolia.pug index c399c6f1220ba85901f7bde33ba9ccc7774219fb..7be4b219fb9f9eec670d409828c465ac05228811 100644 --- a/layout/_components/search/algolia.pug +++ b/layout/_components/search/algolia.pug @@ -3,11 +3,11 @@ div.search-mask div.search-popup span.search-close div.search-input - + div.search-results div#algolia-hits - + div#algolia-pagination - + if theme.algolia_search.labels.show_stats div#algolia-stats diff --git a/layout/_mixins/post-header.pug b/layout/_mixins/post-header.pug index 53461a793e9ade9b04b063d90f0c19e30be3c64f..6dba143b2eb265430aee74af4ac413600bd9fe61 100644 --- a/layout/_mixins/post-header.pug +++ b/layout/_mixins/post-header.pug @@ -2,7 +2,7 @@ mixin postHeader(post) header.post-header if post.top include ../_components/sticky-top.pug - + if is_post() h1.post-title= post.title || _p("post.untitled") else @@ -14,7 +14,7 @@ mixin postHeader(post) h1.post-title a(href=url_for(post.path) ).post-title-link= post.title || _p("post.untitled") - + if !post.link div.post-meta if theme.post_meta.created.enable @@ -24,7 +24,7 @@ mixin postHeader(post) if !theme.post_meta.icon_only span= _p("post.posted") + " " span= full_date(post.date, "YYYY-MM-DD") - + if theme.post_meta.updated.enable span.post-update i(class=`fa fa-${theme.post_meta.updated.icon}`) @@ -32,7 +32,7 @@ mixin postHeader(post) if !theme.post_meta.icon_only span= _p("post.updated") + " " span= full_date(post.updated, "YYYY-MM-DD") - + if theme.post_meta.word_count.enable span.post-word-count i(class=`fa fa-${theme.post_meta.word_count.icon}`) @@ -40,12 +40,12 @@ mixin postHeader(post) if !theme.post_meta.icon_only span= _p("post.word_count") + " " span= wordcount(post.content) - + if theme.post_meta.reading_time.enable - var postReadingTime = theme.post_meta.reading_time span.post-reading-time i(class=`fa fa-${postReadingTime.icon}`) - + if !theme.post_meta.icon_only span= _p("post.reading_time") + " " - var READING_TIME_UNIT = "m"; @@ -64,8 +64,8 @@ mixin postHeader(post) if theme.busuanzi.enable && theme.busuanzi.post_pv.enable span.post-reading-count i(class=`fa fa-${theme.busuanzi.post_pv.icon}`) - + if !theme.post_meta.icon_only && !theme.busuanzi.post_pv.icon_only span= _p("post.reading_count") + " " - + span#busuanzi_value_page_pv diff --git a/layout/_mixins/posts-sort.pug b/layout/_mixins/posts-sort.pug index a55567613fc2af68eef91824f39db0eaa43fcfc4..428867536f56334c797c713499f42159ba774ad0 100644 --- a/layout/_mixins/posts-sort.pug +++ b/layout/_mixins/posts-sort.pug @@ -4,11 +4,11 @@ mixin articleSort(posts) - posts.each(function (post) { if post.date - tmpYear = full_date(post.date, "YYYY") - + if tmpYear !== year - year = tmpYear time.article-sort-item.year= year - + post.article-sort-item if post.date time.article-sort-item__time= full_date(post.date, "MM-DD") diff --git a/layout/_third-party/analytics/busuanzi.pug b/layout/_third-party/analytics/busuanzi.pug index 3465ed7ef472e0b1afc31d7af13c828373fcae8f..37e612087c8ab2ab006551f83aabfbc6f8cb8dcd 100644 --- a/layout/_third-party/analytics/busuanzi.pug +++ b/layout/_third-party/analytics/busuanzi.pug @@ -1,6 +1,5 @@ - var busuanzi_js = "https://cdn.jsdelivr.net/gh/sukkaw/busuanzi@latest/bsz.pure.mini.js" - if (theme.cdn.busuanzi) busuanzi_js = theme.cdn.busuanzi script(async src=busuanzi_js) diff --git a/layout/_third-party/comments/index.pug b/layout/_third-party/comments/index.pug index 5be2d669d9d9a8e4eb3a817305519de69d7b4500..9cd1b9e28385f32ae0f3d73812a3f9d117ce8939 100644 --- a/layout/_third-party/comments/index.pug +++ b/layout/_third-party/comments/index.pug @@ -10,4 +10,4 @@ if page.comments else if theme.valine && theme.valine.enable include ./valine.pug else if theme.valine && theme.valine.enable && theme.valine.visitor - include ./valine.pug + include ./valine.pug diff --git a/layout/_third-party/search/localsearch.pug b/layout/_third-party/search/localsearch.pug index aadac497b12d0dada678ae37aec2773010366760..8e2155579f7edd381d611fbfd96210cd94e440f8 100644 --- a/layout/_third-party/search/localsearch.pug +++ b/layout/_third-party/search/localsearch.pug @@ -122,8 +122,7 @@ if theme.local_search.enable // 索引位置相同的关键词,保留长度较长的 titleHitSlice.forEach(function (hit) { - if (hit.index === index && - hit.word.length < word.length) { + if (hit.index === index && hit.word.length < word.length) { hit.word = word; hasMatch = true; } diff --git a/layout/archive.pug b/layout/archive.pug index 882c8bd5b63821294a751f9363c5b5227ce81d6b..5b74a648b4ad671e3f6c0bf9909f8ed0100eebc0 100644 --- a/layout/archive.pug +++ b/layout/archive.pug @@ -15,6 +15,6 @@ block content +articleSort(page.posts) else +articleSort(site.posts) - + if theme.post_list.paginate.archives include ./_components/pagination.pug diff --git a/layout/category.pug b/layout/category.pug index 5e6cf8557a34ef7265348471ddd5b146dfbd5902..14d0e1e0ec9b26a40a31c3bb5cac1d5e11a643e4 100644 --- a/layout/category.pug +++ b/layout/category.pug @@ -2,7 +2,7 @@ extends ./_common/layout.pug block content include ./_mixins/posts-sort.pug - + div.content div.category-inner div.article-sort-title= _p("page.categories") + " - " + page.category diff --git a/layout/index.pug b/layout/index.pug index cdfe9637b0e06ee28241d2df1bd0e288404c4b21..2d7ad0dd2e7f4d5091d5757552a4a9af250f41ed 100644 --- a/layout/index.pug +++ b/layout/index.pug @@ -3,7 +3,7 @@ extends ./_common/layout.pug block content include ./_mixins/posts-sort.pug include ./_mixins/post-header.pug - + div.content.home-content.code-highlight if theme.post_list.paginate.home include ./_components/recent-posts.pug diff --git a/layout/page.pug b/layout/page.pug index a580ce1104f7cb81f4c9b8648978ee5785615403..782b037e2d99a3bd7c27cf4b8c921892369bb806 100644 --- a/layout/page.pug +++ b/layout/page.pug @@ -7,7 +7,7 @@ block content div.content.tag-cloud if page.photos && page.photos.length +gallery(page) - + div.tag-cloud-title= _p("page.tags") + " - " span.tag-cloud-num= site.tags.length - var min_font = theme.tag_cloud ? theme.tag_cloud.min_size : 14 @@ -19,7 +19,7 @@ block content div.content.category if page.photos && page.photos.length +gallery(page) - + div.category-title= _p("page.categories") + " - " span.category-num= site.categories.length != list_categories() @@ -27,11 +27,11 @@ block content div.content.headings.code-highlight if page.photos && page.photos.length +gallery(page) - + != page.content else div.content.headings.code-highlight if page.photos && page.photos.length +gallery(page) - + != page.content diff --git a/layout/post.pug b/layout/post.pug index f282c22b29aad2d10dc3f7354263e0dc6614433b..db8f8e25cbcc268c19d8d43c9ae9af930816cd61 100644 --- a/layout/post.pug +++ b/layout/post.pug @@ -3,14 +3,14 @@ extends ./_common/layout.pug block content include ./_mixins/post-header.pug include ./_mixins/gallery.pug - + div.content.headings.code-highlight +postHeader(page) - + div.post-body if page.photos && page.photos.length +gallery(page) - + != page.content footer.post-footer @@ -19,7 +19,7 @@ block content span= "------" span= _p("post.end") span= "------" - + - let themeConfigCC = theme.creative_commons.enable && theme.creative_commons.post if page.copyright === false ? page.copyright : themeConfigCC include ./_components/copyright.pug @@ -30,8 +30,8 @@ block content i.fa.fa-tags.icon each tag in page.tags.data span!= link_to(tag.permalink, tag.name) - + if page.reward === false ? page.reward : (theme.reward && theme.reward.enable) include ./_components/reward.pug - + include ./_components/pagination.pug diff --git a/layout/tag.pug b/layout/tag.pug index 951da81436e42ead546312088c4b1ece7dbbe662..64452da834adc73558b1c761ebeffdd0e150d301 100644 --- a/layout/tag.pug +++ b/layout/tag.pug @@ -2,7 +2,7 @@ extends ./_common/layout.pug block content include ./_mixins/posts-sort.pug - + div.content div.tag-inner div.article-sort-title= _p("page.tags") + " - " + page.tag diff --git a/source/css/_components/external-link.styl b/source/css/_components/external-link.styl index e0ac4fc8c4152f1e87e2cacd3f474839281ab399..9187777e915759982f731c7ce4e540a134df1f7e 100644 --- a/source/css/_components/external-link.styl +++ b/source/css/_components/external-link.styl @@ -5,8 +5,8 @@ .footer-inner .external-link i - color: #fff font-size: .7em + color: #fff .post-title .external-link i diff --git a/source/css/_components/search/common.styl b/source/css/_components/search/common.styl index eaa37ed2f4f5f74b60209d8b02d8fedef78b93e4..c0edfa029097589688e577e049f21f6d7762d8fb 100644 --- a/source/css/_components/search/common.styl +++ b/source/css/_components/search/common.styl @@ -59,7 +59,7 @@ width: 1rem height: .2rem background-color: $black-light - + @extend .anime-close .search-results diff --git a/source/css/_components/search/localsearch.styl b/source/css/_components/search/localsearch.styl index 77c9688c22665f1ab7e80b7df35de446f5c687cd..2a9a6d81b9a7a429511441868cf28eaedfb04123 100644 --- a/source/css/_components/search/localsearch.styl +++ b/source/css/_components/search/localsearch.styl @@ -32,7 +32,7 @@ &:hover color: $blue-light - + b color: $blue-light diff --git a/source/css/_components/tag-plugin/note.styl b/source/css/_components/tag-plugin/note.styl index 2eb8c41e759ac7682cb93c7c4c41fb40f6f8ae07..581e08a575f6509e93c5758176a155b7c6bd21b5 100644 --- a/source/css/_components/tag-plugin/note.styl +++ b/source/css/_components/tag-plugin/note.styl @@ -56,7 +56,12 @@ strong color: #dc3b3b - h1, h2, h3, h4, h5, h6 + h1, + h2, + h3, + h4, + h5, + h6 margin: 0 strong