Skip to content

Commit 22c1a4f

Browse files
ldezimfing
andauthored
feat(badges): colors and border (#774)
* feat(badges): add more colors and allow to disable the border * feat(badges): more colors * chore: generate * docs: add Others inside the sidebar * chore: i18n --------- Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>
1 parent 7b8e1bd commit 22c1a4f

11 files changed

Lines changed: 331 additions & 142 deletions

File tree

assets/css/compiled/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exampleSite/content/docs/guide/shortcodes/cards.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ linkTitle: Cards
3737

3838
## Card Parameters
3939

40-
| Parameter | Description |
41-
|------------|-----------------------------------------------------------------|
42-
| `link` | URL (internal or external). |
43-
| `title` | Title heading for the card. |
44-
| `subtitle` | Subtitle heading (supports Markdown). |
45-
| `icon` | Name of the icon. |
46-
| `tag` | Text in tag. |
47-
| `tagType` | Type of the tag: default (gray), `info`, `warning` and `error`. |
48-
40+
| Parameter | Description |
41+
|------------|---------------------------------------------------------------------------------------|
42+
| `link` | URL (internal or external). |
43+
| `title` | Title heading for the card. |
44+
| `subtitle` | Subtitle heading (supports Markdown). |
45+
| `icon` | Name of the icon. See [icons]({{% relRef "icon" %}}) for more information. |
46+
| `tag` | Text in tag. |
47+
| `tagColor` | Color of the tag. See [badges]({{% relRef "others/#badges" %}}) for more information. |
48+
4949
## Image Card
5050

5151
Additionally, the card supports adding image and processing through these parameters:
@@ -74,18 +74,19 @@ Card supports adding tags which could be useful to show extra status information
7474

7575
{{< cards >}}
7676
{{< card link="../callout" title="Card with default tag" tag="tag text" >}}
77-
{{< card link="../callout" title="Card with error tag" tag="tag text" tagType="error" >}}
78-
{{< card link="../callout" title="Card with info tag" tag="tag text" tagType="info" >}}
79-
{{< card link="../callout" title="Card with warning tag" tag="tag text" tagType="warning" >}}
80-
{{< card link="/" title="Image Card" image="https://github.com/user-attachments/assets/71b7e3ec-1a8d-4582-b600-5425c6cc0407" subtitle="Internet Image" tag="tag text" tagType="error" >}}
77+
{{< card link="../callout" title="Card with red tag" tag="tag text" tagColor="red" >}}
78+
{{< card link="../callout" title="Card with blue tag" tag="tag text" tagColor="blue" >}}
79+
{{< card link="../callout" title="Card with yellow tag" tag="tag text" tagColor="yellow" >}}
80+
{{< card link="/" title="Image Card" image="images/space.jpg" subtitle="Internet Image" tag="tag text" tagColor="red" >}}
8181
{{< /cards >}}
8282

8383
```
8484
{{</* cards */>}}
8585
{{</* card link="../callout" title="Card with default tag color" tag="tag text" */>}}
86-
{{</* card link="../callout" title="Card with default red tag" tag="tag text" tagType="error" */>}}
87-
{{</* card link="../callout" title="Card with blue tag" tag="tag text" tagType="info" */>}}
88-
{{</* card link="../callout" title="Card with yellow tag" tag="tag text" tagType="warning" */>}}
86+
{{</* card link="../callout" title="Card with red tag" tag="tag text" tagColor="red" */>}}
87+
{{</* card link="../callout" title="Card with blue tag" tag="tag text" tagColor="blue" */>}}
88+
{{</* card link="../callout" title="Card with yellow tag" tag="tag text" tagColor="yellow" */>}}
89+
{{</* card link="/" title="Image Card" image="images/space.jpg" subtitle="Internet Image" tag="tag text" tagColor="red" */>}}
8990
{{</* /cards */>}}
9091
```
9192

exampleSite/content/docs/guide/shortcodes/others.fa.md

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: سایر شورتکدها
33
linkTitle: سایر
4-
sidebar:
5-
exclude: true
64
next: /docs/guide/deploy-site
75
---
86

@@ -11,49 +9,90 @@ next: /docs/guide/deploy-site
119
این شورتکدها کمتر پایدار در نظر گرفته می‌شوند و ممکن است هر زمان تغییر کنند.
1210
{{< /callout >}}
1311

14-
## نشان
12+
### أمثلة
1513

16-
```
17-
{{</* badge "نشان" */>}}
18-
```
14+
{{< badge "default" >}}&nbsp;
15+
{{< badge content="border" border=false >}}&nbsp;
16+
{{< badge content="color" color="green" >}}&nbsp;
17+
{{< badge content="link" link="https://github.com/imfing/hextra/releases" >}}&nbsp;
18+
{{< badge content="icon" icon="sparkles" >}}&nbsp;
1919

20-
نتیجه:
20+
### الاستخدام
2121

22-
{{< badge "نشان" >}}
22+
#### تقصير
2323

24-
انواع مختلف:
24+
{{< badge "Badge" >}}&nbsp;
2525

2626
```
27-
{{</* badge content="اطلاعات" type="info" */>}}
28-
{{</* badge content="هشدار" type="warning" */>}}
29-
{{</* badge content="خطا" type="error" */>}}
27+
{{</* badge "Badge" */>}}
3028
```
3129

32-
نتیجه:
30+
#### الألوان
3331

34-
{{< badge content="اطلاعات" type="info" >}} &nbsp;
35-
{{< badge content="هشدار" type="warning" >}} &nbsp;
36-
{{< badge content="خطا" type="error" >}}
32+
{{< badge content="Badge" >}}&nbsp;
33+
{{< badge content="Badge" color="purple" >}}&nbsp;
34+
{{< badge content="Badge" color="indigo" >}}&nbsp;
35+
{{< badge content="Badge" color="blue" >}} &nbsp;
36+
{{< badge content="Badge" color="green" >}} &nbsp;
37+
{{< badge content="Badge" color="yellow" >}} &nbsp;
38+
{{< badge content="Badge" color="amber" >}} &nbsp;
39+
{{< badge content="Badge" color="orange" >}} &nbsp;
40+
{{< badge content="Badge" color="red" >}}&nbsp;
3741

38-
با لینک و آیکون:
42+
```
43+
{{</* badge content="Badge" */>}}
44+
{{</* badge content="Badge" color="purple" */>}}
45+
{{</* badge content="Badge" color="indigo" */>}}
46+
{{</* badge content="Badge" color="blue" */>}}
47+
{{</* badge content="Badge" color="green" */>}}
48+
{{</* badge content="Badge" color="yellow" */>}}
49+
{{</* badge content="Badge" color="amber" */>}}
50+
{{</* badge content="Badge" color="orange" */>}}
51+
{{</* badge content="Badge" color="red" */>}}
52+
```
53+
54+
{{< badge content="Badge" border=false >}} &nbsp;
55+
{{< badge content="Badge" color="purple" border=false >}} &nbsp;
56+
{{< badge content="Badge" color="indigo" border=false >}} &nbsp;
57+
{{< badge content="Badge" color="blue" border=false >}} &nbsp;
58+
{{< badge content="Badge" color="green" border=false >}} &nbsp;
59+
{{< badge content="Badge" color="yellow" border=false >}} &nbsp;
60+
{{< badge content="Badge" color="amber" border=false >}} &nbsp;
61+
{{< badge content="Badge" color="orange" border=false >}}&nbsp;
62+
{{< badge content="Badge" color="red" border=false >}}&nbsp;
3963

4064
```
41-
{{</* badge content="انتشارها" link="https://github.com/imfing/hextra/releases" icon="github" */>}}
65+
{{</* badge content="Badge" border=false */>}}
66+
{{</* badge content="Badge" color="purple" border=false */>}}
67+
{{</* badge content="Badge" color="indigo" border=false */>}}
68+
{{</* badge content="Badge" color="blue" border=false */>}}
69+
{{</* badge content="Badge" color="green" border=false */>}}
70+
{{</* badge content="Badge" color="yellow" border=false */>}}
71+
{{</* badge content="Badge" color="amber" border=false */>}}
72+
{{</* badge content="Badge" color="orange" border=false */>}}
73+
{{</* badge content="Badge" color="red" border=false */>}}
4274
```
4375

44-
نتیجه:
76+
#### المتغيرات
77+
78+
{{< badge content="Badge" icon="sparkles" >}}&nbsp;
79+
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}&nbsp;
4580

