Skip to content

Commit

Permalink
Merge pull request #1168 from quarto-dev/issues/8307
Browse files Browse the repository at this point in the history
Add indexing example to meta shortcode
  • Loading branch information
cwickham authored Jun 18, 2024
2 parents 460af2e + 8c88aa7 commit 462c157
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/authoring/variables.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,19 @@ For example, the following shortcode inserts the value of the `title` field from
{{< meta title >}}
```

You can dereference sub-keys using the dot (`.)` delimiter. For example:
You can dereference sub-keys using the dot (`.`) delimiter. For example:

``` {.markdown shortcodes="false"}
{{< meta labels.description >}}
```

You can also index into an array with the dot (`.`) delimiter. For example, to
extract the first in the array of authors:

``` {.markdown shortcodes="false"}
{{< meta author.1 >}}
```

## env {#env}

The `env` shortcode enables you to read values from environment variables. For example:
Expand Down

0 comments on commit 462c157

Please sign in to comment.