diff options
author | Tiger Oakes <contact@tigeroakes.com> | 2020-09-06 08:30:58 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-11-17 16:54:47 +0300 |
commit | 4c9597ef7e450a694701d0803ed5422558b11c1c (patch) | |
tree | b67ed0fe117df05196082e27c5a5e93492d439a7 /site | |
parent | 933b6510ca59a8d19ed3c2e7db426b1ccf5f5441 (diff) |
Add baseof layout
Diffstat (limited to 'site')
-rw-r--r-- | site/layouts/_default/404.html | 24 | ||||
-rw-r--r-- | site/layouts/_default/baseof.html | 20 | ||||
-rw-r--r-- | site/layouts/_default/docs.html | 101 | ||||
-rw-r--r-- | site/layouts/_default/home.html | 29 | ||||
-rw-r--r-- | site/layouts/_default/single.html | 83 |
5 files changed, 114 insertions, 143 deletions
diff --git a/site/layouts/_default/404.html b/site/layouts/_default/404.html index 744865cd4f..c9eecff003 100644 --- a/site/layouts/_default/404.html +++ b/site/layouts/_default/404.html @@ -1,18 +1,6 @@ -<!doctype html> -<html lang="en"> - <head> - {{ partial "header" . }} - </head> - <body class="d-flex flex-column min-vh-100"> - {{ partial "skippy" . }} - - {{ partial "docs-navbar" . }} - - <main class="my-auto p-5" id="content"> - {{ .Content }} - </main> - - {{ partial "footer" . }} - {{ partial "scripts" . }} - </body> -</html> +{{ define "body_override" }}<body class="d-flex flex-column min-vh-100">{{ end }} +{{ define "main" }} + <main class="my-auto p-5" id="content"> + {{ .Content }} + </main> +{{ end }} diff --git a/site/layouts/_default/baseof.html b/site/layouts/_default/baseof.html new file mode 100644 index 0000000000..713ab2864a --- /dev/null +++ b/site/layouts/_default/baseof.html @@ -0,0 +1,20 @@ +<!doctype html> +<html lang="en"> + <head> + {{ partial "header" . }} + </head> + {{ block "body_override" . }}<body>{{ end }} + {{ partial "skippy" . }} + + {{ partial "docs-navbar" . }} + + {{ block "main" . }} + {{ end }} + + {{ partial "footer" . }} + {{ partial "scripts" . }} + + {{ block "footer" . }} + {{ end }} + </body> +</html> diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html index cf237dd7b8..078c0c327c 100644 --- a/site/layouts/_default/docs.html +++ b/site/layouts/_default/docs.html @@ -1,60 +1,49 @@ -<!doctype html> -<html lang="en"> - <head> - {{ partial "header" . }} - </head> - <body> - {{ partial "skippy" . }} - - {{ partial "docs-navbar" . }} - {{ partial "docs-subnav" . }} - - <div class="container-xxl my-md-4 bd-layout"> - <aside class="bd-sidebar"> - {{ partial "docs-sidebar" . }} - </aside> - - <main class="bd-main order-1"> - <div class="bd-intro pl-lg-4"> - <div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between"> - <a class="btn btn-sm btn-bd-light mb-2 mb-md-0" href="{{ .Site.Params.repo }}/blob/main/site/content/{{ .Page.File.Path | replaceRE `\\` "/" }}" 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" . }} +{{ define "main" }} + {{ partial "docs-subnav" . }} + + <div class="container-xxl my-md-4 bd-layout"> + <aside class="bd-sidebar"> + {{ partial "docs-sidebar" . }} + </aside> + + <main class="bd-main order-1"> + <div class="bd-intro pl-lg-4"> + <div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between"> + <a class="btn btn-sm btn-bd-light mb-2 mb-md-0" href="{{ .Site.Params.repo }}/blob/main/site/content/{{ .Page.File.Path | replaceRE `\\` "/" }}" 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> - - {{ if (eq .Page.Params.toc true) }} - <div class="bd-toc mt-4 mb-5 my-md-0 pl-xl-3 mb-lg-5 text-muted"> - <strong class="d-block h6 my-2 pb-2 border-bottom">On this page</strong> - {{ .TableOfContents }} + <p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p> + {{ partial "ads" . }} + </div> + + {{ if (eq .Page.Params.toc true) }} + <div class="bd-toc mt-4 mb-5 my-md-0 pl-xl-3 mb-lg-5 text-muted"> + <strong class="d-block h6 my-2 pb-2 border-bottom">On this page</strong> + {{ .TableOfContents }} + </div> + {{ end }} + + <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 }} - <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> - </div> - - {{ partial "footer" . }} - {{ partial "scripts" . }} - - {{ range .Page.Params.extra_js -}} - <script{{ with .async }} async{{ end }} src="{{ .src }}"></script> - {{- end -}} - </body> -</html> + {{ .Content }} + </div> + </main> + </div> +{{ end }} +{{ define "footer" }} + {{ range .Page.Params.extra_js -}} + <script{{ with .async }} async{{ end }} src="{{ .src }}"></script> + {{- end -}} +{{ end }} diff --git a/site/layouts/_default/home.html b/site/layouts/_default/home.html index 105c86b54b..28bcf0c64d 100644 --- a/site/layouts/_default/home.html +++ b/site/layouts/_default/home.html @@ -1,21 +1,8 @@ -<!doctype html> -<html lang="en"> - <head> - {{ partial "header" . }} - </head> - <body> - {{ partial "skippy" . }} - - {{ partial "docs-navbar" . }} - - <main> - {{ partial "home/masthead" . }} - {{ partial "home/masthead-followup" . }} - </main> - - {{ .Content }} - - {{ partial "footer" . }} - {{ partial "scripts" . }} - </body> -</html> +{{ define "main" }} + <main> + {{ partial "home/masthead" . }} + {{ partial "home/masthead-followup" . }} + </main> + + {{ .Content }} +{{ end }} diff --git a/site/layouts/_default/single.html b/site/layouts/_default/single.html index 2afde6ec1a..408ee5cb36 100644 --- a/site/layouts/_default/single.html +++ b/site/layouts/_default/single.html @@ -1,54 +1,41 @@ -<!doctype html> -<html lang="en"> - <head> - {{ partial "header" . }} - </head> - <body> - {{ partial "skippy" . }} - - {{ partial "docs-navbar" . }} - - <header class="py-5 border-bottom"> - <div class="container pt-md-1 pb-md-4"> - <h1 class="bd-title mt-0">{{ .Title | markdownify }}</h1> - <p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p> - {{ if eq .Title "Examples" }} - <div class="d-flex flex-column flex-sm-row"> - <a href="{{ .Site.Params.download.dist_examples }}" class="btn btn-lg btn-bd-primary" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download Examples');">Download examples</a> - <a href="{{ .Site.Params.download.source }}" class="btn btn-lg btn-outline-secondary mt-3 mt-sm-0 ml-sm-3" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download');">Download source code</a> - </div> - {{ end }} - {{ partial "ads" . }} +{{ define "main" }} + <header class="py-5 border-bottom"> + <div class="container pt-md-1 pb-md-4"> + <h1 class="bd-title mt-0">{{ .Title | markdownify }}</h1> + <p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p> + {{ if eq .Title "Examples" }} + <div class="d-flex flex-column flex-sm-row"> + <a href="{{ .Site.Params.download.dist_examples }}" class="btn btn-lg btn-bd-primary" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download Examples');">Download examples</a> + <a href="{{ .Site.Params.download.source }}" class="btn btn-lg btn-outline-secondary mt-3 mt-sm-0 ml-sm-3" onclick="ga('send', 'event', 'Examples', 'Hero', 'Download');">Download source code</a> </div> - </header> + {{ end }} + {{ partial "ads" . }} + </div> + </header> - <main class="bd-content order-1 py-5" id="content"> - <div class="container"> - {{ .Content }} + <main class="bd-content order-1 py-5" id="content"> + <div class="container"> + {{ .Content }} - {{ if eq .Title "Examples" }} - <hr class="my-5"> - <div class="container"> - <div class="text-center"> - <div class="masthead-followup-icon d-inline-block mb-2 text-white bg-danger"> - {{ partial "icons/droplet-fill.svg" (dict "width" "32" "height" "32") }} - </div> - <h2 class="display-6 fw-normal">Go further with Bootstrap Themes</h2> - <p class="col-md-10 col-lg-8 mx-auto lead"> - Need something more than these examples? Take Bootstrap to the next level with premium themes from the <a href="{{ .Site.Params.themes }}">official Bootstrap Themes marketplace</a>. They’re built as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools. - </p> - <a href="{{ .Site.Params.themes }}" class="btn btn-lg btn-outline-primary mb-3">Browse themes</a> + {{ if eq .Title "Examples" }} + <hr class="my-5"> + <div class="container"> + <div class="text-center"> + <div class="masthead-followup-icon d-inline-block mb-2 text-white bg-danger"> + {{ partial "icons/droplet-fill.svg" (dict "width" "32" "height" "32") }} </div> - <img class="d-block img-fluid mt-3 mx-auto" srcset="/docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes-collage.png, - /docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes-collage@2x.png 2x" + <h2 class="display-6 fw-normal">Go further with Bootstrap Themes</h2> + <p class="col-md-10 col-lg-8 mx-auto lead"> + Need something more than these examples? Take Bootstrap to the next level with premium themes from the <a href="{{ .Site.Params.themes }}">official Bootstrap Themes marketplace</a>. They’re built as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools. + </p> + <a href="{{ .Site.Params.themes }}" class="btn btn-lg btn-outline-primary mb-3">Browse themes</a> + </div> + <img class="d-block img-fluid mt-3 mx-auto" srcset="/docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes-collage.png, + /docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes-collage@2x.png 2x" src="/docs/{{ .Site.Params.docs_version }}/assets/img/bootstrap-themes-collage.png" alt="Bootstrap Themes" width="1150" height="320" loading="lazy"> - </div> - {{ end }} - </div> - </main> - - {{ partial "footer" . }} - {{ partial "scripts" . }} - </body> -</html> + </div> + {{ end }} + </div> + </main> +{{ end }} |