對文本進行編碼以保護電子郵件地址和電話號碼不受垃圾郵件機器人的攻擊。
成為我們的資助者或贊助商,以支持我們的工作。
| Module | github.com/hugomods/encoder |
|---|---|
| Stats |
encode 短代碼encode 短代碼語法1{{< encode [text] >}}
encode 短代碼參數text| 索引 | 名稱 | 類型 | 必填 | 默認值 | 版本 | 示例 |
|---|---|---|---|---|---|---|
#0 | text | string | ✓ | - | - | - |
待編碼的文本。
1{{< encode "user@example.org" >}}1{{< encode "123-12345678" >}}encode-link 短代碼encode-link 短代碼語法1{{< encode-link [protocol] [target] [text] >}}
encode-link 短代碼參數protocol| 索引 | 名稱 | 類型 | 必填 | 默認值 | 版本 | 示例 |
|---|---|---|---|---|---|---|
#0 | protocol | string | ✓ | - | - | - |
鏈接協議,比如 mailto、tel。
target| 索引 | 名稱 | 類型 | 必填 | 默認值 | 版本 | 示例 |
|---|---|---|---|---|---|---|
#1 | target | string | ✓ | - | - | - |
鏈接目標,如郵箱地址([email protected])、電話號碼(123-12345678)。
text| 索引 | 名稱 | 類型 | 必填 | 默認值 | 版本 | 示例 |
|---|---|---|---|---|---|---|
#0 | text | string | - | - | - | - |
鏈接文本,默認為 target。
*| 索引 | 名稱 | 類型 | 必填 | 默認值 | 版本 | 示例 |
|---|---|---|---|---|---|---|
| - | * | string | - | - | - | - |
其他參數將作為鏈接屬性,比如 class、rel。。
encode-link 郵箱鏈接示例1{{< encode-link "mailto" "user@example.org" >}}
2
3{{< encode-link protocol="mailto" target="user@example.org" text="Send me an email." >}}
4
5{{< encode-link protocol="mailto" target="user@example.org" text="Send me an email." class="text-success" >}}encode-link 電話號碼示例1{{< encode-link "tel" "123-1234567" >}}
2
3{{< encode-link protocol="tel" target="123-12345678" text="Call me." >}}
4
5{{< encode-link protocol="tel" target="123-12345678" text="Call me." class="text-success" >}}encode-email 短代碼encode-link 郵箱鏈接短代碼的快捷方式,其無需指定 protocol 參數。
1{{< encode-email [target] [text] >}}
encode-tel 短代碼encode-link 電話號碼短代碼的快捷方式,其無需指定 protocol 參數。
1{{< encode-tel [target] [text] >}}