Skip to content

Commit 947f10c

Browse files
committed
Update sidebar behavior for v2 docs
1 parent d71867d commit 947f10c

File tree

2 files changed

+126
-46
lines changed

2 files changed

+126
-46
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
weight: 200
3+
title: CLI Installation
4+
description: "Documentation for the Crossplane command-line interface"
5+
---
6+
7+
The Crossplane CLI helps simplify some development and administration aspects of
8+
Crossplane.
9+
10+
The Crossplane CLI includes:
11+
* tools to build, install, update and push Crossplane Packages
12+
* standalone Composition Function testing and rendering without the need to access a Kubernetes cluster running Crossplane
13+
* troubleshoot Crossplane Compositions, Composite Resources and Managed Resources
14+
15+
## Installing the CLI
16+
17+
The Crossplane CLI is a single standalone binary with no external dependencies.
18+
19+
{{<hint "note" >}}
20+
Install the Crossplane CLI on a user's computer.
21+
22+
Most Crossplane CLI commands are independent of Kubernetes and
23+
don't require access to a Crossplane pod.
24+
{{< /hint >}}
25+
26+
To download the latest version for your CPU architecture with the Crossplane
27+
install script.
28+
29+
```shell
30+
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh
31+
```
32+
33+
[The script](https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh)
34+
detects your CPU architecture and downloads the latest stable release.
35+
36+
{{<expand "Manually install the Crossplane CLI" >}}
37+
38+
If you don't want to run shell script you can manually download a binary from
39+
the Crossplane releases repository at
40+
https://releases.crossplane.io/stable/current/bin
41+
42+
{{<hint "important" >}}
43+
<!-- vale write-good.Passive = NO -->
44+
The release repository names the CLI `crank`. Download this file.
45+
<!-- vale write-good.Passive = YES -->
46+
47+
The `crossplane` binary is the Kubernetes Crossplane pod image.
48+
{{< /hint >}}
49+
50+
Move the binary to a location in your `$PATH`, for example `/usr/local/bin`.
51+
{{< /expand >}}
52+
53+
### Download other CLI versions
54+
55+
Download different Crossplane CLI versions or different release branches with
56+
the `XP_CHANNEL` and `XP_VERSION` environmental variables.
57+
58+
By default the CLI installs from the `XP_CHANNEL` named `stable` and the
59+
`XP_VERSION` of `current`, matching the most recent stable release.
60+
61+
For example, to install CLI version `v1.14.0` add `XP_VERSION=v1.14.0` to the
62+
download script curl command:
63+
64+
`curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | XP_VERSION=v1.14.0 sh`
Lines changed: 62 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,67 @@
11
{{ $current := . }}
2-
32
<nav class="bd-links-nav w-100" aria-label="Docs navigation">
4-
{{ with .Site.GetPage "section" .Section }}
5-
{{ $sectionPages := (.Pages | append .) }}
6-
{{ range $sectionPages.ByWeight }}
7-
{{ $expand := (eq $current .) }}
8-
{{ $expand = (and (eq $current.CurrentSection .) (ne .FirstSection .)) }}
9-
{{ $id := substr (sha1 .Permalink) 0 8 }}
10-
11-
{{ if not .Page.Params.tocHidden }}
12-
<div class="section-container container pe-0 pt-1">
13-
<div class="container nav-container pe-0 d-flex w-100 {{if eq . $current}}active{{ else if $expand }}active-parent{{end}}">
14-
<a class="d-flex w-100 border-0" href="{{.Permalink}}">{{ .Title }} </a>
15-
{{ if and .IsSection (ne .FirstSection .) }}
16-
{{/* Don't put an expand icon on pages that aren't sections or the section index */}}
17-
<div class="d-flex flex-shrink-1 sidebar-control-container align-self-center">
18-
<input type="checkbox" class="d-flex sidebar-checkbox" {{if $expand}}checked{{ end }} aria-label="Close or Expand {{.Title}} Section" />
19-
<label for="collapse-{{$id}}" class="sidebar-label {{if not $expand}} collapsed {{ end }}" data-bs-toggle="collapse" data-bs-target="#collapse-{{$id}}" aria-expanded="false" aria-label="Close or Expand {{.Title}} Section">
20-
<svg class="flex bi sidebar-icon plus" ><use xlink:href="#plus"></use></svg>
21-
<svg class="flex bi sidebar-icon x " ><use xlink:href="#x"></use></svg>
3+
{{ with .Site.GetPage "section" .Section }} {{ $sectionPages := (.Pages |
4+
append .) }} {{ range $sectionPages.ByWeight }} {{ $expand := (eq $current
5+
.) }} {{ $expand = (and (eq $current.CurrentSection .) (ne .FirstSection .))
6+
}} {{ $id := substr (sha1 .Permalink) 0 8 }} {{ if not
7+
.Page.Params.tocHidden }}
8+
<div class="section-container container pe-0 pt-1">
9+
<div
10+
class="container nav-container pe-0 d-flex w-100 {{if eq . $current}}active{{ else if $expand }}active-parent{{end}}"
11+
{{ if and .IsSection (ne .FirstSection .) (gt (len .Pages) 0) }}data-bs-toggle="collapse" data-bs-target="#collapse-{{$id}}" aria-expanded="{{if $expand}}true{{else}}false{{end}}"{{ end }}
12+
>
13+
{{ if .Page.Params.nolink }}
14+
<span class="d-flex w-100 border-0">{{ .Title }} </span>
15+
{{ else }}
16+
<a class="d-flex w-100 border-0" href="{{.Permalink}}"
17+
>{{ .Title }}
18+
</a>
19+
{{ end }} {{ if and .IsSection (ne .FirstSection .) }} {{/* Don't
20+
put an expand icon on pages that aren't sections or the section
21+
index */}}
22+
<div
23+
class="d-flex flex-shrink-1 sidebar-control-container align-self-center"
24+
>
25+
<input
26+
type="checkbox"
27+
class="d-flex sidebar-checkbox"
28+
{{if
29+
$expand}}checked{{
30+
end
31+
}}
32+
aria-label="Close or Expand {{.Title}} Section"
33+
/>
34+
<label
35+
class="sidebar-label {{if not $expand}} collapsed {{ end }}"
36+
>
37+
<svg class="flex bi sidebar-icon plus">
38+
<use xlink:href="#plus"></use>
39+
</svg>
40+
<svg class="flex bi sidebar-icon x">
41+
<use xlink:href="#x"></use>
42+
</svg>
2243
</label>
23-
</div>
44+
</div>
2445
{{ end }}
25-
</div>
26-
{{ if ne .FirstSection . }}
27-
{{ range .Pages }}
28-
{{ if not .Page.Params.tocHidden }}
29-
<div class="container flex-row collapse {{if $expand}} show {{ end }}" id="collapse-{{$id }}">
30-
<div class="d-flex flex-column">
31-
<a class="bd-links d-flex {{if eq $current . }}active{{end}}" href="{{ .Permalink }} ">{{.Title }}</a>
32-
</div>
33-
</div>
34-
{{ end }}
35-
{{ end }}
36-
{{ end }}
3746
</div>
38-
{{ end }}
39-
{{ end }}
40-
{{ end }}
41-
42-
{{ if not ($.Param "docs") }}
43-
{{ partialCached "sidebar/user-docs" . }}
44-
{{ end }}
45-
46-
{{ if ne .Page.Params.product "Contributing Guide" }}
47-
{{ partialCached "sidebar/contributing-guide" . }}
48-
{{ end }}
49-
50-
{{ partialCached "sidebar/roadmap" . }}
51-
</nav>
47+
{{ if ne .FirstSection . }} {{ range .Pages }} {{ if not
48+
.Page.Params.tocHidden }}
49+
<div
50+
class="container flex-row collapse {{if $expand}} show {{ end }}"
51+
id="collapse-{{$id }}"
52+
>
53+
<div class="d-flex flex-column">
54+
<a
55+
class="bd-links d-flex {{if eq $current . }}active{{end}}"
56+
href="{{ .Permalink }} "
57+
>{{.Title }}</a
58+
>
59+
</div>
60+
</div>
61+
{{ end }} {{ end }} {{ end }}
62+
</div>
63+
{{ end }} {{ end }} {{ end }} {{ if not ($.Param "docs") }} {{ partialCached
64+
"sidebar/user-docs" . }} {{ end }} {{ if ne .Page.Params.product
65+
"Contributing Guide" }} {{ partialCached "sidebar/contributing-guide" . }}
66+
{{ end }} {{ partialCached "sidebar/roadmap" . }}
67+
</nav>

0 commit comments

Comments
 (0)