Docs: Add nohighlight shortcode and improve formatting

And some random formatting and copyediting fixes.

See also #1708
This commit is contained in:
Anthony Fok 2015-12-23 09:31:07 -07:00
parent 22bd485072
commit cb8f459127
15 changed files with 300 additions and 260 deletions

View file

@ -29,10 +29,12 @@ We will use tags and categories for our taxonomies, so let's create
#### archetypes/default.md
+++
tags = ["x", "y"]
categories = ["x", "y"]
+++
```toml
+++
tags = ["x", "y"]
categories = ["x", "y"]
+++
```
> __CAVEAT:__ Some editors (e.g. Sublime, Emacs) do not insert an EOL (end-of-line) character at the end of the file (i.e. EOF). If you get a [strange EOF error](/troubleshooting/strange-eof-error/) when using `hugo new`, please open each archetype file (i.e.&nbsp;`archetypes/*.md`) and press <kbd>Enter</kbd> to type a carriage return after the closing `+++` or `---` as necessary.
@ -47,12 +49,14 @@ Hugo would create the file with the following contents:
#### content/post/my-new-post.md
+++
title = "my new post"
date = "2015-01-12T19:20:04-07:00"
tags = ["x", "y"]
categories = ["x", "y"]
+++
```toml
+++
title = "my new post"
date = "2015-01-12T19:20:04-07:00"
tags = ["x", "y"]
categories = ["x", "y"]
+++
```
We see that the `title` and `date` variables have been added, in addition to the `tags` and `categories` variables which were carried over from `archetype/default.md`.
@ -64,11 +68,13 @@ Earlier you created a new content type by adding a new subfolder to the content
#### archetypes/musician.md
+++
name = ""
bio = ""
genre = ""
+++
```toml
+++
name = ""
bio = ""
genre = ""
+++
```
Now let's create a new musician.
@ -78,13 +84,15 @@ This time, Hugo recognizes the custom archetype and uses it instead of the defau
#### content/musician/mozart.md
+++
title = "mozart"
date = "2015-08-24T13:04:37+02:00"
name = ""
bio = ""
genre = ""
+++
```toml
+++
title = "mozart"
date = "2015-08-24T13:04:37+02:00"
name = ""
bio = ""
genre = ""
+++
```
## Using a different front matter format

View file

@ -6,9 +6,9 @@ linktitle: Example
menu:
main:
parent: content
prev: /content/summaries
next: /themes/overview
notoc: true
prev: /content/summaries
title: Example Content File
weight: 70
---
@ -19,8 +19,7 @@ Some things are better shown than explained. The following is a very basic examp
With TOML front matter:
```markdown
+++
<pre><code class="language-toml">+++
date = "2013-06-21T11:27:27-04:00"
title = "Nitro: A quick and simple profiler for Go"
description = "Nitro is a simple profiler for your Golang applications"
@ -29,8 +28,7 @@ topics = [ "Development", "Go" ]
slug = "nitro"
project_url = "https://github.com/spf13/nitro"
+++
# Nitro
</code><code class="language-markdown"># Nitro
Quick and easy performance analyzer library for [Go](http://golang.org/).
@ -48,11 +46,11 @@ of the library.
$ go get github.com/spf13/nitro
Next, include nitro in your application.
```
</code></pre>
You may also use the equivalent YAML front matter:
```markdown
```yaml
---
date: "2013-06-21T11:27:27-04:00"
title: "Nitro: A quick and simple profiler for Go"

View file

@ -28,50 +28,54 @@ Supported formats:
## TOML Example
+++
title = "spf13-vim 3.0 release and new website"
description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
date = "2012-04-06"
categories = [
"Development",
"VIM"
]
slug = "spf13-vim-3-0-release-and-new-website"
+++
Content of the file goes Here
<pre><code class="language-toml">+++
title = "spf13-vim 3.0 release and new website"
description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
date = "2012-04-06"
categories = [
"Development",
"VIM"
]
slug = "spf13-vim-3-0-release-and-new-website"
+++
</code><code class="language-markdown">Content of the file goes Here
</code></pre>
## YAML Example
---
title: "spf13-vim 3.0 release and new website"
description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
tags: [ ".vimrc", "plugins", "spf13-vim", "vim" ]
date: "2012-04-06"
categories:
- "Development"
- "VIM"
slug: "spf13-vim-3-0-release-and-new-website"
---
Content of the file goes Here
```yaml
---
title: "spf13-vim 3.0 release and new website"
description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
tags: [ ".vimrc", "plugins", "spf13-vim", "vim" ]
date: "2012-04-06"
categories:
- "Development"
- "VIM"
slug: "spf13-vim-3-0-release-and-new-website"
---
Content of the file goes Here
```
## JSON Example
{
"title": "spf13-vim 3.0 release and new website",
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.",
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ],
"date": "2012-04-06",
"categories": [
"Development",
"VIM"
],
"slug": "spf13-vim-3-0-release-and-new-website",
}
Content of the file goes Here
```json
{
"title": "spf13-vim 3.0 release and new website",
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.",
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ],
"date": "2012-04-06",
"categories": [
"Development",
"VIM"
],
"slug": "spf13-vim-3-0-release-and-new-website",
}
Content of the file goes Here
```
## Variables

