{{ end }}\n \n {{ end }}\n \n \n\n### Usage\nI simply changed:\n\n {% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg \"One of my favorite touristy-type photos. I secretly waited for the good light while we were \"having fun\" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing.\" ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}\n\nto this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):\n\n {{%/* fig class=\"full\" src=\"http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg\" title=\"One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing.\" link=\"http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/\" */%}}\n\nAs a bonus, the shortcode named parameters are, arguably, more readable.\n\n## Finishing touches\n### Fix content\nDepending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.\n\n### Clean up\nYou'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.\n\n## A practical example in a diff\n[Hey, it's Ale",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/migrate-from-jekyll.md",
"start": 7,
"end": 151,
"startLoc": {
"line": 7,
"column": 1,
"position": 28
},
"endLoc": {
"line": 151,
"column": 2,
"position": 1032
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/migrate-from-jekyll.md",
"start": 11,
"end": 155,
"startLoc": {
"line": 11,
"column": 1,
"position": 38
},
"endLoc": {
"line": 155,
"column": 2,
"position": 1042
}
}
},
{
"format": "markdown",
"lines": 20,
"fragment": "hugo repository](http://github.com/spf13/hugo)\n 2. Go into the repo\n 3. Run hugo in server mode and build the docs\n 4. Open your browser to http://localhost:1313\n\nCorresponding pseudo commands:\n\n git clone https://github.com/spf13/hugo\n cd hugo\n /path/to/where/you/installed/hugo server --source=./docs\n > 29 pages created\n > 0 tags index created\n > in 27 ms\n > Web Server is available at http://localhost:1313\n > Press ctrl+c to stop\n\nOnce you've gotten here, follow along the rest of this page on your local bu",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/hugoisforlovers.md",
"start": 35,
"end": 54,
"startLoc": {
"line": 35,
"column": 2,
"position": 194
},
"endLoc": {
"line": 54,
"column": 8,
"position": 308
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/hugoisforlovers.md",
"start": 31,
"end": 50,
"startLoc": {
"line": 31,
"column": 1,
"position": 183
},
"endLoc": {
"line": 50,
"column": 8,
"position": 295
}
}
},
{
"format": "markdown",
"lines": 29,
"fragment": "d.\n\n## Step 3. Change the docs site\n\nStop the Hugo process by hitting ctrl+c.\n\nNow we are going to run hugo again, but this time with hugo in watch mode.\n\n /path/to/hugo/from/step/1/hugo server --source=./docs --watch\n > 29 pages created\n > 0 tags index created\n > in 27 ms\n > Web Server is available at http://localhost:1313\n > Watching for changes in /Users/spf13/Code/hugo/docs/content\n > Press ctrl+c to stop\n\n\nOpen your [favorite editor](http://vim.spf13.com) and change one of the source\ncontent pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.\n\nContent files are found in `docs/content/`. Unless otherwise specified, files\nare located at the same relative location as the url, in our case\n`docs/content/overview/quickstart.md`.\n\nChange and save this file.. Notice what happened in your terminal.\n\n > Change detected, rebuilding site\n\n > 29 pages created\n > 0 tags index created\n > in 26 ms\n\nRefresh the browser and observe that the typo is now fixed.\n\nNot",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/hugoisforlovers.md",
"start": 56,
"end": 84,
"startLoc": {
"line": 56,
"column": 1,
"position": 311
},
"endLoc": {
"line": 84,
"column": 11,
"position": 554
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/hugoisforlovers.md",
"start": 52,
"end": 80,
"startLoc": {
"line": 52,
"column": 1,
"position": 298
},
"endLoc": {
"line": 80,
"column": 10,
"position": 541
}
}
},
{
"format": "markdown",
"lines": 6,
"fragment": "[html/template][gohtmltemplate] library for\nits template engine. It is an extremely lightweight engine that provides a very\nsmall amount of logic. In our experience that it is just the right amount of\nlogic to be able to create a good static website. If you have used other\ntemplate systems from different languages or frameworks you will find a lot of\nsimilarities in go",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/goisforlovers.md",
"start": 19,
"end": 24,
"startLoc": {
"line": 19,
"column": 2,
"position": 73
},
"endLoc": {
"line": 24,
"column": 3,
"position": 197
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/goisforlovers.md",
"start": 16,
"end": 21,
"startLoc": {
"line": 16,
"column": 2,
"position": 69
},
"endLoc": {
"line": 21,
"column": 3,
"position": 193
}
}
},
{
"format": "markdown",
"lines": 18,
"fragment": "s \"caption\") }} Caption {{ end }}\n\n\n## Variables\n\nEach go template has a struct (object) made available to it. In hugo each\ntemplate is passed either a page or a node struct depending on which type of\npage you are rendering. More details are available on the\n[variables](/layout/variables) page.\n\nA variable is accessed by referencing the variable name.\n\n {{ .Title }}\n\nVariables can also be defined and referenced.\n\n {{ $address := \"123 Main St.\"}}\n {{ $address }}\n\n\n## Functions\n\nGo templa",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/goisforlovers.md",
"start": 69,
"end": 86,
"startLoc": {
"line": 69,
"column": 2,
"position": 497
},
"endLoc": {
"line": 86,
"column": 3,
"position": 645
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/goisforlovers.md",
"start": 68,
"end": 85,
"startLoc": {
"line": 68,
"column": 2,
"position": 494
},
"endLoc": {
"line": 85,
"column": 3,
"position": 642
}
}
},
{
"format": "markdown",
"lines": 30,
"fragment": "e ship with a few functions which provide basic functionality. The go\ntemplate system also provides a mechanism for applications to extend the\navailable functions with their own. [Hugo template\nfunctions](/layout/functions) provide some additional functionality we believe\nare useful for building websites. Functions are called by using their name\nfollowed by the required parameters separated by spaces. Template\nfunctions cannot be added without recompiling hugo.\n\n**Example:**\n\n {{ add 1 2 }}\n\n## Includes\n\nWhen including another template you will pass to it the data it will be\nable to access. To pass along the current context please remember to\ninclude a trailing dot. The templates location will always be starting at\nthe /layout/ directory within Hugo.\n\n**Example:**\n\n {{ template \"chrome/header.html\" . }}\n\n\n## Logic\n",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/goisforlovers.md",
"start": 87,
"end": 116,
"startLoc": {
"line": 87,
"column": 1,
"position": 647
},
"endLoc": {
"line": 116,
"column": 4,
"position": 887
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/goisforlovers.md",
"start": 86,
"end": 115,
"startLoc": {
"line": 86,
"column": 1,
"position": 644
},
"endLoc": {
"line": 115,
"column": 4,
"position": 884
}
}
},
{
"format": "markdown",
"lines": 72,
"fragment": "lates provide the most basic iteration and conditional logic.\n\n### Iteration\n\nJust like in go, the go templates make heavy use of range to iterate over\na map, array or slice. The following are different examples of how to use\nrange.\n\n**Example 1: Using Context**\n\n {{ range array }}\n {{ . }}\n {{ end }}\n\n**Example 2: Declaring value variable name**\n\n {{range $element := array}}\n {{ $element }}\n {{ end }}\n\n**Example 2: Declaring key and value variable name**\n\n {{range $index, $element := array}}\n {{ $index }}\n {{ $element }}\n {{ end }}\n\n### Conditionals\n\nIf, else, with, or, & and provide the framework for handling conditional\nlogic in Go Templates. Like range, each statement is closed with `end`.\n\n\nGo Templates treat the following values as false:\n\n* false\n* 0\n* any array, slice, map, or string of length zero\n\n**Example 1: If**\n\n {{ if isset .Params \"title\" }}
{{ index .Params \"title\" }}
{{ end }}\n\n**Example 2: If -> Else**\n\n {{ if isset .Params \"alt\" }}\n {{ index .Params \"alt\" }}\n {{else}}\n {{ index .Params \"caption\" }}\n {{ end }}\n\n**Example 3: And & Or**\n\n {{ if and (or (isset .Params \"title\") (isset .Params \"caption\")) (isset .Params \"attr\")}}\n\n**Example 4: With**\n\nAn alternative way of writing \"if\" and then referencing the same value\nis to use \"with\" instead. With rebinds the context `.` within its scope,\nand skips the block if the variable is absent.\n\nThe first example above could be simplified as:\n\n {{ with .Params.title }}
{{ . }}
{{ end }}\n\n**Example 5: If -> Else If**\n\n {{ if isset .Params \"alt\" }}\n {{ index .Params \"alt\" }}\n {{ else if isset",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/goisforlovers.md",
"start": 116,
"end": 187,
"startLoc": {
"line": 116,
"column": 2,
"position": 893
},
"endLoc": {
"line": 187,
"column": 3,
"position": 1237
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/goisforlovers.md",
"start": 115,
"end": 186,
"startLoc": {
"line": 115,
"column": 2,
"position": 890
},
"endLoc": {
"line": 186,
"column": 3,
"position": 1234
}
}
},
{
"format": "markdown",
"lines": 40,
"fragment": "e concept is simple, each pipeline's output becomes the\ninput of the following pipe.\n\nBecause of the very simple syntax of go templates, the pipe is essential\nto being able to chain together function calls. One limitation of the\npipes is that they only can work with a single value and that value\nbecomes the last parameter of the next pipeline.\n\nA few simple examples should help convey how to use the pipe.\n\n**Example 1 :**\n\n {{ if eq 1 1 }} Same {{ end }}\n\nis the same as\n\n {{ eq 1 1 | if }} Same {{ end }}\n\nIt does look odd to place the if at the end, but it does provide a good\nillustration of how to use the pipes.\n\n**Example 2 :**\n\n {{ index .Params \"disqus_url\" | html }}\n\nAccess the page parameter called \"disqus_url\" and escape the HTML.\n\n**Example 3 :**\n\n {{ if or (or (isset .Params \"title\") (isset .Params \"caption\")) (isset .Params \"attr\")}}\n Stuff Here\n {{ end }}\n\nCould be rewritten as\n\n {{ isset .Params \"caption\" | or isset .Params \"title",
"tokens": 0,
"firstFile": {
"name": "apps/rum/src/themes/hugo-kiera/exampleSite/content/posts/goisforlovers.md",
"start": 192,
"end": 231,
"startLoc": {
"line": 192,
"column": 2,
"position": 1324
},
"endLoc": {
"line": 231,
"column": 3,
"position": 1573
}
},
"secondFile": {
"name": "apps/rum/src/themes/mainroad/exampleSite/content/post/goisforlovers.md",
"start": 191,
"end": 230,
"startLoc": {
"line": 191,
"column": 2,
"position": 1321
},
"endLoc": {
"line": 230,
"column": 3,
"position": 1570
}
}
},
{
"format": "markdown",
"lines": 95,
"fragment": " | or isset .Params \"attr\" | if }}\n Stuff Here\n {{ end }}\n\n\n## Context (aka. the dot)\n\nThe most easily overlooked concept to understand about go templates is that {{ . }}\nalways refers to the current context. In the top level of your template this\nwill be the data set made available to it. Inside of a iteration it will have\nthe value of the current item. When inside of a loop the context has changed. .\nwill no longer refer to the data available to the entire page. If you need to\naccess this from within the loop you will likely want to set it to a variable\ninstead of depending on the context.\n\n**Example:**\n\n {{ $title := .Site.Title }}\n {{ range .Params.tags }}\n
\n {{ end }}\n\nNotice how once we have entered the loop the value of {{ . }} has changed. We\nhave defined a variable outside of the loop so we have access to it from within\nthe loop.\n\n# Hugo Parameters\n\nHugo provides the option of passing values to the template language\nthrough the site configuration (for sitewide values), or through the meta\ndata of each specific piece of content. You can define any values of any\ntype (supported by your front matter/config format) and use them however\nyou want to inside of your templates.\n\n\n## Using Content (page) Parameters\n\nIn each piece of content you can provide variables to be used by the\ntemplates. This happens in the [front matter](/content/front-matter).\n\nAn example of this is used in this documentation site. Most of the pages\nbenefit from having the table of contents provided. Sometimes the TOC just\ndoesn't make a lot of sense. We've defined a variable in our front matter\nof some pages to turn off the TOC from being displayed.\n\nHere is the example front matter:\n\n```\n---\ntitle: \"Permalinks\"\ndate: \"2013-11-18\"\naliases:\n - \"/doc/permalinks/\"\ngroups: [\"extras\"]\ngroups_weight: 30\nnotoc: true\n---\n```\n\nHere is the corresponding code inside of the template:\n\n {{ if not .Params.notoc }}\n