From c0f97d25d0071ca962600f92903b9eb64de9e388 Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Thu, 1 Feb 2018 23:09:21 -0500 Subject: [PATCH 1/2] This commit should add a new layout called "queen," a bigger version of the "single" layout that puts the right sidebar on top. --- _layouts/queen.html | 95 ++++++++++++++++++++++++++++ _sass/minimal-mistakes/_page.scss | 20 ++++++ _sass/minimal-mistakes/_sidebar.scss | 18 ++++++ 3 files changed, 133 insertions(+) create mode 100644 _layouts/queen.html diff --git a/_layouts/queen.html b/_layouts/queen.html new file mode 100644 index 000000000000..29df38d04adb --- /dev/null +++ b/_layouts/queen.html @@ -0,0 +1,95 @@ +--- +layout: default +--- + +{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} + {% include page__hero.html %} +{% elsif page.header.video.id and page.header.video.provider %} + {% include page__hero_video.html %} +{% endif %} + +{% if page.url != "/" and site.breadcrumbs %} + {% unless paginator %} + {% include breadcrumbs.html %} + {% endunless %} +{% endif %} + +
+ {% include sidebar.html %} + + {% comment %}{% endcomment %} +
+
+ {% if page.title %}{% endif %} + {% if page.excerpt %}{% endif %} + {% if page.date %}{% endif %} + {% if page.last_modified_at %}{% endif %} + +
+ {% unless page.header.overlay_color or page.header.overlay_image %} +
+ {% if page.title %}

{{ page.title | markdownify | remove: "

" | remove: "

" }}

{% endif %} + {% if page.read_time %} +

{% include read-time.html %}

+ {% endif %} +
+ {% endunless %} + +
+ {% if page.toc %} + + {% endif %} + {{ content }} + {% if page.link %}{% endif %} +
+ +
+ {% if site.data.ui-text[site.locale].meta_label %} +

{{ site.data.ui-text[site.locale].meta_label }}

+ {% endif %} + {% include page__taxonomy.html %} + {% if page.last_modified_at %} +

{{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}

+ {% elsif page.date %} +

{{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}

+ {% endif %} +
+ + {% if page.share %}{% include social-share.html %}{% endif %} + + {% include post_pagination.html %} +
+ + {% if jekyll.environment == 'production' and site.comments.provider and page.comments %} + {% include comments.html %} + {% endif %} +
+ + {% comment %}{% endcomment %} + {% if page.id and page.related and site.related_posts.size > 0 %} + + {% comment %}{% endcomment %} + {% elsif page.id and page.related %} + + {% endif %} +
+
diff --git a/_sass/minimal-mistakes/_page.scss b/_sass/minimal-mistakes/_page.scss index 600f076828d4..d0428006742e 100644 --- a/_sass/minimal-mistakes/_page.scss +++ b/_sass/minimal-mistakes/_page.scss @@ -52,6 +52,16 @@ } } +.queen .page { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } +} + .page__title { margin-top: 0; line-height: 1; @@ -419,6 +429,16 @@ } } +.queen .page__related { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } +} + .page__related-title { margin-bottom: 10px; font-size: $type-size-6; diff --git a/_sass/minimal-mistakes/_sidebar.scss b/_sass/minimal-mistakes/_sidebar.scss index aebb0e880363..151a8ea6c801 100644 --- a/_sass/minimal-mistakes/_sidebar.scss +++ b/_sass/minimal-mistakes/_sidebar.scss @@ -94,6 +94,24 @@ } } +.queen .sidebar__right { + margin-bottom: 1em; + @include breakpoint($large) { + position: initial; + top: initial; + right: initial; + width: initial; + margin-right: initial; + padding-left: initial; + z-index: initial; + } + + @include breakpoint($x-large) { + width: initial; + margin-right: initial; + } +} + /* Author profile and links ========================================================================== */ From c95473a94b4b1262abb70bd1e52edec3fe7008fd Mon Sep 17 00:00:00 2001 From: Peter Ahrens Date: Fri, 2 Feb 2018 09:18:39 -0500 Subject: [PATCH 2/2] Taking the more elegant approach --- _layouts/queen.html | 95 ---------------------------- _sass/minimal-mistakes/_page.scss | 46 ++++++++------ _sass/minimal-mistakes/_sidebar.scss | 41 ++++++------ 3 files changed, 49 insertions(+), 133 deletions(-) delete mode 100644 _layouts/queen.html diff --git a/_layouts/queen.html b/_layouts/queen.html deleted file mode 100644 index 29df38d04adb..000000000000 --- a/_layouts/queen.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -layout: default ---- - -{% if page.header.overlay_color or page.header.overlay_image or page.header.image %} - {% include page__hero.html %} -{% elsif page.header.video.id and page.header.video.provider %} - {% include page__hero_video.html %} -{% endif %} - -{% if page.url != "/" and site.breadcrumbs %} - {% unless paginator %} - {% include breadcrumbs.html %} - {% endunless %} -{% endif %} - -
- {% include sidebar.html %} - - {% comment %}{% endcomment %} -
-
- {% if page.title %}{% endif %} - {% if page.excerpt %}{% endif %} - {% if page.date %}{% endif %} - {% if page.last_modified_at %}{% endif %} - -
- {% unless page.header.overlay_color or page.header.overlay_image %} -
- {% if page.title %}