View file

@ -26,13 +26,14 @@ guaranteed.
## Assigning weight to content
+++
weight = 4
title = "Three"
date = "2012-04-06"
+++
Front Matter with Ordered Pages 3
```toml
+++
weight = 4
title = "Three"
date = "2012-04-06"
+++
Front Matter with Ordered Pages 3
```
## Ordering Content Within Taxonomies

View file

@ -17,17 +17,17 @@ uses the top level of your content organization as **the Section**.
The following example site uses two sections, "post" and "quote".
.
└── content
├── post
| ├── firstpost.md // <- http://1.com/post/firstpost/
| ├── happy
| | └── ness.md // <- http://1.com/post/happy/ness/
| └── secondpost.md // <- http://1.com/post/secondpost/
└── quote
├── first.md // <- http://1.com/quote/first/
└── second.md // <- http://1.com/quote/second/
{{< nohighlight >}}.
└── content
├── post
| ├── firstpost.md // <- http://1.com/post/firstpost/
| ├── happy
| | └── ness.md // <- http://1.com/post/happy/ness/
| └── secondpost.md // <- http://1.com/post/secondpost/
└── quote
├── first.md // <- http://1.com/quote/first/
└── second.md // <- http://1.com/quote/second/
{{< /nohighlight >}}
## Section Lists

View file

@ -27,7 +27,7 @@ Given a post on your current Hugo site, with a path of:
### TOML frontmatter
~~~yaml
```toml
+++
...
aliases = [
@ -36,11 +36,11 @@ aliases = [
]
...
+++
~~~
```
### YAML frontmatter
~~~yaml
```yaml
---
...
aliases:
@ -48,15 +48,15 @@ aliases:
- /2010/01/01/even-earlier-url.html
...
---
~~~
```
Now when you visit any of the locations specified in aliases, _assuming the same site domain_, you'll be redirected to the page they are specified on.
## Important Behaviors
1. *Hugo makes no assumptions about aliases. They also don't change based
on your UglyURLs setting. You need to provide absolute path to your webroot and the
complete filename or directory.*
on your UglyURLs setting. You need to provide absolute path to your webroot
and the complete filename or directory.*
2. *Aliases are rendered prior to any content and will be overwritten by
any content with the same location.*
@ -67,7 +67,7 @@ When aliases are specified, Hugo creates a physical folder structure to match th
Assuming a baseurl of `mysite.tld`, the contents of the html file will look something like:
~~~html
```html
<!DOCTYPE html>
<html>
<head>
@ -76,6 +76,6 @@ Assuming a baseurl of `mysite.tld`, the contents of the html file will look some
<meta http-equiv="refresh" content="0;url=http://mysite.tld/posts/my-original-url"/>
</head>
</html>
~~~
```
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case.

View file

@ -14,12 +14,14 @@ Hugo makes it easy to link documents together with the `ref` and `relref` shortc
## Using `ref` and `relref`
{{</* ref "document" */>}}
{{</* ref "#anchor" */>}}
{{</* ref "document#anchor" */>}}
{{</* relref "document" */>}}
{{</* relref "#anchor" */>}}
{{</* relref "document#anchor" */>}}
```django
{{</* ref "document" */>}}
{{</* ref "#anchor" */>}}
{{</* ref "document#anchor" */>}}
{{</* relref "document" */>}}
{{</* relref "#anchor" */>}}
{{</* relref "document#anchor" */>}}
```
The single parameter to `ref` is a string with a content _document name_ (`about.md`), an in-document _anchor_ (`#who`), or both (`about.md#who`).

View file

