mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-22 05:03:16 +02:00
docs(layout): ensure content sits in main (#31610)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -2,20 +2,12 @@
|
|||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(md) {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: $grid-gutter-width;
|
gap: $grid-gutter-width;
|
||||||
grid-template-areas:
|
grid-template-areas: "sidebar main";
|
||||||
"sidebar intro"
|
|
||||||
"sidebar toc"
|
|
||||||
"sidebar content";
|
|
||||||
grid-template-columns: 1fr 3fr;
|
grid-template-columns: 1fr 3fr;
|
||||||
grid-template-rows: auto auto 1fr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(lg) {
|
@include media-breakpoint-up(lg) {
|
||||||
grid-template-areas:
|
grid-template-columns: 1fr 5fr;
|
||||||
"sidebar intro toc"
|
|
||||||
"sidebar content toc";
|
|
||||||
grid-template-columns: 1fr 4fr 1fr;
|
|
||||||
grid-template-rows: auto 1fr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,6 +15,28 @@
|
|||||||
grid-area: sidebar;
|
grid-area: sidebar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bd-main {
|
||||||
|
grid-area: main;
|
||||||
|
|
||||||
|
@include media-breakpoint-up(md) {
|
||||||
|
display: grid;
|
||||||
|
gap: inherit;
|
||||||
|
grid-template-areas:
|
||||||
|
"intro"
|
||||||
|
"toc"
|
||||||
|
"content";
|
||||||
|
grid-template-rows: auto auto 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-up(lg) {
|
||||||
|
grid-template-areas:
|
||||||
|
"intro toc"
|
||||||
|
"content toc";
|
||||||
|
grid-template-columns: 4fr 1fr;
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.bd-intro {
|
.bd-intro {
|
||||||
grid-area: intro;
|
grid-area: intro;
|
||||||
}
|
}
|
||||||
|
@@ -10,41 +10,43 @@
|
|||||||
{{ partial "docs-subnav" . }}
|
{{ partial "docs-subnav" . }}
|
||||||
|
|
||||||
<div class="container-xxl my-4 bd-layout">
|
<div class="container-xxl my-4 bd-layout">
|
||||||
<div class="bd-sidebar">
|
<aside class="bd-sidebar">
|
||||||
{{ partial "docs-sidebar" . }}
|
{{ partial "docs-sidebar" . }}
|
||||||
</div>
|
</aside>
|
||||||
|
|
||||||
<div class="bd-intro pt-md-3 pl-lg-4">
|
<main class="bd-main order-1">
|
||||||
<div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
|
<div class="bd-intro pt-md-3 pl-lg-4">
|
||||||
<a class="btn btn-sm btn-bd-light mb-2 mb-md-0" href="{{ .Site.Params.repo }}/tree/main/site/content/{{ .Page.File.Path }}" title="View and edit this file on GitHub" target="_blank" rel="noopener">View on GitHub</a>
|
<div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
|
||||||
<h1 class="bd-title" id="content">{{ .Title | markdownify }}</h1>
|
<a class="btn btn-sm btn-bd-light mb-2 mb-md-0" href="{{ .Site.Params.repo }}/tree/main/site/content/{{ .Page.File.Path }}" title="View and edit this file on GitHub" target="_blank" rel="noopener">View on GitHub</a>
|
||||||
|
<h1 class="bd-title" id="content">{{ .Title | markdownify }}</h1>
|
||||||
|
</div>
|
||||||
|
<p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p>
|
||||||
|
{{ partial "ads" . }}
|
||||||
</div>
|
</div>
|
||||||
<p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p>
|
|
||||||
{{ partial "ads" . }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{ if (eq .Page.Params.toc true) }}
|
{{ if (eq .Page.Params.toc true) }}
|
||||||
<div class="bd-toc pl-xl-3 text-muted mb-lg-5">
|
<div class="bd-toc pl-xl-3 text-muted mb-lg-5">
|
||||||
<strong class="d-block h6 my-2 pb-2 border-bottom">On this page</strong>
|
<strong class="d-block h6 my-2 pb-2 border-bottom">On this page</strong>
|
||||||
{{ .TableOfContents }}
|
{{ .TableOfContents }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<main class="bd-content order-1 pl-lg-4">
|
|
||||||
{{ if .Page.Params.sections }}
|
|
||||||
<div class="row g-3">
|
|
||||||
{{ range .Page.Params.sections }}
|
|
||||||
<div class="col-md-6">
|
|
||||||
<a class="d-block text-decoration-none" href="../{{ urlize .title }}/">
|
|
||||||
<strong class="d-block h5 mb-0">{{ .title }}</strong>
|
|
||||||
<span class="text-secondary">{{ .description }}</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ .Content }}
|
<div class="bd-content pl-lg-4">
|
||||||
|
{{ if .Page.Params.sections }}
|
||||||
|
<div class="row g-3">
|
||||||
|
{{ range .Page.Params.sections }}
|
||||||
|
<div class="col-md-6">
|
||||||
|
<a class="d-block text-decoration-none" href="../{{ urlize .title }}/">
|
||||||
|
<strong class="d-block h5 mb-0">{{ .title }}</strong>
|
||||||
|
<span class="text-secondary">{{ .description }}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user