{{ page.title | markdownify | remove: "

" | remove: "

" }}

{% endif %} - {% if page.read_time %} -

{% include read-time.html %}

- {% endif %} -
- {% endunless %} - -
- {% if page.toc %} - - {% endif %} - {{ content }} - {% if page.link %}{% endif %} -
- -
- {% if site.data.ui-text[site.locale].meta_label %} -

{{ site.data.ui-text[site.locale].meta_label }}

- {% endif %} - {% include page__taxonomy.html %} - {% if page.last_modified_at %} -

{{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}

- {% elsif page.date %} -

{{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}

- {% endif %} -
- - {% if page.share %}{% include social-share.html %}{% endif %} - - {% include post_pagination.html %} -
- - {% if jekyll.environment == 'production' and site.comments.provider and page.comments %} - {% include comments.html %} - {% endif %} -
- - {% comment %}{% endcomment %} - {% if page.id and page.related and site.related_posts.size > 0 %} - - {% comment %}{% endcomment %} - {% elsif page.id and page.related %} - - {% endif %} -
-
diff --git a/_sass/minimal-mistakes/_page.scss b/_sass/minimal-mistakes/_page.scss index d0428006742e..c5c1f38060a0 100644 --- a/_sass/minimal-mistakes/_page.scss +++ b/_sass/minimal-mistakes/_page.scss @@ -52,16 +52,6 @@ } } -.queen .page { - @include breakpoint($large) { - padding-right: 0; - } - - @include breakpoint($x-large) { - padding-right: 0; - } -} - .page__title { margin-top: 0; line-height: 1; @@ -429,18 +419,34 @@ } } -.queen .page__related { - @include breakpoint($large) { - padding-right: 0; - } - - @include breakpoint($x-large) { - padding-right: 0; - } -} - .page__related-title { margin-bottom: 10px; font-size: $type-size-6; text-transform: uppercase; } + +/* + Wide Pages + ========================================================================== */ + +.wide { + .page { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } + } + + .page__related { + @include breakpoint($large) { + padding-right: 0; + } + + @include breakpoint($x-large) { + padding-right: 0; + } + } +} diff --git a/_sass/minimal-mistakes/_sidebar.scss b/_sass/minimal-mistakes/_sidebar.scss index 151a8ea6c801..808324cc69f1 100644 --- a/_sass/minimal-mistakes/_sidebar.scss +++ b/_sass/minimal-mistakes/_sidebar.scss @@ -94,24 +94,6 @@ } } -.queen .sidebar__right { - margin-bottom: 1em; - @include breakpoint($large) { - position: initial; - top: initial; - right: initial; - width: initial; - margin-right: initial; - padding-left: initial; - z-index: initial; - } - - @include breakpoint($x-large) { - width: initial; - margin-right: initial; - } -} - /* Author profile and links ========================================================================== */ @@ -290,3 +272,26 @@ } } } + +/* + Wide Pages + ========================================================================== */ + +.wide .sidebar__right { + margin-bottom: 1em; + @include breakpoint($large) { + position: initial; + top: initial; + right: initial; + width: initial; + margin-right: initial; + padding-left: initial; + z-index: initial; + } + + @include breakpoint($x-large) { + width: initial; + margin-right: initial; + } +} +