@ -14,7 +14,7 @@ weight: 30
Make sure either `hugo` is in your `PATH` or provide a path to it.
<pre><code class="hljs nohighlight">$ hugo help
{{< nohighlight >}}$ hugo help
Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go.
@ -65,20 +65,21 @@ Additional help topics:
hugo convert Convert will modify your content to different formats hugo list Listing out various types of content
Use "hugo help [command]" for more information about a command.
</code></pre>
{{< /nohighlight >}}
## Common Usage Example
The most common use is probably to run `hugo` with your current directory being the input directory:
$ hugo
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
{{< nohighlight >}}$ hugo
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
{{< /nohighlight >}}
This generates your web site to the `public/` directory,
ready to be deployed to your web server.
@ -89,34 +90,36 @@ ready to be deployed to your web server.
If you are working on things and want to see the changes immediately, tell Hugo to watch for changes.
Hugo will watch the filesystem for changes, and rebuild your site as soon as a file is saved:
$ hugo -s ~/Code/hugo/docs
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
Watching for changes in /Users/spf13/Code/hugo/docs/content
Press Ctrl+C to stop
{{< nohighlight >}}$ hugo -s ~/Code/hugo/docs
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
Watching for changes in /Users/spf13/Code/hugo/docs/content
Press Ctrl+C to stop
{{< /nohighlight >}}
Hugo can even run a server and create a site preview at the same time!
Hugo implements [LiveReload](/extras/livereload/) technology to automatically
reload any open pages in all JavaScript-enabled browsers, including mobile.
This is the easiest and most common way to develop a Hugo web site:
$ hugo server -ws ~/Code/hugo/docs
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
Watching for changes in /Users/spf13/Code/hugo/docs/content
Serving pages from /Users/spf13/Code/hugo/docs/public
Web Server is available at http://localhost:1313/
Press Ctrl+C to stop
{{< nohighlight >}}$ hugo server -ws ~/Code/hugo/docs
0 draft content
0 future content
99 pages created
0 paginator pages created
16 tags created
0 groups created
in 120 ms
Watching for changes in /Users/spf13/Code/hugo/docs/content
Serving pages from /Users/spf13/Code/hugo/docs/public
Web Server is available at http://localhost:1313/
Press Ctrl+C to stop
{{< /nohighlight >}}
## Deploying your web site
@ -151,11 +154,13 @@ An easy way to work around this is to use different directories for development
To start a server that builds draft content (helpful for editing), you can specify a different destination: the `dev/` dir.
$ hugo server -wDs ~/Code/hugo/docs -d dev
{{< nohighlight >}}$ hugo server -wDs ~/Code/hugo/docs -d dev
{{< /nohighlight >}}
When the content is ready for publishing, use the default `public/` dir:
$ hugo -s ~/Code/hugo/docs
{{< nohighlight >}}$ hugo -s ~/Code/hugo/docs
{{< /nohighlight >}}
This prevents content you're not ready to share yet from accidentally becoming available.
@ -170,9 +175,11 @@ No other web server software (Apache, nginx, IIS...) is necessary.
Here is the command:
$ hugo server --baseURL=http://yoursite.org/ --port=80 \
--appendPort=false \
--bind=87.245.198.50
{{< nohighlight >}}$ hugo server --baseURL=http://yoursite.org/ \
--port=80 \
--appendPort=false \
--bind=87.245.198.50
{{< /nohighlight >}}
Note the `bind` option, which is the interface to which the server will bind (defaults to `127.0.0.1`, which is fine for most development use cases). Some hosts, like Amazon WS, runs network address translation and it can sometimes be hard to figure out the actual IP address. Using `--bind=0.0.0.0` will bind to all interfaces.

View file

@ -16,39 +16,53 @@ Hugo makes a set of values and methods available on the various Taxonomy structu
A Taxonomy is a `map[string]WeightedPages`.
**.Get(term)** Returns the WeightedPages for a term. <br>
**.Count(term)** The number of pieces of content assigned to this term.<br>
**.Alphabetical** Returns an OrderedTaxonomy (slice) ordered by Term. <br>
**.ByCount** Returns an OrderedTaxonomy (slice) ordered by number of entries. <br>
.Get(term)
: Returns the WeightedPages for a term.
.Count(term)
: The number of pieces of content assigned to this term.
.Alphabetical
: Returns an OrderedTaxonomy (slice) ordered by Term.
.ByCount
: Returns an OrderedTaxonomy (slice) ordered by number of entries.
## OrderedTaxonomy
Since Maps are unordered, an OrderedTaxonomy is a special structure that has a defined order.
[]struct {
Name string
WeightedPages WeightedPages
}
```go
[]struct {
Name string
WeightedPages WeightedPages
}
```
Each element of the slice has:
**.Term** The Term used.<br>
**.WeightedPages** A slice of Weighted Pages.<br>
**.Count** The number of pieces of content assigned to this term.<br>
**.Pages** All Pages assigned to this term. All [list methods](/templates/list/) are available to this.<br>
.Term
: The Term used.
.WeightedPages
: A slice of Weighted Pages.
.Count
: The number of pieces of content assigned to this term.
.Pages
: All Pages assigned to this term. All [list methods](/templates/list/) are available to this.
## WeightedPages
WeightedPages is simply a slice of WeightedPage.
type WeightedPages []WeightedPage
**.Count(term)** The number of pieces of content assigned to this term.<br>
**.Pages** Returns a slice of pages, which then can be ordered using any of the [list methods](/templates/list/). <br>
```go
type WeightedPages []WeightedPage
```
.Count(term)
: The number of pieces of content assigned to this term.
.Pages
: Returns a slice of pages, which then can be ordered using any of the [list methods](/templates/list/).

