提交 e895a107 编写于 作者: S Sarah Maddox 提交者: Kubernetes Prow Robot

Added logic to create a banner on archived doc sets (#1535)

* WIP early commit for banner on archived docs.

* Still a WIP.

* Banner for archived docs is looking good.

* Test with pattern for preview URL.

* Adjusted netlify preview pattern for testing.

* Adjusted netlify preview pattern for testing.

* Adjusted netlify preview pattern for testing.

* Adjusted netlify preview pattern for testing.

* Adjusted netlify preview pattern for testing.

* Adjusted netlify preview pattern for testing.

* Restored the actual pattern for matching archive doc sets.

* Added empty lines at end of each file.

* Swapped to a flag instead of URL pattern. Added variable for docs URL.

* Set flag to true to test in Netlify preview.

* Set flag back to false and set to open link in new tab.

* Set flag back to false for real this time.
上级 b67e9d73
......@@ -105,13 +105,22 @@ privacy_policy = "https://policies.google.com/privacy"
# Docsy: Google Custom Search Engine ID. Remove or comment out to disable search.
gcs_engine_id = "007239566369470735695:624rglujm-w"
# This param doesn't seem to be used.
# Raised https://github.com/kubeflow/website/issues/1263 to investigate.
version = "v0.7"
# Text label for the version menu in the top bar of the website.
version_menu = "v0.7"
# The major.minor version tag for the version of the docs represented in this
# branch of the repository. Used in the "version-banner" partial to display a
# version number for this doc set.
version = "v0.7"
# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
archived_version = false
# A link to latest version of the docs. Used in the "version-banner" partial to
# point people to the main doc site.
url_latest_version = "https://kubeflow.org/docs/"
# A variable used in various docs to determine URLs for config files etc.
# To find occurrences, search the repo for 'params "githubbranch"'.
githubbranch = "v0.7-branch"
......
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js">
<head>
{{ partial "head.html" . }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
</head>
<body class="td-{{ .Kind }}">
<header>
{{ partial "navbar.html" . }}
</header>
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<div class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
{{ partial "sidebar.html" . }}
</div>
<div class="d-none d-xl-block col-xl-2 td-toc d-print-none">
{{ partial "toc.html" . }}
</div>
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
</main>
</div>
</div>
{{ partial "footer.html" . }}
</div>
{{ partial "scripts.html" . }}
</body>
</html>
<!-- Check the variable that indicates whether this is an archived doc set.
If yes, display a banner. -->
{{ if .Site.Params.archived_version }}
{{ $color := "primary" }}
{{ $latest := .Site.Params.url_latest_version }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with .Site.Params.version }}<p>Version {{ . | markdownify }} of the
documentation is no longer actively maintained. The site that you are
currently viewing is an archived snapshot. For up-to-date documentation,
see the
<a href="{{ $latest | safeURL }}" target="_blank">latest version</a>.</p>
{{ end }}
</div>
{{ end }}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册