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

docs(shortcode): update built-in shortcode docs

This commit is contained in:
Dillon 2025-03-12 08:33:20 +08:00
parent 41740664db
commit c00adb66ca
2 changed files with 64 additions and 60 deletions
exampleSite/content/posts/theme-documentation-built-in-shortcodes

View file

@ -83,40 +83,42 @@ The HTML looks like this:
Example `highlight` input:
```markdown
{{</* highlight html */>}}
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{</* highlight go */>}}
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
{{</* /highlight */>}}
```
The rendered output looks like this:
{{< highlight html >}}
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{< highlight go >}}
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
{{< /highlight >}}
## 4 instagram
[Documentation of `instagram`](https://gohugo.io/content-management/shortcodes#instagram)
{{< admonition question "Instagrams API was deprecated since October 24th, 2020" >}}
The instagram-shortcode refers an endpoint of Instagrams API, thats deprecated since October 24th, 2020.
Thus, no images can be fetched from this API endpoint, resulting in an error when the instagram-shortcode is used.
For more information please have a look at GitHub issue [#7879](https://github.com/gohugoio/hugo/issues/7879).
{{< /admonition >}}
Example `highlight` input:
```markdown
{{</* instagram CxOWiQNP2MO */>}}
```
The rendered output looks like this:
{{< instagram CxOWiQNP2MO >}}
## 5 param
@ -132,11 +134,7 @@ The rendered output looks like this:
{{< param description >}}
## 6 ref and relref {#ref-and-relref}
[Documentation of `ref` and `relref`](https://gohugo.io/content-management/shortcodes#ref-and-relref)
## 7 x
## 6 x
[Documentation of `x`](https://gohugo.io/shortcodes/x/)
@ -150,7 +148,7 @@ The rendered output looks like this:
{{< x user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo
## 7 vimeo
[Documentation of `vimeo`](https://gohugo.io/content-management/shortcodes#vimeo)
@ -164,7 +162,7 @@ The rendered output looks like this:
{{< vimeo 146022717 >}}
## 9 youtube
## 8 youtube
[Documentation of `youtube`](https://gohugo.io/content-management/shortcodes#youtube)
@ -177,3 +175,7 @@ Example `youtube` input:
The rendered output looks like this:
{{< youtube w7Ft2ymGmfc >}}
## 9 ref and relref {#ref-and-relref}
[Documentation of `ref` and `relref`](https://gohugo.io/content-management/shortcodes#ref-and-relref)

View file

@ -84,40 +84,42 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
一个 `highlight` 示例:
```markdown
{{</* highlight html */>}}
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{</* highlight go */>}}
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
{{</* /highlight */>}}
```
呈现的输出效果如下:
{{< highlight html >}}
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{< highlight go >}}
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
{{< /highlight >}}
## 4 instagram
[`instagram` 的文档](https://gohugo.io/content-management/shortcodes#instagram)
{{< admonition question "Instagrams API was deprecated since October 24th, 2020" >}}
The instagram-shortcode refers an endpoint of Instagrams API, thats deprecated since October 24th, 2020.
Thus, no images can be fetched from this API endpoint, resulting in an error when the instagram-shortcode is used.
For more information please have a look at GitHub issue [#7879](https://github.com/gohugoio/hugo/issues/7879).
{{< /admonition >}}
一个 `instagram` 示例:
```markdown
{{</* instagram CxOWiQNP2MO */>}}
```
呈现的输出效果如下:
{{< instagram CxOWiQNP2MO >}}
## 5 param
@ -133,11 +135,7 @@ For more information please have a look at GitHub issue [#7879](https://github.c
{{< param description >}}
## 6 ref 和 relref {#ref-and-relref}
[`ref` 和 `relref` 的文档](https://gohugo.io/content-management/shortcodes#ref-and-relref)
## 7 x
## 6 x
[`x` 的文档](https://gohugo.io/shortcodes/x/)
@ -151,7 +149,7 @@ For more information please have a look at GitHub issue [#7879](https://github.c
{{< x user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo
## 7 vimeo
[`vimeo` 的文档](https://gohugo.io/content-management/shortcodes#vimeo)
@ -165,7 +163,7 @@ For more information please have a look at GitHub issue [#7879](https://github.c
{{< vimeo 146022717 >}}
## 9 youtube
## 8 youtube
[`youtube` 的文档](https://gohugo.io/content-management/shortcodes#youtube)
@ -178,3 +176,7 @@ For more information please have a look at GitHub issue [#7879](https://github.c
呈现的输出效果如下:
{{< youtube w7Ft2ymGmfc >}}
## 9 ref 和 relref {#ref-and-relref}
[`ref` 和 `relref` 的文档](https://gohugo.io/content-management/shortcodes#ref-and-relref)