View file

@ -57,15 +57,16 @@ When iterating over content within taxonomies the default sort is first by weigh
Content can be assigned weight for each taxonomy that it's assigned to.
+++
tags = [ "a", "b", "c" ]
tags_weight = 22
categories = ["d"]
title = "foo"
categories_weight = 44
+++
Front Matter with weighted tags and categories
```toml
+++
tags = [ "a", "b", "c" ]
tags_weight = 22
categories = ["d"]
title = "foo"
categories_weight = 44
+++
Front Matter with weighted tags and categories
```
The convention is `taxonomyname_weight`.

View file

@ -30,10 +30,10 @@ or <code><strong>singular key</strong>: &quot;<em>plural value</em>&quot;</code>
</thead>
<tbody>
<tr valign="top">
<td><pre><code>[taxonomies]
tag = "tags"
category = "categories"
series = "series"
<td><pre><code class="language-toml">[taxonomies]
tag = "tags"
category = "categories"
series = "series"
</code></pre></td>
<td><pre><code class="language-yaml">taxonomies:
tag: "tags"
@ -69,31 +69,35 @@ you will need to pass the taxonomy values through the `urlize` template function
### Front Matter Example (in TOML)
+++
title = "Hugo: A fast and flexible static site generator"
tags = [ "Development", "Go", "fast", "Blogging" ]
categories = [ "Development" ]
series = [ "Go Web Dev" ]
slug = "hugo"
project_url = "https://github.com/spf13/hugo"
+++
```toml
+++
title = "Hugo: A fast and flexible static site generator"
tags = [ "Development", "Go", "fast", "Blogging" ]
categories = [ "Development" ]
series = [ "Go Web Dev" ]
slug = "hugo"
project_url = "https://github.com/spf13/hugo"
+++
```
### Front Matter Example (in JSON)
{
"title": "Hugo: A fast and flexible static site generator",
"tags": [
"Development",
"Go",
"fast",
"Blogging"
],
"categories" : [
"Development"
],
"series" : [
"Go Web Dev"
],
"slug": "hugo",
"project_url": "https://github.com/spf13/hugo"
}
```json
{
"title": "Hugo: A fast and flexible static site generator",
"tags": [
"Development",
"Go",
"fast",
"Blogging"
],
"categories" : [
"Development"
],
"series" : [
"Go Web Dev"
],
"slug": "hugo",
"project_url": "https://github.com/spf13/hugo"
}
```

View file

