Skip to content

Commit

Permalink
docs: improve icon shortcode documentation (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
imfing authored Oct 25, 2023
1 parent 97e6945 commit e135f5a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions exampleSite/content/docs/guide/shortcodes/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ To use this shortcode inline, inline shortcode needs to be enabled in the config
enableInlineShortcodes: true
```
The list of available icons can be found in `data/icons.yaml`.
List of available icons can be found in [`data/icons.yaml`](https://github.com/imfing/hextra/blob/main/data/icons.yaml).

<!--more-->

## Example

Expand All @@ -25,14 +27,20 @@ The list of available icons can be found in `data/icons.yaml`.
[Heroicons](https://v1.heroicons.com/) v1 outline icons are available out of the box.
You can also add your own icons by adding them to `data/icon.yaml`:
### How to add your own icons
Create `data/icons.yaml` file, then add your own SVG icons in the following format:
```yaml {filename="data/icon.yaml"}
```yaml {filename="data/icons.yaml"}
your-icon: <svg>your icon svg content</svg>
```

which can then be used like this:
It then can be used in the shortcode like this:

```
{{</* icon "your-icon" */>}}
{{</* card icon="your-icon" */>}}
```

Tip: [Iconify Design](https://iconify.design/) is a great place to find SVG icons for your site.

0 comments on commit e135f5a

Please sign in to comment.