1
0
Fork 0
mirror of https://github.com/dillonzq/LoveIt.git synced 2025-04-27 06:06:20 +02:00

fix(shortcode): replace deprecated tweet shortcode with x

This commit is contained in:
Dillon 2025-03-04 23:05:44 +08:00
parent 08d05ab7eb
commit e0aba35955
9 changed files with 28 additions and 16 deletions
exampleSite
content/posts
theme-documentation-basics
theme-documentation-built-in-shortcodes
hugo.toml
layouts
partials/internal
shortcodes

View file

@ -807,9 +807,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
[privacy.googleAnalytics]
# ...
[privacy.twitter]
enableDNT = true
# ...
[privacy.youtube]
privacyEnhanced = true
# ...
# Options to make output .md files
[mediaTypes]

View file

@ -809,9 +809,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
[privacy.googleAnalytics]
# ...
[privacy.twitter]
enableDNT = true
# ...
[privacy.youtube]
privacyEnhanced = true
# ...
# 用于输出 Markdown 格式文档的设置
[mediaTypes]

View file

@ -136,19 +136,19 @@ The rendered output looks like this:
[Documentation of `ref` and `relref`](https://gohugo.io/content-management/shortcodes#ref-and-relref)
## 7 tweet
## 7 x
[Documentation of `tweet`](https://gohugo.io/content-management/shortcodes#tweet)
[Documentation of `x`](https://gohugo.io/shortcodes/x/)
Example `tweet` input:
Example `x` input:
```markdown
{{</* tweet user=GoHugoIO id=917359331535966209 */>}}
{{</* x user=GoHugoIO id=917359331535966209 */>}}
```
The rendered output looks like this:
{{< tweet user=GoHugoIO id=917359331535966209 >}}
{{< x user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo

View file

@ -137,19 +137,19 @@ For more information please have a look at GitHub issue [#7879](https://github.c
[`ref` 和 `relref` 的文档](https://gohugo.io/content-management/shortcodes#ref-and-relref)
## 7 tweet
## 7 x
[`tweet` 的文档](https://gohugo.io/content-management/shortcodes#tweet)
[`x` 的文档](https://gohugo.io/shortcodes/x/)
一个 `tweet` 示例:
一个 `x` 示例:
```markdown
{{</* tweet user=GoHugoIO id=917359331535966209 */>}}
{{</* x user=GoHugoIO id=917359331535966209 */>}}
```
呈现的输出效果如下:
{{< tweet user=GoHugoIO id=917359331535966209 >}}
{{< x user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo

View file

@ -763,9 +763,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
[privacy.googleAnalytics]
# ...
[privacy.twitter]
enableDNT = true
# ...
[privacy.youtube]
privacyEnhanced = true
# ...
# Options to make output .md files
# 用于输出 Markdown 格式文档的设置

View file

@ -0,0 +1 @@
{{- template "_internal/shortcodes/x.html" . -}}

View file

@ -0,0 +1 @@
{{- template "_internal/shortcodes/x_simple.html" . -}}

View file

@ -0,0 +1,5 @@
{{- if ge hugo.Version "0.142.0" -}}
{{- partial "internal/x.html" . -}}
{{- else -}}
{{- template "_internal/shortcodes/twitter.html" . -}}
{{- end -}}

View file

@ -0,0 +1,5 @@
{{- if ge hugo.Version "0.142.0" -}}
{{- partial "internal/x_simple.html" . -}}
{{- else -}}
{{- template "_internal/shortcodes/twitter_simple.html" . -}}
{{- end -}}