46-
{{< badge content="انتشارها" link="https://github.com/imfing/hextra/releases" icon="github" >}}
81+
```
82+
{{</* badge content="Badge" icon="sparkles" */>}}
83+
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" */>}}
84+
```
4785

4886
### خيارات
4987

50-
| المعلمة | وصف |
51-
|-----------|---------------------------------------------------|
52-
| `content` | نص الشارة. |
53-
| `link` | رابط الشارة. |
54-
| `icon` | رمز الشارة. |
55-
| `type` | نوع الشارة. (افتراضي، `info`، `warning`، `error`) |
56-
| `class` | فئة الشارة. |
88+
| المعلمة | وصف |
89+
|-----------|-----------------------------------------------------------------------------------------------------------|
90+
| `content` | نص الشارة. |
91+
| `link` | رابط الشارة. |
92+
| `icon` | رمز الشارة. |
93+
| `color` | `gray` (تقصير), `purple`, `indigo`, `blue`, `green`, `yellow`, `amber`, `orange`, `red`.<br/> لون الشارة. |
94+
| `class` | فئة الشارة. |
95+
| `border` | إضافة أو إزالة الحدود (افتراضي: true |
5796

5897
## یوتیوب
5998

exampleSite/content/docs/guide/shortcodes/others.ja.md

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: その他のショートコード
33
linkTitle: その他
4-
sidebar:
5-
exclude: true
64
next: /docs/guide/deploy-site
75
---
86

@@ -11,49 +9,90 @@ next: /docs/guide/deploy-site
119
これらのショートコードは安定性が低く、いつでも変更される可能性があります。
1210
{{< /callout >}}
1311

14-
## バッジ
12+
###
13+
14+
{{< badge "default" >}}&nbsp;
15+
{{< badge content="border" border=false >}}&nbsp;
16+
{{< badge content="color" color="green" >}}&nbsp;
17+
{{< badge content="link" link="https://github.com/imfing/hextra/releases" >}}&nbsp;
18+
{{< badge content="icon" icon="sparkles" >}}&nbsp;
19+
20+
### 使用法
21+
22+
#### デフォルト
23+
24+
{{< badge "Badge" >}}&nbsp;
1525

1626
```
1727
{{</* badge "Badge" */>}}
1828
```
1929

20-
結果:
21-
22-
{{< badge "Badge" >}}
30+
####
2331

24-
バリエーション:
32+
{{< badge content="Badge" >}}&nbsp;
33+
{{< badge content="Badge" color="purple" >}}&nbsp;
34+
{{< badge content="Badge" color="indigo" >}}&nbsp;
35+
{{< badge content="Badge" color="blue" >}} &nbsp;
36+
{{< badge content="Badge" color="green" >}} &nbsp;
37+
{{< badge content="Badge" color="yellow" >}} &nbsp;
38+
{{< badge content="Badge" color="amber" >}} &nbsp;
39+
{{< badge content="Badge" color="orange" >}} &nbsp;
40+
{{< badge content="Badge" color="red" >}}&nbsp;
2541

2642
```
27-
{{</* badge content="info" type="info" */>}}
28-
{{</* badge content="warning" type="warning" */>}}
29-
{{</* badge content="error" type="error" */>}}
43+
{{</* badge content="Badge" */>}}
44+
{{</* badge content="Badge" color="purple" */>}}
45+
{{</* badge content="Badge" color="indigo" */>}}
46+
{{</* badge content="Badge" color="blue" */>}}
47+
{{</* badge content="Badge" color="green" */>}}
48+
{{</* badge content="Badge" color="yellow" */>}}
49+
{{</* badge content="Badge" color="amber" */>}}
50+
{{</* badge content="Badge" color="orange" */>}}
51+
{{</* badge content="Badge" color="red" */>}}
3052
```
3153

32-
結果:
54+
{{< badge content="Badge" border=false >}} &nbsp;
55+
{{< badge content="Badge" color="purple" border=false >}} &nbsp;
56+
{{< badge content="Badge" color="indigo" border=false >}} &nbsp;
57+
{{< badge content="Badge" color="blue" border=false >}} &nbsp;
58+
{{< badge content="Badge" color="green" border=false >}} &nbsp;
59+
{{< badge content="Badge" color="yellow" border=false >}} &nbsp;
60+
{{< badge content="Badge" color="amber" border=false >}} &nbsp;
61+
{{< badge content="Badge" color="orange" border=false >}}&nbsp;
62+
{{< badge content="Badge" color="red" border=false >}}&nbsp;
3363

34-
{{< badge content="info" type="info" >}} &nbsp;
35-
{{< badge content="warning" type="warning" >}} &nbsp;
36-
{{< badge content="error" type="error" >}}
64+
```
65+
{{</* badge content="Badge" border=false */>}}
66+
{{</* badge content="Badge" color="purple" border=false */>}}
67+
{{</* badge content="Badge" color="indigo" border=false */>}}
68+
{{</* badge content="Badge" color="blue" border=false */>}}
69+
{{</* badge content="Badge" color="green" border=false */>}}
70+
{{</* badge content="Badge" color="yellow" border=false */>}}
71+
{{</* badge content="Badge" color="amber" border=false */>}}
72+
{{</* badge content="Badge" color="orange" border=false */>}}
73+
{{</* badge content="Badge" color="red" border=false */>}}
74+
```
75+
76+
#### 変種
3777

38-
リンクとアイコン付き:
78+
{{< badge content="Badge" icon="sparkles" >}}&nbsp;
79+
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}&nbsp;
3980

