-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved documentation versioning (#3569)
* add navbar-version-selector.html * update site/build_docs.py * update site/build_docs.py * update _index.html and fix mistakes in config.toml * fix _index.html * replace all tabs with spaces * update navbar-version-selector.html * fix link in the site/readme.md * replace tabs with spaces in custom.scss and 404.html * fix linter errors
- Loading branch information
Showing
8 changed files
with
58 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{{ define "main"}} | ||
<main id="main"> | ||
<div class="text-center"> | ||
<h1>404</h1> | ||
<p>Not found</p> | ||
<p>Oops! This page doesn't exist. Try going back to our <a href="./about">about page</a> or <a href="./docs">documentation page</a>.</p> | ||
</div> | ||
</main> | ||
<main id="main"> | ||
<div class="text-center"> | ||
<h1>404</h1> | ||
<p>Not found</p> | ||
<p>Oops! This page doesn't exist. Try going back to our <a href="./about">about page</a> or <a href="./docs">documentation page</a>.</p> | ||
</div> | ||
</main> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{ $page_rel := .Page.RelPermalink | safeURL }} | ||
{{ $page_rel_trim := strings.TrimLeft "/" $page_rel | safeURL }} | ||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
{{ .Site.Params.version_menu }} | ||
</a> | ||
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> | ||
{{ range .Site.Params.versions }} | ||
{{ $ver := .version }} | ||
<a class="dropdown-item" href="{{ .url }}{{ if eq $ver "develop" }}{{ $page_rel_trim }}{{ else }}{{ $page_rel }}{{ end }}">{{ $ver }}</a> | ||
{{ end }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
{{ $cover := .HasShortcode "blocks/cover" }} | ||
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }}flex-column flex-md-row td-navbar"> | ||
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}about/"> | ||
<span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo }}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }}{{ end }}</span> | ||
</a> | ||
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar"> | ||
<ul class="navbar-nav mt-2 mt-lg-0"> | ||
{{ $p := . }} | ||
{{ range .Site.Menus.main }} | ||
<li class="nav-item mr-4 mb-2 mb-lg-0"> | ||
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }} | ||
{{ with .Page }} | ||
{{ $active = or $active ( $.IsDescendant .) }} | ||
{{ end }} | ||
{{ $pre := .Pre }} | ||
{{ $post := .Post }} | ||
{{ $url := urls.Parse .URL }} | ||
{{ $baseurl := urls.Parse $.Site.Params.Baseurl }} | ||
<a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with .Pre}}{{ $pre }}{{ end }}<span{{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with .Post}}{{ $post }}{{ end }}</a> | ||
</li> | ||
{{ end }} | ||
{{ if .Site.Params.versions }} | ||
<li class="nav-item dropdown d-none d-lg-block"> | ||
{{ partial "navbar-version-selector.html" . }} | ||
</li> | ||
{{ end }} | ||
{{ if (gt (len .Site.Home.Translations) 0) }} | ||
<li class="nav-item dropdown d-none d-lg-block"> | ||
{{ partial "navbar-lang-selector.html" . }} | ||
</li> | ||
{{ end }} | ||
</ul> | ||
</div> | ||
<div class="navbar-nav d-none d-lg-block">{{ partial "search-input.html" . }}</div> | ||
<span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo }}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }}{{ end }}</span> | ||
</a> | ||
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar"> | ||
<ul class="navbar-nav mt-2 mt-lg-0"> | ||
{{ $p := . }} | ||
{{ range .Site.Menus.main }} | ||
<li class="nav-item mr-4 mb-2 mb-lg-0"> | ||
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) }} | ||
{{ with .Page }} | ||
{{ $active = or $active ( $.IsDescendant .) }} | ||
{{ end }} | ||
{{ $pre := .Pre }} | ||
{{ $post := .Post }} | ||
{{ $url := urls.Parse .URL }} | ||
{{ $baseurl := urls.Parse $.Site.Params.Baseurl }} | ||
<a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ with .Pre}}{{ $pre }}{{ end }}<span{{if $active }} class="active"{{end}}>{{ .Name }}</span>{{ with .Post}}{{ $post }}{{ end }}</a> | ||
</li> | ||
{{ end }} | ||
{{ if .Site.Params.versions }} | ||
<li class="nav-item dropdown d-none d-lg-block"> | ||
{{ partial "navbar-version-selector.html" . }} | ||
</li> | ||
{{ end }} | ||
{{ if (gt (len .Site.Home.Translations) 0) }} | ||
<li class="nav-item dropdown d-none d-lg-block"> | ||
{{ partial "navbar-lang-selector.html" . }} | ||
</li> | ||
{{ end }} | ||
</ul> | ||
</div> | ||
<div class="navbar-nav d-none d-lg-block">{{ partial "search-input.html" . }}</div> | ||
</nav> |