midtowndrafting.com/content/docs/guide/shortcodes/icon.fa.md
2024-05-03 19:04:48 -04:00

47 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: آیکون
---
برای استفاده از این کد کوتاه درون‌خطی، باید آن را در پیکربندی فعال کنید:
```yaml {filename="hugo.yaml"}
enableInlineShortcodes: true
```
فهرست آیکون‌های موجود را می‌توانید در [`data/icons.yaml`](https://github.com/imfing/hextra/blob/main/data/icons.yaml) پیدا کنید.
<!--more-->
## مثال
{{< icon "academic-cap" >}}
{{< icon "cake" >}}
{{< icon "gift" >}}
{{< icon "sparkles" >}}
## استفاده
```
{{</* icon "github" */>}}
```
آیکون‌های با طرح‌های متفاوت در [Heroicons](https://v1.heroicons.com/) نسخه ۱ خارج از جعبه در دسترس هستند.
### چجوری آیکون‌های خودمان را اضافه کنیم
پرونده `data/icons.yaml` را ایجاد کنید، سپس آیکون‌های SVG خود را در فرمت زیر اضافه کنید:
```yaml {filename="data/icons.yaml"}
your-icon: <svg>your icon svg content</svg>
```
سپس می‌توان آن را در کد کوتاه مانند زیر استفاده کرد:
```
{{</* icon "your-icon" */>}}
{{</* card icon="your-icon" */>}}
```
نکته: [Iconify Design](https://iconify.design/) مکانی عالی برای پیدا کردن آیکون‌های SVG برای سایت شما است.