From a3f7639728449b5e14e52a7c72141f7d8b08d596 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 27 May 2017 21:44:42 -0700 Subject: swap kramdown toc for jekyll-toc plugin, update page layout to only show on xl and above --- docs/_layouts/docs.html | 8 ++++++- docs/assets/scss/_content.scss | 44 ------------------------------------ docs/assets/scss/_sidebar.scss | 35 ++++++++++++++++++++++++++++ docs/getting-started/introduction.md | 7 +----- 4 files changed, 43 insertions(+), 51 deletions(-) (limited to 'docs') diff --git a/docs/_layouts/docs.html b/docs/_layouts/docs.html index 540c4c733..58b9482c0 100644 --- a/docs/_layouts/docs.html +++ b/docs/_layouts/docs.html @@ -17,12 +17,18 @@
{% include nav-docs.html %}
-
+

{{ page.title }}

{{ page.description }}

{% include ads.html %} {{ content }}
+ + {% if page.toc %} +
+ {{ content | toc_only }} +
+ {% endif %} diff --git a/docs/assets/scss/_content.scss b/docs/assets/scss/_content.scss index c8749c1d4..33d89d40d 100644 --- a/docs/assets/scss/_content.scss +++ b/docs/assets/scss/_content.scss @@ -5,32 +5,6 @@ // .bd-content { - @include media-breakpoint-up(xl) { - flex: 1; - padding-right: 20%; - - #contents { - display: none; - } - #markdown-toc { - position: fixed; - top: 5rem; - right: 0; - width: 20%; - max-height: calc(100vh - 8rem); - padding-right: 1.5rem; - padding-left: 3rem; - overflow-y: auto; - font-size: .85rem; - } - } - - @media (min-width: 2000px) { - #markdown-toc { - padding-left: 6rem; - } - } - // Hack the sticky header h2[id], h3[id] { @@ -126,21 +100,3 @@ font-weight: 300; } } - - -// -// Markdown generated ToC -// - -#markdown-toc { - // Hide the first child li because it's always going to be "Contents". - > li:first-child { - display: none; - } - - ul { - padding-left: 2rem; - margin-top: .25rem; - margin-bottom: .25rem; - } -} diff --git a/docs/assets/scss/_sidebar.scss b/docs/assets/scss/_sidebar.scss index d8e5f9304..55bed3036 100644 --- a/docs/assets/scss/_sidebar.scss +++ b/docs/assets/scss/_sidebar.scss @@ -4,6 +4,40 @@ // Side navigation // +.bd-toc { + position: sticky; + top: 4rem; + max-height: calc(100vh - 4rem); + padding-top: 1.5rem; + padding-bottom: 1.5rem; + overflow-y: auto; + font-size: .85rem; +} + +.section-nav { + padding-left: 0; + border-left: 1px solid #eee; + + ul { + padding-left: 1rem; + } +} + +.toc-entry { + display: block; + + a { + display: block; + padding: .25rem 1.5rem; + color: #99979c; + + &:hover { + color: $brand-primary; + text-decoration: none; + } + } +} + .bd-sidebar { background-color: #f5f5f5; border-right: 1px solid rgba(0,0,0,.1); @@ -93,6 +127,7 @@ > .bd-sidenav { display: block; + padding-bottom: .75rem; } } } diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md index b07e4aace..6be5d493d 100644 --- a/docs/getting-started/introduction.md +++ b/docs/getting-started/introduction.md @@ -4,18 +4,13 @@ title: Introduction description: Get started with Bootstrap, the world's most popular framework for building responsive, mobile-first sites, with the Bootstrap CDN and a template starter page. group: getting-started redirect_from: "/getting-started/" +toc: true --- - -## Contents - -* Will be replaced with the ToC, excluding the "Contents" header -{:toc} - ## Quick start Looking to quickly add Bootstrap to your project? Use the Bootstrap CDN, provided for free by the folks at MaxCDN. Using a package manager or need to download the source files? [Head to the downloads page.]({{ site.baseurl }}/getting-started/download/) -- cgit v1.2.3