@ -51,8 +51,8 @@ e.g.
// Outputs Tags: tag1, tag2 and tag3
### dict
Creates a dictionary (map[string, interface{}), expects parameters added in value:object fasion.
Invalid combinations like keys that are not strings or uneven number of parameters, will result in an exception thrown
Creates a dictionary `(map[string, interface{})`, expects parameters added in value:object fasion.
Invalid combinations like keys that are not strings or uneven number of parameters, will result in an exception thrown.
Useful for passing maps to partials when adding to a template.
e.g. Pass into "foo.html" a map with the keys "important, content"
@ -369,7 +369,7 @@ e.g., `{{chomp "<p>Blockhead</p>\n"}}` → `"<p>Blockhead</p>"`
Converts the textual representation of the datetime into the other form or returns it of Go `time.Time` type value.
These are formatted with the layout string.
e.g. `{{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }}` →"Wednesday, Jan 21, 2015"
e.g. `{{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }}` "Wednesday, Jan 21, 2015"
### highlight

View file

@ -54,31 +54,29 @@ Run a few commands to verify that the executable is ready to run and then build
2. At the prompt, type `hugo help` and press the Enter key. You should see output that starts with:
<pre><code class="hljs no-highlight">A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://gohugo.io
</code></pre>
{{< nohighlight >}}A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://gohugo.io
{{< /nohighlight >}}
If you do, then the installation is complete. If you don't, double-check the path that you placed the `hugo.exe` file in and that you typed that path correctly when you added it to your PATH variable. If you're still not getting the output, post a note on the Hugo discussion list (in the `Support` topic) with your command and the output.
3. At the prompt, change your directory to the `Sites` directory.
```
C:\Program Files> cd D:\Hugo\Sites
{{< nohighlight >}}C:\Program Files> cd D:\Hugo\Sites
C:\Program Files> D:
D:\Hugo\Sites>
```
{{< /nohighlight >}}
4. Run the command to generate a new site. I'm using `example.com` as the name of the site.
```
D:\Hugo\Sites> hugo new site example.com
```
{{< nohighlight >}}D:\Hugo\Sites> hugo new site example.com
{{< /nohighlight >}}
5. You should now have a directory at `D:\Hugo\Sites\example.com`. Change into that directory and list the contents. You should get output similar to the following:
<pre><code class="hljs no-highlight">D:\Hugo\Sites&gt;cd example.com
{{< nohighlight >}}D:\Hugo\Sites&gt;cd example.com
D:\Hugo\Sites\example.com&gt;dir
&nbsp;Directory of D:\hugo\sites\example.com
&nbsp;
&nbsp;
04/13/2015 10:44 PM &lt;DIR&gt; .
04/13/2015 10:44 PM &lt;DIR&gt; ..
04/13/2015 10:44 PM &lt;DIR&gt; archetypes
@ -89,7 +87,7 @@ D:\Hugo\Sites\example.com&gt;dir
04/13/2015 10:44 PM &lt;DIR&gt; static
1 File(s) 83 bytes
7 Dir(s) 6,273,331,200 bytes free
</code></pre>
{{< /nohighlight >}}
You now have Hugo installed and a site to work with. You need to add a layout (or theme), then create some content. Go to http://gohugo.io/overview/quickstart/ for steps on doing that.

View file

@ -62,59 +62,61 @@ As an example, I was using a custom [`image_tag`](https://github.com/alexandre-n
Jekyll's plugin:
module Jekyll
class ImageTag < Liquid::Tag
@url = nil
@caption = nil
@class = nil
@link = nil
// Patterns
IMAGE_URL_WITH_CLASS_AND_CAPTION =
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
def initialize(tag_name, markup, tokens)
super
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
@class = $1
@url = $3
@caption = $7
@link = $9
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
@class = $1
@url = $3
@caption = $7
elsif markup =~ IMAGE_URL_WITH_CAPTION
@url = $1
@caption = $5
elsif markup =~ IMAGE_URL_WITH_CLASS
@class = $1
@url = $3
elsif markup =~ IMAGE_URL
@url = $1
end
end
def render(context)
if @class
source = "<figure class='#{@class}'>"
else
source = "<figure>"
end
if @link
source += "<a href=\"#{@link}\">"
end
source += "<img src=\"#{@url}\">"
if @link
source += "</a>"
end
source += "<figcaption>#{@caption}</figcaption>" if @caption
source += "</figure>"
source
end
```ruby
module Jekyll
class ImageTag < Liquid::Tag
@url = nil
@caption = nil
@class = nil
@link = nil
// Patterns
IMAGE_URL_WITH_CLASS_AND_CAPTION =
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
def initialize(tag_name, markup, tokens)
super
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
@class = $1
@url = $3
@caption = $7
@link = $9
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
@class = $1
@url = $3
@caption = $7
elsif markup =~ IMAGE_URL_WITH_CAPTION
@url = $1
@caption = $5
elsif markup =~ IMAGE_URL_WITH_CLASS
@class = $1
@url = $3
elsif markup =~ IMAGE_URL
@url = $1
end
end
Liquid::Template.register_tag('image', Jekyll::ImageTag)
def render(context)
if @class
source = "<figure class='#{@class}'>"
else
source = "<figure>"
end
if @link
source += "<a href=\"#{@link}\">"
end
source += "<img src=\"#{@url}\">"
if @link
source += "</a>"
end
source += "<figcaption>#{@caption}</figcaption>" if @caption
source += "</figure>"
source
end
end
end
Liquid::Template.register_tag('image', Jekyll::ImageTag)
```
is written as this Hugo shortcode:

View file

@ -0,0 +1 @@
<pre><code class="hljs nohighlight">{{ .Inner }}</code></pre>