Skip to content

Commit 6e6fd34

Browse files
docs(yaml): use quotes where relevant
resolves #229
1 parent 2639f29 commit 6e6fd34

File tree

2 files changed

+47
-37
lines changed

2 files changed

+47
-37
lines changed

website/docs/setup/link.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Create symlinks to files and directories. Will validate the targets exist before
1010

1111
```yaml
1212
link:
13-
- name: {{ .Home }}/.aliae.yaml
14-
target: {{ .Home }}/dotfiles/aliae.yaml
15-
- name: {{ .Home }}/.zshrc
16-
target: {{ .Env.DOTFILES }}/config/zsh/zshrc
17-
- name: {{ .Home }}/Brewfile
13+
- name: '{{ .Home }}/.aliae.yaml'
14+
target: '{{ .Home }}/dotfiles/aliae.yaml'
15+
- name: '{{ .Home }}/.zshrc'
16+
target: '{{ .Env.DOTFILES }}/config/zsh/zshrc'
17+
- name: '{{ .Home }}/Brewfile'
1818
value: /some/location/Brewfile
1919
if: eq .OS "darwin"
2020
```

website/docs/setup/templates.mdx

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
1-
---
2-
id: templates
3-
title: Templates
4-
sidebar_label: 🏛️ Templates
5-
---
6-
7-
## Example
8-
9-
```yaml
10-
env:
11-
- name: POSH_THEME
12-
value: {{ .Home }}/.configs/posh.omp.yaml
13-
```
14-
15-
## Description
16-
17-
Some fields have [text/template][go-text-template] abilities, allowing to reuse the same
18-
configuration across multiple environments resulting in environment specific values.
19-
20-
Out of the box you get the following functionality:
21-
22-
| Name | Type | Description | Example |
23-
| ------------ | --------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
24-
| `.Shell` | `string` | the current shell name | `{{ .Shell }}` |
25-
| `.Home` | `string` | the user's `$HOME` folder | `{{ .Home }}/go/bin/aliae` |
26-
| `.OS` | `string` | the current operating system (`windows`, `darwin`, `linux`) | `{{ .Home }}/go/bin/aliae{{ if eq .OS "windows" }}.exe{{ end }}` |
27-
| `.Arch` | `string` | the `aliae` executable's compiled architecture | `{{ .Home }}/go/bin/aliae-{{ .Arch }}{{ if eq .OS "windows" }}.exe{{ end }}` |
28-
| `env` | `string` | retrieve an environment variable value | `{{ env "POSH_THEME" }}` |
29-
| `match` | `boolean` | match a shell name to one or multiple options | `{{ match .Shell "zsh" "bash" }}` |
30-
| `hasCommand` | `boolean` | check if an executable exists | `{{ hasCommand "oh-my-posh" }}` |
31-
32-
[go-text-template]: https://golang.org/pkg/text/template/
1+
---
2+
id: templates
3+
title: Templates
4+
sidebar_label: 🏛️ Templates
5+
---
6+
7+
## Example
8+
9+
```yaml
10+
env:
11+
- name: POSH_THEME
12+
value: '{{ .Home }}/.configs/posh.omp.yaml'
13+
```
14+
15+
## Description
16+
17+
Some fields have [text/template][go-text-template] abilities, allowing to reuse the same
18+
configuration across multiple environments resulting in environment specific values.
19+
20+
Out of the box you get the following functionality:
21+
22+
| Name | Type | Description | Example |
23+
| ------------ | --------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
24+
| `.Shell` | `string` | the current shell name | `{{ .Shell }}` |
25+
| `.Home` | `string` | the user's `$HOME` folder | `{{ .Home }}/go/bin/aliae` |
26+
| `.OS` | `string` | the current operating system (`windows`, `darwin`, `linux`) | `{{ .Home }}/go/bin/aliae{{ if eq .OS "windows" }}.exe{{ end }}` |
27+
| `.Arch` | `string` | the `aliae` executable's compiled architecture | `{{ .Home }}/go/bin/aliae-{{ .Arch }}{{ if eq .OS "windows" }}.exe{{ end }}` |
28+
| `env` | `string` | retrieve an environment variable value | `{{ env "POSH_THEME" }}` |
29+
| `match` | `boolean` | match a shell name to one or multiple options | `{{ match .Shell "zsh" "bash" }}` |
30+
| `hasCommand` | `boolean` | check if an executable exists | `{{ hasCommand "oh-my-posh" }}` |
31+
32+
:::tip
33+
When using a template in a single line, you have to use quotes to wrap the template string.
34+
35+
```yaml
36+
env:
37+
- name: POSH_THEME
38+
value: '{{ .Home }}/.configs/posh.omp.yaml'
39+
```
40+
:::
41+
42+
[go-text-template]: https://golang.org/pkg/text/template/

0 commit comments

Comments
 (0)