mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-19 15:04:41 -04:00
Make further fixes to shortcodes
This commit is contained in:
parent
e9c7e0549a
commit
bd3b1b5365
@ -190,7 +190,7 @@ Read a more extensive description of `ref` and `relref` in the [cross-references
|
|||||||
|
|
||||||
#### Example `ref` and `relref` Input
|
#### Example `ref` and `relref` Input
|
||||||
|
|
||||||
```markdown
|
```golang
|
||||||
[Neat]({{</* ref "blog/neat.md" */>}})
|
[Neat]({{</* ref "blog/neat.md" */>}})
|
||||||
[Who]({{</* relref "about.md#who" */>}})
|
[Who]({{</* relref "about.md#who" */>}})
|
||||||
```
|
```
|
||||||
@ -199,7 +199,7 @@ Read a more extensive description of `ref` and `relref` in the [cross-references
|
|||||||
|
|
||||||
Assuming that standard Hugo pretty URLs are turned on.
|
Assuming that standard Hugo pretty URLs are turned on.
|
||||||
|
|
||||||
```markdown
|
```html
|
||||||
<a href="/blog/neat">Neat</a>
|
<a href="/blog/neat">Neat</a>
|
||||||
<a href="/about/#who:c28654c202e73453784cfd2c5ab356c0">Who</a>
|
<a href="/about/#who:c28654c202e73453784cfd2c5ab356c0">Who</a>
|
||||||
```
|
```
|
||||||
@ -215,7 +215,7 @@ To embed slides from [Speaker Deck][], click on "< /> Embed" (u
|
|||||||
Extract the value from the field `data-id` and pass it to the shortcode:
|
Extract the value from the field `data-id` and pass it to the shortcode:
|
||||||
|
|
||||||
{{% input "speakerdeck-example-input.md" %}}
|
{{% input "speakerdeck-example-input.md" %}}
|
||||||
```markdown
|
```golang
|
||||||
{{</* speakerdeck 4e8126e72d853c0060001f97 */>}}
|
{{</* speakerdeck 4e8126e72d853c0060001f97 */>}}
|
||||||
```
|
```
|
||||||
{{% /input %}}
|
{{% /input %}}
|
||||||
@ -226,7 +226,7 @@ You want to include a single tweet into your blog post? Everything you need is t
|
|||||||
|
|
||||||
#### Example `tweet` Input
|
#### Example `tweet` Input
|
||||||
|
|
||||||
```markdown
|
```golang
|
||||||
{{</* tweet 666616452582129664 */>}}
|
{{</* tweet 666616452582129664 */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -250,13 +250,13 @@ This shortcode embeds a responsive video player for [YouTube videos][]. Only the
|
|||||||
|
|
||||||
Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
|
Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
|
||||||
|
|
||||||
```markdown
|
```golang
|
||||||
{{</* youtube w7Ft2ymGmfc */>}}
|
{{</* youtube w7Ft2ymGmfc */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Furthermore, you can autostart the embedded video by setting the `autostart` parameter to true. Remember that you can't mix named an unamed parameters. Assign the yet unamed video id to the parameter `id` like below too.
|
Furthermore, you can autostart the embedded video by setting the `autostart` parameter to true. Remember that you can't mix named an unamed parameters. Assign the yet unamed video id to the parameter `id` like below too.
|
||||||
|
|
||||||
```markdown
|
```golang
|
||||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ to the user.
|
|||||||
|
|
||||||
A shortcode with `.Inner` content can be used without the inline content, and without the closing shortcode, by using the self-closing syntax:
|
A shortcode with `.Inner` content can be used without the inline content, and without the closing shortcode, by using the self-closing syntax:
|
||||||
|
|
||||||
```markdown
|
```golang
|
||||||
{{</* innershortcode /*/>}}
|
{{</* innershortcode /*/>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ A shortcodes can be nested. In a nested shortcode you can access the parent shor
|
|||||||
|
|
||||||
### Single Positional Example: `youtube`
|
### Single Positional Example: `youtube`
|
||||||
|
|
||||||
```html
|
```golang
|
||||||
{{</* youtube 09jf3ow9jfw */>}}
|
{{</* youtube 09jf3ow9jfw */>}}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ This would be rendered as:
|
|||||||
### Single Named Example: `image`
|
### Single Named Example: `image`
|
||||||
|
|
||||||
{{% input "content-image.md" %}}
|
{{% input "content-image.md" %}}
|
||||||
```markdown
|
```golang
|
||||||
{{</* img src="/media/spf13.jpg" title="Steve Francia" */>}}
|
{{</* img src="/media/spf13.jpg" title="Steve Francia" */>}}
|
||||||
```
|
```
|
||||||
{{% /input %}}
|
{{% /input %}}
|
||||||
@ -389,7 +389,7 @@ Would be rendered as:
|
|||||||
|
|
||||||
### Single Flexible Example: `vimeo`
|
### Single Flexible Example: `vimeo`
|
||||||
|
|
||||||
```markdown
|
```golang
|
||||||
{{</* vimeo 49718712 */>}}
|
{{</* vimeo 49718712 */>}}
|
||||||
{{</* vimeo id="49718712" class="flex-video" */>}}
|
{{</* vimeo id="49718712" class="flex-video" */>}}
|
||||||
```
|
```
|
||||||
@ -430,14 +430,14 @@ Would be rendered as:
|
|||||||
{{% input "highlight-example.md" %}}
|
{{% input "highlight-example.md" %}}
|
||||||
```markdown
|
```markdown
|
||||||
{{</* highlight html */>}}
|
{{</* highlight html */>}}
|
||||||
<html>
|
<html>
|
||||||
<body> This HTML </body>
|
<body> This HTML </body>
|
||||||
</html>
|
</html>
|
||||||
{{</* /highlight */>}}
|
{{</* /highlight */>}}
|
||||||
```
|
```
|
||||||
{{% /input %}}
|
{{% /input %}}
|
||||||
|
|
||||||
The template for this utilizes the following code (already included in Hugo)
|
The template for this uses the following code, which is already included in Hugo:
|
||||||
|
|
||||||
```golang
|
```golang
|
||||||
{{ .Get 0 | highlight .Inner }}
|
{{ .Get 0 | highlight .Inner }}
|
||||||
|
6
static/js/script.min.js
vendored
6
static/js/script.min.js
vendored
File diff suppressed because one or more lines are too long
@ -289,7 +289,7 @@ hljs.registerLanguage("css", function(e) {
|
|||||||
return { cI: !0, i: /[=\/|'\$]/, c: [e.CBCM, { cN: "selector-id", b: /#[A-Za-z0-9_-]+/ }, { cN: "selector-class", b: /\.[A-Za-z0-9_-]+/ }, { cN: "selector-attr", b: /\[/, e: /\]/, i: "$" }, { cN: "selector-pseudo", b: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/ }, { b: "@(font-face|page)", l: "[a-z-]+", k: "font-face page" }, { b: "@", e: "[{;]", i: /:/, c: [{ cN: "keyword", b: /\w+/ }, { b: /\s/, eW: !0, eE: !0, r: 0, c: [e.ASM, e.QSM, e.CSSNM] }] }, { cN: "selector-tag", b: c, r: 0 }, { b: "{", e: "}", i: /\S/, c: [e.CBCM, t] }] }
|
return { cI: !0, i: /[=\/|'\$]/, c: [e.CBCM, { cN: "selector-id", b: /#[A-Za-z0-9_-]+/ }, { cN: "selector-class", b: /\.[A-Za-z0-9_-]+/ }, { cN: "selector-attr", b: /\[/, e: /\]/, i: "$" }, { cN: "selector-pseudo", b: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/ }, { b: "@(font-face|page)", l: "[a-z-]+", k: "font-face page" }, { b: "@", e: "[{;]", i: /:/, c: [{ cN: "keyword", b: /\w+/ }, { b: /\s/, eW: !0, eE: !0, r: 0, c: [e.ASM, e.QSM, e.CSSNM] }] }, { cN: "selector-tag", b: c, r: 0 }, { b: "{", e: "}", i: /\S/, c: [e.CBCM, t] }] }
|
||||||
});
|
});
|
||||||
hljs.registerLanguage("go", function(e) {
|
hljs.registerLanguage("go", function(e) {
|
||||||
var t = { keyword: "break default func interface select case map struct chan else goto package switch const fallthrough if range end type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune", literal: "Get true false iota nil Pages", built_in: "append cap close complex copy imag len make new panic print println real recover delete Site Data" };
|
var t = { keyword: "break default func interface select case map struct chan else goto package switch const fallthrough if range end type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune id autoplay Get", literal: "true false iota nil Pages with", built_in: "append cap close complex copy imag len make new panic print println real recover delete Site Data tweet speakerdeck youtube ref relref vimeo instagram gist figure innershortcode" };
|
||||||
return { aliases: ["golang"], k: t, i: "</", c: [e.CLCM, e.CBCM, { cN: "string", v: [e.QSM, { b: "'", e: "[^\\\\]'" }, { b: "`", e: "`" }] }, { cN: "number", v: [{ b: e.CNR + "[dflsi]", r: 1 }, e.CNM] }, { b: /:=/ }, { cN: "function", bK: "func", e: /\s*\{/, eE: !0, c: [e.TM, { cN: "params", b: /\(/, e: /\)/, k: t, i: /["']/ }] }] }
|
return { aliases: ["golang"], k: t, i: "</", c: [e.CLCM, e.CBCM, { cN: "string", v: [e.QSM, { b: "'", e: "[^\\\\]'" }, { b: "`", e: "`" }] }, { cN: "number", v: [{ b: e.CNR + "[dflsi]", r: 1 }, e.CNM] }, { b: /:=/ }, { cN: "function", bK: "func", e: /\s*\{/, eE: !0, c: [e.TM, { cN: "params", b: /\(/, e: /\)/, k: t, i: /["']/ }] }] }
|
||||||
});
|
});
|
||||||
hljs.registerLanguage("asciidoc", function(e) {
|
hljs.registerLanguage("asciidoc", function(e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user