From ee3e8a717d3fb768091a5299e66b5c019177ce4d Mon Sep 17 00:00:00 2001 From: Pratik Mota Date: Fri, 14 Apr 2023 14:13:50 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96:=20Add=20version=20dropdown=20for?= =?UTF-8?q?=20doc=20release=20(#3332)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add version dropdown for doc --- docs/book/book.toml | 2 +- docs/book/theme/css/version-dropdown.css | 23 +++++++++++++++++++++++ docs/book/theme/index.hbs | 11 +++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/book/theme/css/version-dropdown.css diff --git a/docs/book/book.toml b/docs/book/book.toml index 0dc3a87c8c0..c6244a05df3 100644 --- a/docs/book/book.toml +++ b/docs/book/book.toml @@ -7,7 +7,7 @@ title = "The Kubebuilder Book" [output.html] google-analytics = "UA-119864590-1" curly-quotes = true -additional-css = ["theme/css/markers.css", "theme/css/custom.css"] +additional-css = ["theme/css/markers.css", "theme/css/custom.css", "theme/css/version-dropdown.css"] git-repository-url = "https://github.com/kubernetes-sigs/kubebuilder" edit-url-template = "https://github.com/kubernetes-sigs/kubebuilder/edit/master/docs/book/{path}" diff --git a/docs/book/theme/css/version-dropdown.css b/docs/book/theme/css/version-dropdown.css new file mode 100644 index 00000000000..d3ac4edb0c6 --- /dev/null +++ b/docs/book/theme/css/version-dropdown.css @@ -0,0 +1,23 @@ +.version-dropdown-content { + display: none; + position: absolute; + background-color: #f9f9f9; + min-width: 90px; + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); + z-index: 1; + } + + .version-dropdown-content a { + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; + } + + .version-dropdown-content a:hover { + background-color: #f1f1f1; + } + + .version-dropdown:hover .version-dropdown-content { + display: block; + } \ No newline at end of file diff --git a/docs/book/theme/index.hbs b/docs/book/theme/index.hbs index 51753a5047b..2ef47f11981 100644 --- a/docs/book/theme/index.hbs +++ b/docs/book/theme/index.hbs @@ -126,6 +126,17 @@ {{/if}} + +
+ + +

{{ book_title }}