-
{##########################}
{### END CATEGORY BLOCK ###}
diff --git a/layout/index.swig b/layout/index.swig
index 4fbfe62871..39c6f538e3 100644
--- a/layout/index.swig
+++ b/layout/index.swig
@@ -3,10 +3,6 @@
{% block title %}{{ title }}{%- if theme.index_with_subtitle and subtitle %} - {{ subtitle }}{%- endif %}{% endblock %}
-{% block page_class %}
- {%- if is_home() %}page-home{% endif -%}
-{% endblock %}
-
{% block content %}
{%- for post in page.posts %}
diff --git a/layout/page.swig b/layout/page.swig
index 4bc30b3ab6..4698f0d6f7 100644
--- a/layout/page.swig
+++ b/layout/page.swig
@@ -15,8 +15,6 @@
#}{%- endif %}{#
#}{% endblock %}
-{% block page_class %}page-post-detail{% endblock %}
-
{% block content %}
<{%- if theme.seo %}h2{% else %}h1{%- endif %} class="collection-header">{#
@@ -21,7 +20,6 @@
{{ post_template.render(page.posts) }}
-
diff --git a/layout/post.swig b/layout/post.swig
index ba5132dea2..4a3a406983 100644
--- a/layout/post.swig
+++ b/layout/post.swig
@@ -3,8 +3,6 @@
{% block title %}{{ page.title }} | {{ title }}{% endblock %}
-{% block page_class %}page-post-detail{% endblock %}
-
{% block content %}
diff --git a/layout/tag.swig b/layout/tag.swig
index bcc902bacb..302a27b36c 100644
--- a/layout/tag.swig
+++ b/layout/tag.swig
@@ -10,7 +10,6 @@
{### TAG BLOCK ###}
{#################}
+
<{%- if theme.seo %}h3{% else %}h2{%- endif %} class="post-title">
diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig
index 450e59655e..651ac0b0d5 100644
--- a/layout/_macro/post.swig
+++ b/layout/_macro/post.swig
@@ -1,8 +1,8 @@
-
+
{##################}
{### POST BLOCK ###}
{##################}
-
-
{#####################}
{### END TAG BLOCK ###}
diff --git a/source/css/_common/components/post/post-expand.styl b/source/css/_common/components/post/post-expand.styl
index cdac6a3b64..3f47768f0c 100644
--- a/source/css/_common/components/post/post-expand.styl
+++ b/source/css/_common/components/post/post-expand.styl
@@ -1,14 +1,12 @@
.posts-expand {
padding-top: 40px;
-}
-+mobile() {
- .posts-expand {
+ +mobile() {
margin: 0 20px;
}
}
-.posts-expand .post-body {
+.post-body {
+desktop() {
text-align: unquote(hexo-config('text_align.desktop'));
}
diff --git a/source/css/_common/components/tags/group-pictures.styl b/source/css/_common/components/tags/group-pictures.styl
index a19aba65ed..71caca067b 100644
--- a/source/css/_common/components/tags/group-pictures.styl
+++ b/source/css/_common/components/tags/group-pictures.styl
@@ -1,4 +1,4 @@
-.post .post-body .group-picture {
+.post-body .group-picture {
img {
border: 0;
box-sizing: border-box;
@@ -16,22 +16,3 @@
float: left;
margin-bottom: 10px;
}
-
-.page-archive {
- .group-picture-container {
- overflow: hidden;
- }
-
- .group-picture-row {
- float: left;
-
- &:first-child {
- margin-top: 6px;
- }
- }
-
- .group-picture-column {
- max-height: 150px;
- max-width: 150px;
- }
-}
diff --git a/source/css/_common/scaffolding/mobile.styl b/source/css/_common/scaffolding/mobile.styl
index a365f10718..1b77babdc4 100644
--- a/source/css/_common/scaffolding/mobile.styl
+++ b/source/css/_common/scaffolding/mobile.styl
@@ -45,12 +45,9 @@
}
}
- > * {
- margin-bottom: 10px !important;
- }
-
// For paragraphs narrow width.
> p {
+ margin: 0 0 10px 0;
padding: 0 18px;
}
@@ -79,7 +76,12 @@
padding: 0 5px;
}
+ img, video {
+ margin-bottom: 10px !important;
+ }
+
.note {
+ margin-bottom: 10px !important;
padding: 10px !important;
if (hexo-config('note.icons')) {
diff --git a/source/css/_common/scaffolding/tables.styl b/source/css/_common/scaffolding/tables.styl
index 1900563e05..6cfb8729ba 100644
--- a/source/css/_common/scaffolding/tables.styl
+++ b/source/css/_common/scaffolding/tables.styl
@@ -1,17 +1,13 @@
.table-container {
-webkit-overflow-scrolling: touch;
- margin: 20px 0;
overflow: auto;
}
-.highlight .table-container {
- margin: 0;
-}
-
table {
border-collapse: collapse;
border-spacing: 0;
font-size: $table-font-size;
+ margin: 0 0 20px 0;
width: $table-width;
}
diff --git a/source/css/_schemes/Mist/_posts-expanded.styl b/source/css/_schemes/Mist/_posts-expand.styl
similarity index 92%
rename from source/css/_schemes/Mist/_posts-expanded.styl
rename to source/css/_schemes/Mist/_posts-expand.styl
index 94206b6e41..2b6a0b8a1b 100644
--- a/source/css/_schemes/Mist/_posts-expanded.styl
+++ b/source/css/_schemes/Mist/_posts-expand.styl
@@ -1,16 +1,8 @@
-// Post Expanded
+// Post Expand
// --------------------------------------------------
.posts-expand {
padding-top: 0;
- .post-title, .post-meta {
- text-align: $site-meta-text-align;
-
- +mobile() {
- text-align: center;
- }
- }
-
.post-eof {
display: none;
}
@@ -23,15 +15,19 @@
margin-top: 0;
}
+ .post-title, .post-meta {
+ text-align: $site-meta-text-align;
+
+ +mobile() {
+ text-align: center;
+ }
+ }
+
.post-meta {
margin-bottom: 20px;
margin-top: 5px;
}
- .post-title:hover::before {
- background: $black-deep;
- }
-
.post-body img {
margin-left: 0;
}
diff --git a/source/css/_schemes/Mist/index.styl b/source/css/_schemes/Mist/index.styl
index 57d50c2afc..045d9ac552 100644
--- a/source/css/_schemes/Mist/index.styl
+++ b/source/css/_schemes/Mist/index.styl
@@ -5,7 +5,7 @@
@import '_header';
@import '_logo';
@import '_menu';
-@import '_posts-expanded';
+@import '_posts-expand';
@import '../Muse/_sidebar';
// Components
@@ -30,22 +30,6 @@
}
}
-// Page - Post details
-// --------------------------------------------------
-.page-post-detail {
- .post-title, .post-meta {
- text-align: center;
- }
-
- .post-title::before {
- display: none;
- }
-
- .post-meta {
- margin-bottom: 60px;
- }
-}
-
// Pagination
// --------------------------------------------------
.pagination {
From 16b85996ffc78968e5c65519b694c9981498753d Mon Sep 17 00:00:00 2001
From: StevenJoeZhang <1119186082@qq.com>
Date: Sat, 24 Aug 2019 16:51:35 +0800
Subject: [PATCH 6/7] class
---
layout/_macro/post-collapse.swig | 2 +-
layout/_macro/post.swig | 4 +--
layout/_macro/sidebar.swig | 8 +++---
layout/_partials/sidebar/site-overview.swig | 2 +-
layout/index.swig | 4 +--
.../components/post/post-collapse.styl | 2 +-
source/css/_schemes/Mist/_posts-expand.styl | 25 +++++++++++--------
source/css/_schemes/Muse/_sidebar.styl | 8 ++++++
source/css/_schemes/Pisces/_sidebar.styl | 5 ----
source/js/next-boot.js | 18 +++++++------
source/js/schemes/muse.js | 21 ++++++++--------
11 files changed, 53 insertions(+), 46 deletions(-)
diff --git a/layout/_macro/post-collapse.swig b/layout/_macro/post-collapse.swig
index 4404d5a58c..7a028cce67 100644
--- a/layout/_macro/post-collapse.swig
+++ b/layout/_macro/post-collapse.swig
@@ -11,7 +11,7 @@
{%- endif %}
-
<{%- if theme.seo %}h2{% else %}h1{%- endif %} class="collection-header">{#
@@ -21,7 +20,6 @@
{{ post_template.render(page.posts) }}
-
+
+
{{ partial('_scripts/index.swig', {}, {cache: theme.cache.enable}) }}
diff --git a/layout/_partials/footer.swig b/layout/_partials/footer.swig
index 375ddd04c6..6865f9f8a3 100644
--- a/layout/_partials/footer.swig
+++ b/layout/_partials/footer.swig
@@ -59,4 +59,10 @@
#}
{%- endif %}
+{%- if theme.add_this_id %}
+
diff --git a/layout/_macro/sidebar.swig b/layout/_macro/sidebar.swig
index b38751cb0f..c78b41cadf 100644
--- a/layout/_macro/sidebar.swig
+++ b/layout/_macro/sidebar.swig
@@ -30,17 +30,15 @@
{%- if theme.site_state %}
diff --git a/layout/index.swig b/layout/index.swig
index 39c6f538e3..6af038c4cd 100644
--- a/layout/index.swig
+++ b/layout/index.swig
@@ -4,11 +4,11 @@
{% block title %}{{ title }}{%- if theme.index_with_subtitle and subtitle %} - {{ subtitle }}{%- endif %}{% endblock %}
{% block content %}
-
{%- if display_toc %}
-
{{ toc }}
+ {{ toc }}
{%- endif %}
-
{%- if theme.back2top.enable and theme.back2top.sidebar %}
diff --git a/layout/_partials/sidebar/site-overview.swig b/layout/_partials/sidebar/site-overview.swig
index 0da84d4546..a6dcba5495 100644
--- a/layout/_partials/sidebar/site-overview.swig
+++ b/layout/_partials/sidebar/site-overview.swig
@@ -5,7 +5,7 @@
alt="{{ author }}">
{%- endif %}
- {{ partial('_partials/sidebar/site-overview.swig', {}, {cache: theme.cache.enable}) }}
+ {{ partial('_partials/sidebar/site-overview.swig', {}, {cache: theme.cache.enable}) }}
- {{- next_inject('sidebar') }}
-
+ {{- next_inject('sidebar') }}
{{ author }}
-{{ description }}
+ {{ description }}
{%- for post in page.posts %}
{{ partial('_macro/post.swig', {is_index: true}) }}
{%- endfor %}
-
+
{% include '_partials/pagination.swig' %}
{% endblock %}
diff --git a/source/css/_common/components/post/post-collapse.styl b/source/css/_common/components/post/post-collapse.styl
index 30caac9774..df946feee0 100644
--- a/source/css/_common/components/post/post-collapse.styl
+++ b/source/css/_common/components/post/post-collapse.styl
@@ -53,7 +53,7 @@
}
}
- .post {
+ article {
margin: 30px 0;
}
diff --git a/source/css/_schemes/Mist/_posts-expand.styl b/source/css/_schemes/Mist/_posts-expand.styl
index 2b6a0b8a1b..2922878c15 100644
--- a/source/css/_schemes/Mist/_posts-expand.styl
+++ b/source/css/_schemes/Mist/_posts-expand.styl
@@ -1,5 +1,19 @@
// Post Expand
// --------------------------------------------------
+.posts-expand .home {
+ .post-title, .post-meta {
+ text-align: $site-meta-text-align;
+
+ +mobile() {
+ text-align: center;
+ }
+ }
+
+ .post-meta {
+ margin: 0 0 20px 0;
+ }
+}
+
.posts-expand {
padding-top: 0;
@@ -16,16 +30,7 @@
}
.post-title, .post-meta {
- text-align: $site-meta-text-align;
-
- +mobile() {
- text-align: center;
- }
- }
-
- .post-meta {
- margin-bottom: 20px;
- margin-top: 5px;
+ text-align: center;
}
.post-body img {
diff --git a/source/css/_schemes/Muse/_sidebar.styl b/source/css/_schemes/Muse/_sidebar.styl
index 3d180b357f..7822a87f09 100644
--- a/source/css/_schemes/Muse/_sidebar.styl
+++ b/source/css/_schemes/Muse/_sidebar.styl
@@ -17,3 +17,11 @@ if (hexo-config('sidebar.position') == 'right') {
left: $b2t-position-right;
}
}
+
+.sidebar {
+ display: none;
+
+ &.sidebar-active {
+ display: block;
+ }
+}
diff --git a/source/css/_schemes/Pisces/_sidebar.styl b/source/css/_schemes/Pisces/_sidebar.styl
index 230e3e1fe9..00d35aba2d 100644
--- a/source/css/_schemes/Pisces/_sidebar.styl
+++ b/source/css/_schemes/Pisces/_sidebar.styl
@@ -39,11 +39,6 @@
}
}
-.site-overview {
- // margin: 0 2px;
- text-align: left;
-}
-
.site-author {
clearfix();
}
diff --git a/source/js/next-boot.js b/source/js/next-boot.js
index e11548a83e..72089eb0ba 100644
--- a/source/js/next-boot.js
+++ b/source/js/next-boot.js
@@ -25,20 +25,22 @@ NexT.boot.registerEvents = function() {
var item = $(event.currentTarget);
var activeTabClassName = 'sidebar-nav-active';
var activePanelClassName = 'sidebar-panel-active';
- if (item.hasClass(activeTabClassName)) return;
var target = $('.' + item.data('target'));
+ if (item.hasClass(activeTabClassName)) {
+ target.find('.motion-element').css({ opacity: 1 });
+ return;
+ }
var currentTarget = target.siblings('.sidebar-panel');
currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, () => {
- currentTarget.hide();
+ // Prevent adding TOC to Overview if Overview was selected when close & open sidebar.
+ currentTarget.removeClass(activePanelClassName);
target
.stop()
- .css({ 'opacity': 0, 'display': 'block' })
- .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, () => {
- // Prevent adding TOC to Overview if Overview was selected when close & open sidebar.
- currentTarget.removeClass(activePanelClassName, 'motion-element');
- target.addClass(activePanelClassName, 'motion-element');
- });
+ .css({ opacity: 0 })
+ .addClass(activePanelClassName)
+ .animate({ opacity: 1 }, TAB_ANIMATE_DURATION)
+ .find('.motion-element').css({ opacity: 1 });
});
item.siblings().removeClass(activeTabClassName);
diff --git a/source/js/schemes/muse.js b/source/js/schemes/muse.js
index 729bb99c6d..2b0019ae65 100644
--- a/source/js/schemes/muse.js
+++ b/source/js/schemes/muse.js
@@ -158,10 +158,9 @@ window.addEventListener('DOMContentLoaded', () => {
var self = this;
if (typeof $.Velocity === 'function') {
- this.sidebarEl.stop().velocity({
+ this.sidebarEl.addClass('sidebar-active').stop().velocity({
width: SIDEBAR_WIDTH
}, {
- display : 'block',
duration: SIDEBAR_DISPLAY_DURATION,
begin : function() {
$.Velocity(document.querySelectorAll('.sidebar .motion-element:not(.site-state)'), isRight ? 'transition.slideRightIn' : 'transition.slideLeftIn', {
@@ -175,17 +174,14 @@ window.addEventListener('DOMContentLoaded', () => {
});
},
complete: function() {
- self.sidebarEl.addClass('sidebar-active');
NexT.utils.initSidebarDimension();
}
});
} else {
- $('.sidebar .motion-element').show();
- this.sidebarEl.stop().animate({
- width : SIDEBAR_WIDTH,
- display: 'block'
+ this.sidebarEl.addClass('sidebar-active').stop().animate({
+ width: SIDEBAR_WIDTH
}, SIDEBAR_DISPLAY_DURATION, () => {
- self.sidebarEl.addClass('sidebar-active');
+ self.sidebarEl.find('.motion-element').css({opacity: 1});
NexT.utils.initSidebarDimension();
});
}
@@ -194,12 +190,15 @@ window.addEventListener('DOMContentLoaded', () => {
NexT.utils.isDesktop() && $('body').stop().animate(isRight ? {'padding-right': SIDEBAR_WIDTH} : {'padding-left': SIDEBAR_WIDTH}, SIDEBAR_DISPLAY_DURATION);
},
hideSidebar: function() {
+ var self = this;
this.isSidebarVisible = false;
- this.sidebarEl.find('.motion-element').hide();
- this.sidebarEl.stop().animate({width: 0, display: 'none'}).removeClass('sidebar-active');
+ this.sidebarEl.find('.motion-element').css({opacity: 0});
+ this.sidebarEl.stop().animate({width: 0}, SIDEBAR_DISPLAY_DURATION, () => {
+ self.sidebarEl.removeClass('sidebar-active');
+ });
sidebarToggleLines.init();
- NexT.utils.isDesktop() && $('body').stop().animate(isRight ? {'padding-right': 0} : {'padding-left': 0});
+ NexT.utils.isDesktop() && $('body').stop().animate(isRight ? {'padding-right': 0} : {'padding-left': 0}, SIDEBAR_DISPLAY_DURATION);
}
};
sidebarToggleMotion.init();
From 292b5d047f616b4dc51437e75111d65c967d86dd Mon Sep 17 00:00:00 2001
From: StevenJoeZhang <1119186082@qq.com>
Date: Sat, 24 Aug 2019 18:24:49 +0800
Subject: [PATCH 7/7] Update
---
layout/_layout.swig | 4 ++--
layout/_partials/footer.swig | 6 ++++++
layout/_partials/widgets.swig | 5 -----
source/css/_common/components/header/github-banner.styl | 6 +++---
source/css/_common/components/sidebar/sidebar-toggle.styl | 2 +-
source/js/next-boot.js | 3 +--
6 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/layout/_layout.swig b/layout/_layout.swig
index 3d0a99d075..3f2bd80b51 100644
--- a/layout/_layout.swig
+++ b/layout/_layout.swig
@@ -32,6 +32,8 @@
{% include '_partials/header/index.swig' %}
+ {{ partial('_partials/widgets.swig', {}, {cache: theme.cache.enable}) }}
+
@@ -56,8 +58,6 @@
{% block footer %}{% endblock %}
-
- {{ partial('_partials/widgets.swig', {}, {cache: theme.cache.enable}) }}
+
+
+{%- endif %}
+
{{- next_inject('footer') }}
diff --git a/layout/_partials/widgets.swig b/layout/_partials/widgets.swig
index fcd9aaf5d2..9d7c9a8d43 100644
--- a/layout/_partials/widgets.swig
+++ b/layout/_partials/widgets.swig
@@ -18,8 +18,3 @@
{{ next_url(github_URL, github_image, {class: 'github-corner', title: github_title, "aria-label": github_title}) }}
{%- endif %}
-{%- if theme.add_this_id %}
-
-
-
-{%- endif %}
diff --git a/source/css/_common/components/header/github-banner.styl b/source/css/_common/components/header/github-banner.styl
index 34f217cc68..97f57b21f4 100644
--- a/source/css/_common/components/header/github-banner.styl
+++ b/source/css/_common/components/header/github-banner.styl
@@ -21,7 +21,7 @@
animation: octocat-wave 560ms ease-in-out;
}
- > svg {
+ svg {
border: 0;
color: white;
fill: $bg-color;
@@ -31,7 +31,7 @@
}
+tablet-mobile() {
- > svg {
+ svg {
if (($scheme == 'Pisces') || ($scheme == 'Gemini')) {
color: $bg-color;
fill: white;
@@ -48,7 +48,7 @@
}
+mobile() {
- > svg {
+ svg {
if ($scheme == 'Mist') {
top: inherit;
diff --git a/source/css/_common/components/sidebar/sidebar-toggle.styl b/source/css/_common/components/sidebar/sidebar-toggle.styl
index ab96942824..d600debe66 100644
--- a/source/css/_common/components/sidebar/sidebar-toggle.styl
+++ b/source/css/_common/components/sidebar/sidebar-toggle.styl
@@ -11,8 +11,8 @@
z-index: $zindex-5;
+tablet-mobile() {
+ left: $b2t-position-right-mobile;
opacity: $b2t-opacity-hover;
- right: $b2t-position-right-mobile;
if (!hexo-config('sidebar.onmobile')) {
display: none;
diff --git a/source/js/next-boot.js b/source/js/next-boot.js
index 72089eb0ba..ecde70777f 100644
--- a/source/js/next-boot.js
+++ b/source/js/next-boot.js
@@ -39,8 +39,7 @@ NexT.boot.registerEvents = function() {
.stop()
.css({ opacity: 0 })
.addClass(activePanelClassName)
- .animate({ opacity: 1 }, TAB_ANIMATE_DURATION)
- .find('.motion-element').css({ opacity: 1 });
+ .animate({ opacity: 1 }, TAB_ANIMATE_DURATION);
});
item.siblings().removeClass(activeTabClassName);