Feat: link shortcode add external-icon option (#96)

This commit is contained in:
Cell
2022-04-12 12:42:32 +08:00
parent 8ad74ede2f
commit 9f47e608ef
4 changed files with 10 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- :sparkles: Feat: enhance link render ([#96](https://github.com/Lruihao/FixIt/issues/96))
- Add external icon for external links automatically
- Add download icon for downloadable links
- :sparkles: Feat: link shortcode add `external-icon` option ([#96](https://github.com/Lruihao/FixIt/issues/96))
- :bug: Fix: invalid front matter `comment: true` ([#108](https://github.com/Lruihao/FixIt/issues/108))
- :sparkles: Style: add some common CSS styles Class ([#101](https://github.com/Lruihao/FixIt/issues/101))
- :memo: Docs: revised theme documentation
@@ -101,6 +101,10 @@ The `link` shortcode has the following named parameters:
Additional `rel` attributes of the HTML `a` tag.
* **external-icon** *[optional]* {{< version 0.2.14 >}}
whether to add external Icon for external links automatically
Example `link` input:
```go-html-template
@@ -103,6 +103,10 @@ This is a **right-aligned** paragraph.
HTML `a` 标签 的 `rel` 补充属性。
* **external-icon** *[可选]* {{< version 0.2.14 >}}
是否自动显示外链图标
一个 `link` 示例:
```go-html-template
+1 -1
View File
@@ -15,5 +15,5 @@
{{- $options = dict "Title" (.Get 2) | merge $options -}}
{{- $options = dict "Card" (.Get 3) | merge $options -}}
{{- end -}}
{{- $options = dict "ExternalIcon" .Site.Params.externalIcon | merge $options -}}
{{- $options = dict "ExternalIcon" (.Get "external-icon" | default .Site.Params.externalIcon ) | merge $options -}}
{{- partial "plugin/link.html" $options -}}