Permalink
Browse files

Updated shortcodes

  • Loading branch information...
eternoendless committed Jul 26, 2018
1 parent b2d187e commit a80485ae113a67c75c742829ba661b30dc4d8526
@@ -42,12 +42,14 @@ Some default shortcodes are provided by Hugo (read [shortcodes documentation](ht
Here are the most useful shortcodes, both native and custom:
- [funcdef][3] – Displays a styled function definition list.
- [minver][4] – Displays a version pill.
- [notice][2] – Displays a "note", "tip" or "warning" box to highlight important information.
- [ref][1] – Links to another DevDocs page or a section of the page.
[1]: {{< ref "1.7/documentation/shortcodes/ref.md" >}}
[2]: {{< ref "1.7/documentation/shortcodes/notice.md" >}}
[3]: {{< ref "1.7/documentation/shortcodes/funcdef.md" >}}
[4]: {{< ref "1.7/documentation/shortcodes/minver.md" >}}
- [callout][callout] – Displays a styled function definition list.
- [funcdef][funcdef] – Displays a styled function definition list.
- [minver][minver] – Displays a version pill.
- [notice][notice] – Displays a "note", "tip" or "warning" box to highlight important information.
- [ref][ref] – Links to another DevDocs page or a section of the page.
[ref]: {{< ref "1.7/documentation/shortcodes/ref.md" >}}
[notice]: {{< ref "1.7/documentation/shortcodes/notice.md" >}}
[funcdef]: {{< ref "1.7/documentation/shortcodes/funcdef.md" >}}
[minver]: {{< ref "1.7/documentation/shortcodes/minver.md" >}}
[callout]: {{< ref "1.7/documentation/shortcodes/callout.md" >}}
@@ -0,0 +1,29 @@
---
title: Callout
---
# Callout
This shortcode allows you to display a block inside your document to make some information stand out.
{{% notice note %}}
As with all shortcodes, keep in mind that headers inside won't appear in the article's table of contents.
{{% /notice %}}
```markdown
{{%/* callout */%}}
#### This is a callout
This is a very important block of text. Also, notice how the title doesn't appear in the table of contents.
{{%/* /callout */%}}
```
Rendered result:
{{% callout %}}
#### This is a callout
This is a very important block of text. Also, notice how the title doesn't appear in the table of contents.
{{% /callout %}}
@@ -6,7 +6,7 @@ title: Function definition
To render a list of function definitions, use `funcdef` in combination with Markdown definition list:
```go
```markdown
{{%/* funcdef */%}}
__construct($id = NULL, $id_lang = NULL)
@@ -22,6 +22,7 @@ add($autodate = true, $nullValues = false)
Rendered result:
{{% callout %}}
{{% funcdef %}}
__construct($id = NULL, $id_lang = NULL)
@@ -33,6 +34,7 @@ add($autodate = true, $nullValues = false)
Save current object to database (add or update).
{{% /funcdef %}}
{{% /callout %}}
{{% notice info %}}
Be aware that you need to leave at lease one trailing space after each `:` for the markup to be correctly interpreted as a definition list.
@@ -6,22 +6,26 @@ title: Version pill
When highlighting a new feature, you may want to highlight the version on which that feature was added. You can add a version pill using `minver`:
```go
```markdown
Everything's better on {{</* minver v="1.7.4" */>}}
```
Which renders to:
{{% callout %}}
Everything's better on {{< minver v="1.7.4" >}}
{{% /callout %}}
To align a pill with a title, use the parameter `title="true"`:
```go
##### Example title
```markdown
#### Example title
{{</* minver v="1.7.4" title="true"*/>}}
```
Which is rendered like this:
##### Example title
{{% callout %}}
#### Example title
{{< minver v="1.7.4" title="true" >}}
{{% /callout %}}
@@ -11,9 +11,12 @@ To link to another page in the documentation, use `ref`:
[This is a link to Configuration]({{</* ref "1.7/basics/configuration.md" */>}})
Rendered code:
Rendered result:
{{% callout %}}
[This is a link to Configuration]({{< ref "1.7/basics/installation/configuration.md" >}})
{{% /callout %}}
{{% notice tip %}}
Don't forget to put the link between double quotes.
@@ -25,9 +28,11 @@ To a link that points to a specific point in the current page, use `relref`:
[This is a link to the first title]({{</* relref "#cross-links" */>}})
Rendered code:
Rendered result:
{{% callout %}}
[This is a link to the first title]({{< relref "#cross-links" >}})
{{% /callout %}}
{{% notice info %}}
**Internal links need to be "slugified" to work.**<br>

0 comments on commit a80485a

Please sign in to comment.