4081
```
82+
{{</* badge content="Badge" icon="sparkles" */>}}
4183
{{</* badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" */>}}
4284
```
4385

44-
結果:
45-
46-
{{< badge content="Releases" link="https://github.com/imfing/hextra/releases" icon="github" >}}
47-
4886
### オプション
4987

50-
| パラメータ | 説明 |
51-
|-----------|-----------------------------------------|
52-
| `content` | バッジのテキスト。 |
53-
| `link` | バッジのリンク。 |
54-
| `icon` | バッジのアイコン。 |
55-
| `type` | バッジの種類。(デフォルト、`info``warning``error`) |
56-
| `class` | バッジのクラス。 |
88+
| パラメータ | 説明 |
89+
|-----------|--------------------------------------------------------------------------------------------------------------------------|
90+
| `content` | バッジのテキスト。 |
91+
| `link` | バッジのリンク。 |
92+
| `icon` | バッジのアイコン。 |
93+
| `color` | The color of the badge. <br/> `gray` (default), `purple`, `indigo`, `blue`, `green`, `yellow`, `amber`, `orange`, `red`. |
94+
| `class` | バッジのクラス。 |
95+
| `border` | 境界線を追加または削除します (デフォルト: true)。 |
5796

5897
## YouTube
5998

0 commit comments

Comments
 (0)