Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

site: Advanced website navigation #517

Merged
merged 5 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions site/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
title: "Krew – kubectl plugin manager"
baseURL: "https://krew.sigs.k8s.io/"
languageCode: "en-us"
title: "Krew – kubectl plugin manager"

disableKinds:
- taxonomy
- taxonomyTerm
markup:
highlight:
style: dracula
highlight:
style: dracula
22 changes: 22 additions & 0 deletions site/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Home
---

## Krew: plugin manager for kubectl

Krew helps you discover [kubectl plugins][kpl], install and manage them on your
machine.

It is similar to package managers like apt, brew or dnf. Krew works acrosss all
major platforms and [over 80 kubectl][list] plugins are currently available on
Krew.

- For **kubectl users**: Krew helps you discover and install kubectl plugins,
and keep them up to date.

- For **kubectl plugin developers**: Krew helps you package and distribute your
plugins on multiple platforms easily and makes them discoverable through a
centralized plugin repository.

[kpl]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
[list]: http://sigs.k8s.io/krew-index/plugins.md
3 changes: 2 additions & 1 deletion site/content/docs/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Krew
title: Documentation
slug: docs
---
3 changes: 3 additions & 0 deletions site/content/docs/developer-guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
title: Developer Guide
weight: 300
---

This guide is for `kubectl` plugin developers looking to distribute their
plugins with Krew.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ existing plugins.
1. Familiarize yourself with [Krew plugin naming guide]({{< ref "../develop/naming-guide.md" >}}).
1. Read the [plugin development best practices]({{< ref
"../develop/best-practices.md" >}}).
1. Develop a [plugin manifest](../plugin-manifest.md).
1. Develop a [plugin manifest]({{< ref "../plugin-manifest.md" >}})
1. Make sure your plugin’s source code is available as open source.
1. Adopt an open source license, and add it to your plugin archive file.
1. Tag a git release with a [semantic
Expand Down
2 changes: 2 additions & 0 deletions site/content/docs/user-guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
title: User Guide
weight: 200
---

Learn how to use Krew to its full extent.
14 changes: 7 additions & 7 deletions site/content/docs/user-guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ weight: 100
---

Krew helps you discover and install [`kubectl` plugins][kpl] on your machine.

There are [a lot of][list] `kubectl` plugins you can install and use to enhance
your Kubernetes experience.

Let's get started.
Let's get started:

1. [Install and set up]({{<ref "setup/install.md">}}) Krew on your machine.

1. [Install and set up]({{<ref "setup/install.md">}}) Krew.
1. Download the plugin list:

```sh
Expand All @@ -21,16 +23,14 @@ Let's get started.

```sh
{{<prompt>}}kubectl krew search
{{<output>}}
NAME DESCRIPTION INSTALLED
{{<output>}}NAME DESCRIPTION INSTALLED
access-matrix Show an RBAC access matrix for server resources no
advise-psp Suggests PodSecurityPolicies for cluster. no
auth-proxy Authentication proxy to a pod or service no
bulk-action Do bulk actions on Kubernetes resources. no
ca-cert Print the PEM CA certificate of the current clu... no{{</output>}}
[...]{{</output>}}
```

1. Install a plugin:
1. Choose a plugin from the list and install it:

```sh
{{<prompt>}}kubectl krew install access-matrix
Expand Down
5 changes: 1 addition & 4 deletions site/content/docs/user-guide/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ advise-psp Suggests PodSecurityPolicies for cluster. no
auth-proxy Authentication proxy to a pod or service no
bulk-action Do bulk actions on Kubernetes resources. no
ca-cert Print the PEM CA certificate of the current clu... no
capture Triggers a Sysdig capture to troubleshoot the r... no
change-ns View or change the current namespace via kubectl. no
cluster-group Exec commands across a group of contexts. no
config-cleanup Automatically clean up your kubeconfig no
...{{</output>}}
```

You can specify search keywords as arguments:

```sh
Expand Down
11 changes: 11 additions & 0 deletions site/layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ partial "header.html" . }}

<h1 class="display-3 text-danger">Not found</h1>

<p class="lead">
Sorry, this URL cannot be found. Maybe it’s moved.
</p>

<a href=" {{ "/" }} " class="btn btn-lg btn-primary">&larr; Home</a>

{{ partial "footer.html" }}
22 changes: 22 additions & 0 deletions site/layouts/docs/section.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{ $isDocsHome := (eq .Slug "docs") }}
{{ partial "header.html" . }}
<article>
<h1>
{{ if $isDocsHome }}
Documentation
{{else}}
{{ .Title}}
{{end}}
</h1>

{{ with .Content }}
<aside class="lead">{{.}}</aside>
{{ end }}

{{ partial "toc.html" . }}

{{ if not $isDocsHome }}
{{ partial "backbutton.html" .}}
{{ end }}
</article>
{{ partial "footer.html" }}
7 changes: 2 additions & 5 deletions site/layouts/docs/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ partial "header.html" . }}
<article>
<article class="py-lg-3">
<h1>{{.Title}}</h1>
{{ with .Content }}
{{.}}
Expand All @@ -8,8 +8,5 @@ <h1>{{.Title}}</h1>
{{ end }}
</article>

