Skip to content

Commit 6824ec4

Browse files
committed
Provide a choice between ZFS and LVM, fix #2
1 parent 86d82b3 commit 6824ec4

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

content/en/docs/get-started.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,26 @@ example output:
305305

306306
create storage pools:
307307

308+
309+
310+
311+
{{< tabs name="create_storage_pools" >}}
312+
{{% tab name="ZFS" %}}
308313
```bash
309314
linstor ps cdp zfs srv1 /dev/sdb --pool-name data --storage-pool data
310315
linstor ps cdp zfs srv2 /dev/sdb --pool-name data --storage-pool data
311316
linstor ps cdp zfs srv3 /dev/sdb --pool-name data --storage-pool data
312317
```
318+
{{% /tab %}}
319+
320+
{{% tab name="LVM" %}}
321+
```bash
322+
linstor ps cdp lvm srv1 /dev/sdb --pool-name data --storage-pool data
323+
linstor ps cdp lvm srv2 /dev/sdb --pool-name data --storage-pool data
324+
linstor ps cdp lvm srv3 /dev/sdb --pool-name data --storage-pool data
325+
```
326+
{{% /tab %}}
327+
{{< /tabs >}}
313328

314329
list storage pools:
315330

layouts/shortcodes/tab.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ if .Parent }}
2+
{{ $name := trim (.Get "name") " " }}
3+
{{ $include := trim (.Get "include") " "}}
4+
{{ $codelang := .Get "codelang" }}
5+
{{ if not (.Parent.Scratch.Get "tabs") }}
6+
{{ .Parent.Scratch.Set "tabs" slice }}
7+
{{ end }}
8+
{{ with .Inner }}
9+
{{ if $codelang }}
10+
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" (highlight . $codelang "") ) }}
11+
{{ else }}
12+
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
13+
{{ end }}
14+
{{ else }}
15+
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "include" $include "codelang" $codelang) }}
16+
{{ end }}
17+
{{ else }}
18+
{{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}}
19+
{{ end}}

layouts/shortcodes/tabs.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{- .Page.Scratch.Add "tabset-counter" 1 -}}
2+
{{- $tab_set_id := .Get "name" | default (printf "tabset-%s-%d" (.Page.RelPermalink) (.Page.Scratch.Get "tabset-counter") ) | anchorize -}}
3+
{{- $tabs := .Scratch.Get "tabs" -}}
4+
{{- if .Inner -}}{{- /* We don't use the inner content, but Hugo will complain if we don't reference it. */ -}}{{- end -}}
5+
<ul class="nav nav-tabs" id="{{ $tab_set_id }}" role="tablist">
6+
{{- range $i, $e := $tabs -}}
7+
{{- $id := printf "%s-%d" $tab_set_id $i -}}
8+
{{- if (eq $i 0) -}}
9+
<li class="nav-item"><a data-toggle="tab" class="nav-link active" href="#{{ $id }}" role="tab" aria-controls="{{ $id }}" aria-selected="true">{{- trim .name " " -}}</a></li>
10+
{{ else }}
11+
<li class="nav-item"><a data-toggle="tab" class="nav-link" href="#{{ $id }}" role="tab" aria-controls="{{ $id }}">{{- trim .name " " -}}</a></li>
12+
{{- end -}}
13+
{{- end -}}
14+
</ul>
15+
<div class="tab-content" id="{{ $tab_set_id }}">
16+
{{- range $i, $e := $tabs -}}
17+
{{- $id := printf "%s-%d" $tab_set_id $i -}}
18+
{{- if (eq $i 0) -}}
19+
<div id="{{ $id }}" class="tab-pane show active" role="tabpanel" aria-labelledby="{{ $id }}">
20+
{{ else }}
21+
<div id="{{ $id }}" class="tab-pane" role="tabpanel" aria-labelledby="{{ $id }}">
22+
{{ end }}
23+
<p>
24+
{{- with .content -}}
25+
{{- . -}}
26+
{{- else -}}
27+
{{- if eq $.Page.BundleType "leaf" -}}
28+
{{- /* find the file somewhere inside the bundle. Note the use of double asterisk */ -}}
29+
{{- with $.Page.Resources.GetMatch (printf "**%s*" .include) -}}
30+
{{- if ne .ResourceType "page" -}}
31+
{{- /* Assume it is a file that needs code highlighting. */ -}}
32+
{{- $codelang := $e.codelang | default ( path.Ext .Name | strings.TrimPrefix ".") -}}
33+
{{- highlight .Content $codelang "" -}}
34+
{{- else -}}
35+
{{- .Content -}}
36+
{{- end -}}
37+
{{- end -}}
38+
{{- else -}}
39+
{{- $path := path.Join $.Page.File.Dir .include -}}
40+
{{- $page := site.GetPage "page" $path -}}
41+
{{- with $page -}}
42+
{{- .Content -}}
43+
{{- else -}}
44+
{{- errorf "[%s] tabs include not found for path %q" site.Language.Lang $path -}}
45+
{{- end -}}
46+
{{- end -}}
47+
{{- end -}}
48+
</div>
49+
{{- end -}}
50+
</div>

0 commit comments

Comments
 (0)