Merge pull request #12040 from coolamiy/master

Site: add icon to side bar items
pull/12119/head
Medya Ghazizadeh 2021-08-03 17:49:21 -07:00 committed by GitHub
commit 1288a4ce4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 103 additions and 135 deletions

View File

@ -1,26 +1,23 @@
[Docsy](https://github.com/google/docsy) is a Hugo theme for technical documentation sites, providing easy site navigation, structure, and more. This **Docsy Example Project** uses the Docsy theme, as well as providing a skeleton documentation structure for you to use. You can either copy this project and edit it with your own content, or use the theme in your projects like any other [Hugo theme](https://themes.gohugo.io/).
This Docsy Example Project is hosted at [https://goldydocs.netlify.com/](https://goldydocs.netlify.com/).
[Docsy](https://github.com/google/docsy) is a Hugo theme for technical documentation sites, providing easy site navigation, structure, and more. This **Minikube project** uses the Docsy theme for [Minikube Website](https://minikube.sigs.k8s.io/docs/).
You can find detailed theme instructions in the Docsy user guide: https://docsydocs.netlify.com/docs/
This is not an officially supported Google product. This project is currently maintained.
## Cloning the Docsy Example Project
The following will give you a project that is set up and ready to use (don't forget to use `--recurse-submodules` or you won't pull down some of the code you need to generate a working site). The `hugo server` command builds and serves the site. If you just want to build the site, run `hugo` instead.
## Running the website locally
Clone the minikube project fork with option ```--recurse-submodules --depth 1 ``` to download and update submodule dependencies.
```bash
git clone --recurse-submodules --depth 1 https://github.com/google/docsy-example.git
cd docsy-example
hugo server
git clone --recurse-submodules --depth 1 https://github.com/kubernetes/minikube.git # replace path with your github fork of minikube
cd minikube/site
hugo server # to server site locally
```
The theme is included as a Git submodule:
```bash
▶ git submodule
a053131a4ebf6a59e4e8834a42368e248d98c01d themes/docsy (heads/master)
2536303cad19991c673037f4f16332075141364a themes/docsy (2536303)
```
If you want to do SCSS edits and want to publish these, you need to install `PostCSS` (not needed for `hugo server`):
@ -28,29 +25,14 @@ If you want to do SCSS edits and want to publish these, you need to install `Pos
```bash
npm install
```
<!--### Cloning the Example from the Theme Project
### Common Issues
```bash
git clone --recurse-submodules --depth 1 https://github.com/docsy.git
cd tech-doc-hugo-theme/exampleSite
HUGO_THEMESDIR="../.." hugo server
Start building sites …
hugo v0.86.0+extended darwin/amd64 BuildDate=unknown
Error: Error building site: "/minikube/site/content/en/docs/contrib/releasing/binaries.md:64:1": failed to extract shortcode: template for shortcode "alert" not found
Built in 667 ms
```
This indicates the submodules are not upated.
Please run the following command to fix.
``` git submodule update --init --recursive ```
Note that the Hugo Theme Site requires the `exampleSite` to live in a subfolder of the theme itself. To avoid recursive duplication, the example site is added as a Git subtree:
```bash
git subtree add --prefix exampleSite https://github.com/google/docsy.git master --squash
```
To pull in changes, see `pull-deps.sh` script in the theme.-->
## Running the website locally
Once you've cloned the site repo, from the repo root folder, run:
```
hugo server
```

View File

@ -1,6 +1,6 @@
---
title: "How to use custom TLS certificate with ingress addon"
linkTitle: "Using custom TLS certificate with ingress addon"
linkTitle: "Using Custom TLS certificate with Ingress Addon"
weight: 1
date: 2020-11-30
---

View File

@ -1,6 +1,6 @@
---
title: "How to use KubeVirt with minikube"
linkTitle: "KubeVirt support"
linkTitle: "KubeVirt Support"
weight: 1
date: 2020-05-26
description: >

View File

@ -1,6 +1,6 @@
---
title: "Using Multi-Node Clusters"
linkTitle: "Using multi-node clusters"
linkTitle: "Using Multi-Node Clusters"
weight: 1
date: 2019-11-24
---

View File

@ -1,6 +1,6 @@
---
title: "Ingress nginx for TCP and UDP services"
linkTitle: "Ingress nginx for TCP and UDP services"
linkTitle: "Ingress Nginx for TCP and UDP Services"
weight: 1
date: 2019-08-15
description: >

View File

@ -1,6 +1,6 @@
---
title: "NVIDIA GPU Support"
linkTitle: "NVIDIA GPU support"
linkTitle: "NVIDIA GPU Support"
weight: 1
date: 2018-01-02
description: >

View File

@ -1,6 +1,6 @@
---
title: "Setup minikube as CI step in github actions"
linkTitle: "minikube in github actions"
linkTitle: "Minikube in Github Actions"
weight: 1
date: 2020-06-02
description: >

View File

@ -1,6 +1,6 @@
---
title: "Telemetry"
linkTitle: "telemetry"
linkTitle: "Telemetry"
weight: 1
date: 2020-11-24
---

View File

@ -1,115 +1,101 @@
<!-- note, this is only used in /docs -->
{{/* minikube hack: temporarily forked from docsy/layouts/partials/sidebar-tree.html for hugo v0.69 compatibility */}}
{{/* We cache this partial for bigger sites and set the active class client side. */}}
{{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
{{/* minikube hack: temporarily forked from
docsy/layouts/partials/sidebar-tree.html for hugo v0.69 compatibility */}} {{/*
We cache this partial for bigger sites and set the active class client side.
*/}} {{ $shouldDelayActive := ge (len .Site.Pages) 2000 }}
<div
id="td-sidebar-menu"
class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}"
>
{{ if not .Site.Params.ui.sidebar_search_disable }}
<form class="td-sidebar__search d-flex align-items-center">
{{ partial "search-input.html" . }}
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
</button>
<button
class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars"
type="button"
data-toggle="collapse"
data-target="#td-section-nav"
aria-controls="td-docs-nav"
aria-expanded="false"
aria-label="Toggle section navigation"
></button>
</form>
{{ end }}
<nav class="collapse td-sidebar-nav" id="td-section-nav">
{{ if (gt (len .Site.Home.Translations) 0) }}
{{ if (gt (len .Site.Home.Translations) 0) }}
<div class="nav-item dropdown d-block d-lg-none">
{{ partial "navbar-lang-selector.html" . }}
</div>
{{ end }}
{{ template "section-tree-nav-section" (dict "page" . "section" .FirstSection "delayActive" $shouldDelayActive) }}
{{ end }} {{ template "section-tree-nav-section" (dict "page" . "section"
.FirstSection "delayActive" $shouldDelayActive) }}
</nav>
</div>
<!-- this gets called for every section -->
{{ define "section-tree-nav-section" }}
{{ $s := .section }}
{{ $p := .page }}
{{ $shouldDelayActive := .delayActive }}
{{ $activeSection := eq $p.CurrentSection $s }}
{{/* minikube hack: Override $showSection due to a Hugo upgrade bug */}}
{{ $showSection := false }}
{{ $expandSection := false }}
{{ $sid := $s.RelPermalink | anchorize }}
{{ $sectionParent := $s.Parent.Title | anchorize }}
{{ $csid := $p.CurrentSection.Title | anchorize }}
{{ if $p.IsDescendant $s }}
<!-- page is within current section -->
{{ $showSection = true }}
{{ else if eq $sectionParent "minikube" }}
<!-- top-level section -->
{{ $showSection = true }}
{{ else if eq $sectionParent "welcome" }}
<!-- top-level documentation -->
{{ $showSection = true }}
{{ else if eq $sectionParent "handbook" }}
<!-- handbook link -->
{{ $showSection = true }}
{{ else if eq $p.CurrentSection $s.Parent }}
<!-- page is in current sections parent -->
{{ $showSection = true }}
{{ else if $p.Parent.IsAncestor $s }}
<!-- page is in current section -->
{{ if eq $s $p.CurrentSection }}
{{ $showSection = true }}
{{ end }}
{{ end }}
{{ define "section-tree-nav-section" }} {{ $s := .section }} {{ $p := .page }}
{{ $shouldDelayActive := .delayActive }} {{ $activeSection := eq
$p.CurrentSection $s }} {{/* minikube hack: Override $showSection due to a Hugo
upgrade bug */}} {{ $showSection := false }} {{ $expandSection := false }} {{
$sid := $s.RelPermalink | anchorize }} {{ $sectionParent := $s.Parent.Title |
anchorize }} {{ $csid := $p.CurrentSection.Title | anchorize }} {{ if
$p.IsDescendant $s }}
<!-- page is within current section -->
{{ $showSection = true }} {{ else if eq $sectionParent "minikube" }}
<!-- top-level section -->
{{ $showSection = true }} {{ else if eq $sectionParent "welcome" }}
<!-- top-level documentation -->
{{ $showSection = true }} {{ else if eq $sectionParent "handbook" }}
<!-- handbook link -->
{{ $showSection = true }} {{ else if eq $p.CurrentSection $s.Parent }}
<!-- page is in current sections parent -->
{{ $showSection = true }} {{ else if $p.Parent.IsAncestor $s }}
<!-- page is in current section -->
{{ if eq $s $p.CurrentSection }} {{ $showSection = true }} {{ end }} {{ end }}
<!-- only show top-level sections, or sections within the current section -->
{{/* end minikube hack */}}
{{/* end minikube hack */}} {{ $sid := $s.RelPermalink | anchorize }} {{ if
$showSection }}
<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<!-- Link for subections -->
<a
href="{{ $s.RelPermalink }}"
class="align-left pl-0 pr-2{{ if not $expandSection }} collapsed{{ end }}{{ if $activeSection}} active{{ end }} td-sidebar-link td-sidebar-link__section"
>
{{ if $activeSection}} &#10687; {{ else }} &#10686; {{ end }}
{{$s.LinkTitle }}</a
>
</li>
<ul>
<li class="collapse {{ if $showSection }}show{{ end }}" id="{{ $sid }}">
{{ $pages := where (union $s.Pages $s.Sections).ByWeight
".Params.toc_hide" "!=" true }} {{ $pages := $pages | first 50 }} {{ range
$pages }} {{ if .IsPage }} {{ $mid := printf "m-%s" (.RelPermalink |
anchorize) }} {{/* minikube hack: Override $activeSection due to a Hugo
upgrade bug */}} {{ $showPage := false }} {{ $activePage := false }}
{{ $sid := $s.RelPermalink | anchorize }}
{{ if $showSection }}
<ul class="td-sidebar-nav__section pr-md-3">
<li class="td-sidebar-nav__section-title">
<!-- Link for subections -->
<a href="{{ $s.RelPermalink }}" class="align-left pl-0 pr-2{{ if not $expandSection }} collapsed{{ end }}{{ if $activeSection}} active{{ end }} td-sidebar-link td-sidebar-link__section">{{ $s.LinkTitle }}</a>
<!-- always show pages in the current section -->
{{ if $activeSection }} {{ $showPage = true }} {{ $activePage = eq . $p }}
{{ end }}
<!-- show handbook unless we are in a very long section -->
{{ if eq $s.Title "Handbook" }} {{ if lt (len $p.CurrentSection.Pages) 7
}} {{ $showPage = true }} {{ end }}
<!-- always show handbook if we are on the frontpage -->
{{ if eq $csid "welcome" }} {{ $showPage = true }} {{ end }} {{ end }} {{
if $showPage }}
<a
class="td-sidebar-link td-sidebar-link__page {{ if $activePage }} active{{ end }}"
id="{{ $mid }}"
href="{{ .RelPermalink }}"
>
{{.LinkTitle }}
</a>
{{ end }} {{/* end minikube hack */}} {{ else }} {{ template
"section-tree-nav-section" (dict "page" $p "section" .) }} {{ end }} {{
end }}
</li>
<ul>
<li class="collapse {{ if $showSection }}show{{ end }}" id="{{ $sid }}">
{{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }}
{{ $pages := $pages | first 50 }}
{{ range $pages }}
{{ if .IsPage }}
{{ $mid := printf "m-%s" (.RelPermalink | anchorize) }}
{{/* minikube hack: Override $activeSection due to a Hugo upgrade bug */}}
{{ $showPage := false }}
{{ $activePage := false }}
<!-- always show pages in the current section -->
{{ if $activeSection }}
{{ $showPage = true }}
{{ $activePage = eq . $p }}
{{ end }}
<!-- show handbook unless we are in a very long section -->
{{ if eq $s.Title "Handbook" }}
{{ if lt (len $p.CurrentSection.Pages) 7 }}
{{ $showPage = true }}
{{ end }}
<!-- always show handbook if we are on the frontpage -->
{{ if eq $csid "welcome" }}
{{ $showPage = true }}
{{ end }}
{{ end }}
{{ if $showPage }}
<a class="td-sidebar-link td-sidebar-link__page {{ if $activePage }} active{{ end }}" id="{{ $mid }}" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{ end }}
{{/* end minikube hack */}}
{{ else }}
{{ template "section-tree-nav-section" (dict "page" $p "section" .) }}
{{ end }}
{{ end }}
</li>
</ul>
</ul>
{{ end }}
{{ end }}
</ul>
{{ end }} {{ end }}