<p>
<a href="{{ "/" | relURL }}" rel="home">
&larr; Table of Contents</a>
</p>
{{ partial "backbutton.html" .}}
{{ partial "footer.html" }}
11 changes: 9 additions & 2 deletions site/layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{{ partial "header.html" . }}

<article>
{{.Content}}

<h1 class="display-4">Documentation</h1>
{{ partial "toc.html" (.Site.GetPage "section" "docs") }}
<a href="{{ "/docs/user-guide/quickstart" | relURL }} " class="btn btn-primary text-nowrap">Quickstart</a>

<a href="{{ "/docs/user-guide" | relURL }} " class="btn btn-light text-nowrap">User Guide</a>

<a href="{{ "/docs/developer-guide" | relURL }} " class="btn btn-light text-nowrap">Developer Guide</a>

</article>

{{ partial "footer.html" }}
21 changes: 21 additions & 0 deletions site/layouts/partials/backbutton.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ $docsHome := "/docs" }}
{{ $userGuide := "/docs/user-guide" }}
{{ $devGuide := "/docs/developer-guide" }}

{{ $isUserGuide := .Parent.IsDescendant (.Site.GetPage "section" $userGuide) }}
{{ $isDevGuide := .Parent.IsDescendant (.Site.GetPage "section" $devGuide) }}

{{ $parent := "" }}
{{ if $isUserGuide }}
{{ $parent = $userGuide }}
{{ else if $isDevGuide }}
{{ $parent = $devGuide }}
{{ else }}
{{ $parent = $docsHome }}
{{ end }}

{{ $parent := .Site.GetPage "section" $parent }}

<a href="{{ $parent.RelPermalink}}" class="btn btn-link btn-sm rounded">
&larr; {{ $parent.Title }}
</a>
6 changes: 4 additions & 2 deletions site/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<small>
&copy; {{ now.Format "2006"}} The Kubernetes Authors.
Krew documentation is distributed under
<a href='https://creativecommons.org/licenses/by/4.0/' class='text-muted'>CC-BY-4.0</a>.
<a target="_blank" href='https://creativecommons.org/licenses/by/4.0/' class='text-muted'>CC-BY-4.0</a>.<br/>
Krew is a Kubernetes <a href="https://github.com/kubernetes/community/blob/master/sig-cli/README.md#cli-special-interest-group" target="_blank">SIG CLI</a> project.
</small>
</footer>
</div>
</div>
</div><!-- .container -->
</body>
</html>
23 changes: 19 additions & 4 deletions site/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,28 @@
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, max-scale=1.0, min-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

<title>{{.Title}}</title>
<title>
{{ if .IsHome }}
{{ .Site.Title }}
{{ else }}
{{ .Title }} &#183 Krew
{{ end }}

</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="{{"/css/style.css" | relURL}}" />
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
Comment on lines +18 to +19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are those two good for? I cant see where it's used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collapsible navbar (first sentence in the PR description) :)
We can use for more stuff in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah.. I should have resized my window 😄

</head>

<body>
<div class="container shadow-lg col-xl-6 rounded py-md-4 px-md-5 my-md-5">
<a href="{{"/" | relURL }}"><img src="{{ "/krew-logo.svg" }}" height="100vw"/></a>

<div class="container shadow-lg rounded
col-12 col-lg-8 col-xl-6
my-0 my-md-5
p-0">
{{ partial "navbar.html" . }}

<div class="py-md-4 pl-2 px-md-5">
29 changes: 29 additions & 0 deletions site/layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<nav class="navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="{{"/" | relURL }}">
<img src="{{ "/img/krew-logo.svg" }}" height="40vw"/>
</a>

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link {{if .IsHome}}active{{end}}" href="{{"/"|relURL}}">
Home
{{if .IsHome}}<span class="sr-only">(current)</span>{{end}}
</a>

{{ $isQuickstart := (eq .Slug "quickstart") }}
{{ $isDocs := (and (eq .Section "docs") (ne .Slug "quickstart")) }}

<a class="nav-item nav-link {{if $isQuickstart}}active{{end}}" href="{{ "/docs/user-guide/quickstart/" | relURL}}">
Quickstart
{{if $isQuickstart}}<span class="sr-only">(current)</span>{{end}}
</a>
<a class="nav-item nav-link {{if $isDocs}}active{{end}}" href="{{ "/docs/" | relURL}}">
Documentation
{{if $isDocs}}<span class="sr-only">(current)</span>{{end}}
</a>
<a class="nav-item nav-link" href="https://sigs.k8s.io/krew">GitHub</a>
</div>
</nav>
10 changes: 9 additions & 1 deletion site/static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
div.top-level-container {
max-width: 840px;
}

blockquote {
margin-left: 12px;
color: #555;
Expand All @@ -7,7 +11,7 @@ blockquote {
}

article h1, article h2, article h3, article h4 {
font-weight: 200;
font-weight: 300;
}

pre {
Expand All @@ -30,3 +34,7 @@ pre {
pre .cmdoutput {
color: #aaa;
}

.lead {
letter-spacing: -1px;
}
1 change: 1 addition & 0 deletions site/static/img/krew-logo.svg
1 change: 0 additions & 1 deletion site/static/krew-logo.svg

This file was deleted.