Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
bb3e5f71
Commit
bb3e5f71
authored
4 years ago
by
Mark Otto
Browse files
Options
Download
Email Patches
Plain Diff
Move table of contents to new sidebar, restyle it to be simpler
parent
6fdb8e6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
site/assets/scss/_toc.scss
+27
-7
site/assets/scss/_toc.scss
site/layouts/_default/docs.html
+23
-13
site/layouts/_default/docs.html
with
50 additions
and
20 deletions
+50
-20
site/assets/scss/_toc.scss
+
27
-
7
View file @
bb3e5f71
// stylelint-disable selector-max-type, selector-max-compound-selectors
.bd-toc-wrap
{
@include
media-breakpoint-up
(
lg
)
{
@supports
(
position
:
sticky
)
{
position
:
sticky
;
top
:
5rem
;
right
:
0
;
z-index
:
2
;
height
:
subtract
(
100vh
,
7rem
);
overflow-y
:
auto
;
}
}
}
.bd-toc
nav
{
padding-top
:
.125em
;
padding-bottom
:
.125em
;
border-left
:
.25em
solid
$gray-200
;
@include
font-size
(
.875rem
);
>
ul
{
margin-bottom
:
0
;
ul
{
padding-left
:
0
;
list-style
:
none
;
ul
{
padding-left
:
1rem
;
margin-top
:
.25rem
;
}
}
li
ul
li
{
li
{
margin-bottom
:
.25rem
;
list-style-type
:
disc
;
}
a
{
color
:
inherit
;
}
a
:not
(
:hover
)
{
...
...
This diff is collapsed.
Click to expand it.
site/layouts/_default/docs.html
+
23
-
13
View file @
bb3e5f71
...
...
@@ -9,16 +9,18 @@
{{ partial "docs-navbar" . }}
{{ partial "docs-subnav" . }}
<div
class=
"container-xl my-4"
>
<div
class=
"container-
x
xl my-4"
>
<div
class=
"row flex-xl-nowrap"
>
<div
class=
"col-md-3"
>
<div
class=
"col-md-3
col-xl-2 bd-sidebar
"
>
{{ partial "docs-sidebar" . }}
</div>
<main
class=
"col-md-9 py-md-3 pl-md-5 bd-content"
>
<h1
class=
"bd-title"
id=
"content"
>
{{ .Title | markdownify }}
</h1>
<p
class=
"bd-lead"
>
{{ .Page.Params.Description | markdownify }}
</p>
{{ partial "ads" . }}
<main
class=
"col-md-9 col-xl-10 py-md-3 pl-md-5 bd-content"
>
<div
class=
"col-xl-10 px-0"
>
<h1
class=
"bd-title"
id=
"content"
>
{{ .Title | markdownify }}
</h1>
<p
class=
"bd-lead"
>
{{ .Page.Params.Description | markdownify }}
</p>
{{ partial "ads" . }}
</div>
{{ if .Page.Params.sections }}
<div
class=
"row my-5"
>
...
...
@@ -33,14 +35,22 @@
</div>
{{ end }}
{{ if (eq .Page.Params.toc true) }}
<strong
class=
"d-block h3 mt-5 mb-3"
>
On this page
</strong>
<nav
class=
"bd-toc mb-5 text-muted"
aria-label=
"Secondary navigation"
>
{{ .TableOfContents }}
</nav>
{{ end }}
<div
class=
"row position-relative flex-xl-row-reverse"
>
<div
class=
"col-xl-3"
>
{{ if (eq .Page.Params.toc true) }}
<div
class=
"bd-toc-wrap pl-xl-3 text-muted"
>
<strong
class=
"d-block h6 my-2 pb-2 border-bottom"
>
On this page
</strong>
<div
class=
"bd-toc mb-5 mb-xl-0"
>
{{ .TableOfContents }}
</div>
</div>
{{ end }}
</div>
<div
class=
"col-xl-9"
>
{{ .Content }}
</div>
</div>
{{ .Content }}
</main>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment