├── exampleSite ├── static │ └── .gitkeep ├── .gitignore ├── content │ ├── about.md │ └── post │ │ ├── hugoisforlovers.md │ │ ├── migrate-from-jekyll.md │ │ ├── goisforlovers.md │ │ └── creating-a-new-theme.md └── config.toml ├── archetypes └── default.md ├── images ├── tn.png └── screenshot.png ├── static ├── favicon.ico ├── fonts │ ├── icons.eot │ ├── icons.ttf │ ├── icons.woff │ └── icons.svg ├── img │ ├── avatar.jpg │ ├── favicon.ico │ └── appletouchicon.png ├── js │ ├── index.js │ └── smooth-scroll.min.js └── css │ ├── github.css │ └── screen.css ├── layouts ├── 404.html ├── _default │ ├── list.html │ ├── baseof.html │ ├── terms.html │ ├── summary.html │ └── single.html ├── partials │ ├── navigation.html │ ├── header.html │ ├── footer.html │ ├── author.html │ ├── themes │ │ ├── red-theme.html │ │ ├── blue-theme.html │ │ ├── custom-theme.html │ │ ├── green-theme.html │ │ └── orange-theme.html │ ├── pagination.html │ ├── js.html │ ├── share.html │ ├── social.html │ └── head.html └── index.html ├── theme.toml ├── LICENSE.md ├── CHANGELOG.md └── README.md /exampleSite/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /exampleSite/.gitignore: -------------------------------------------------------------------------------- 1 | public/ 2 | themes -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | 3 | +++ 4 | 5 | -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/images/tn.png -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /static/fonts/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/fonts/icons.eot -------------------------------------------------------------------------------- /static/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/fonts/icons.ttf -------------------------------------------------------------------------------- /static/img/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/img/avatar.jpg -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/img/favicon.ico -------------------------------------------------------------------------------- /static/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/fonts/icons.woff -------------------------------------------------------------------------------- /static/img/appletouchicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/HEAD/static/img/appletouchicon.png -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |
4 |

{{ .Site.Params.pageNotFoundTitle }}

5 |
6 |
7 | {{ end }} -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ $paginator := .Paginate .Data.Pages }} 3 | {{ range $paginator.Pages }} 4 | {{ .Render "summary" }} 5 | {{ end }} 6 | {{ partial "pagination" . }} 7 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/navigation.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Menus.main }} 2 | 9 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ $paginator := .Paginate .Data.Pages.ByDate.Reverse }} 3 | {{ range $paginator.Pages }} 4 | {{ if not .Params.hide }} 5 | {{ .Render "summary" }} 6 | {{ end }} 7 | {{ end }} 8 | 9 | {{ partial "pagination" . }} 10 | {{ end }} -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | {{ partial "head" . }} 2 | 3 | {{ partial "header" . }} 4 | {{ partial "navigation" . }} 5 | 6 |
7 | {{ block "main" . }}{{ end }} 8 |
9 | 10 | {{ partial "footer" . }} 11 | {{ partial "js" . }} 12 | 13 | -------------------------------------------------------------------------------- /layouts/partials/author.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{ .Site.Params.name }}

4 |

{{ .Site.Params.bio | markdownify }}

5 |

6 | {{ with .Site.Params.location }} {{ . }}{{ end }} 7 |

8 |
-------------------------------------------------------------------------------- /layouts/_default/terms.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 | 10 |
11 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/themes/red-theme.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/js/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Main JS file for Casper behaviours 3 | */ 4 | 5 | /*globals jQuery, document */ 6 | (function ($) { 7 | "use strict"; 8 | 9 | $(document).ready(function(){ 10 | 11 | // On the home page, move the blog icon inside the header 12 | // for better relative/absolute positioning. 13 | 14 | //$("#blog-logo").prependTo("#site-head-content"); 15 | 16 | }); 17 | 18 | }(jQuery)); -------------------------------------------------------------------------------- /layouts/partials/themes/blue-theme.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/themes/custom-theme.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/themes/green-theme.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/themes/orange-theme.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /exampleSite/content/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-08-22" 3 | title = "Link custom pages" 4 | menu = "main" 5 | url = "about/" 6 | hide = "true" 7 | +++ 8 | 9 | You can add custom pages like this by adding `menu = "main"` in the frontmatter: 10 | 11 | ```toml 12 | +++ 13 | date = "2015-08-22" 14 | title = "About me" 15 | menu = "main" 16 | url = "about/" 17 | +++ 18 | ``` 19 | 20 | This site is just a usual document. Create a new file, e.g. `about.md` in the `content` content directory. The `url` variable in the frontmatter allows you to define the final url of the about page. -------------------------------------------------------------------------------- /layouts/partials/pagination.html: -------------------------------------------------------------------------------- 1 | {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} 2 | 13 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ range .Site.Params.customJS }} 6 | 7 | {{ end }} 8 | 9 | 17 | 18 | 19 | {{ template "_internal/google_analytics.html" . }} -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "Steam" 2 | license = "MIT" 3 | licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE.md" 4 | description = "A minimal theme for bloggers." 5 | homepage = "//github.com/digitalcraftsman/hugo-steam-theme" 6 | tags = ["google analytics", "disqus", "blog", "minimal"] 7 | features = [] 8 | min_version = 0.20 9 | 10 | [author] 11 | name = "Digitalcraftsman" 12 | homepage = "//github.com/digitalcraftsman/" 13 | 14 | # Author who used the Vapor theme as foundation for Steam 15 | [[original]] 16 | name = "Tommaso Barbato" 17 | homepage = "//torb.at/" 18 | repo = "//github.com/epistrephein/Steam" 19 | 20 | # Original creator of the Vapor theme 21 | [[original]] 22 | name = "Seth Lilly" 23 | homepage = "//www.sethlilly.com/" 24 | repo = "//github.com/sethlilly/Vapor" 25 | -------------------------------------------------------------------------------- /layouts/_default/summary.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{ .Title }}

4 | 5 |
6 |
7 | {{ if and (not .Description) (.Site.Params.useSummaryIfNoDescription)}} 8 |

{{ .Summary }}…

9 | {{ else }} 10 |

{{ .Description | markdownify }}…

11 | {{ end }} 12 |

{{ .Site.Params.keepReadingStr }}

13 |
14 |
-------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |
4 |

{{ .Title }}

5 | 10 |
11 | 12 |
13 | {{ .Content }} 14 |
15 | 16 | {{ if .Type | eq "post" }} 17 |
18 | 25 |
26 | 27 | {{ template "_internal/disqus.html" . }} 28 | {{ partial "share" . }} 29 | 30 | 33 | {{ end }} 34 |
35 | {{ end }} -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Digitalcraftsman - Released under The MIT License. 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 8th April 2017 4 | 5 | `.Now` will be deprecated with Hugo v0.20. Hence the required minimum version of Hugo is v0.20. 6 | 7 | ## 27th November 2016 8 | 9 | - `favicon` allows you to link a custom favicon by adding a path relative to the `static` folder 10 | - with `customCSS` and `customJS` you can link your own stylesheets and scripts. The files have to be link relative to `static` as well. 11 | 12 | ## 26th November 2016 13 | 14 | Some of the new features of Hugo v0.17 were now introduced in this theme. Since some changes are not backwards compatible you have to update to Hugo v0.17 or newer versions. 15 | 16 | - Steam now uses the Google Analytics template that is shipped with Hugo. Just move the `googleAnaltics` variable outside the `params` block. Have a look at the [example config file](https://github.com/digitalcraftsman/hugo-steam-theme/blob/master/exampleSite/config.toml). 17 | - The support for Google Plus comments in now deprecated. 18 | - Formerly, it was only possible to show pages of `type` post on the homepage. Now, all types of pages are shown. You can hide single pages by adding `hide = true` to the (TOML) frontmatter. 19 | - External dependencies like Highlight.js have been updated to the latest version. 20 | -------------------------------------------------------------------------------- /layouts/partials/share.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ .Site.Params.backtotopStr }}

3 |

{{ .Site.Params.shareStr }}

4 | 6 | 7 | 8 | 10 | 11 | 12 | 14 | 15 | 16 |
-------------------------------------------------------------------------------- /exampleSite/config.toml: -------------------------------------------------------------------------------- 1 | baseurl = "https://example.org/" 2 | languageCode = "en-us" 3 | title = "Steam - a minimal theme for Hugo" 4 | theme = "hugo-steam-theme" 5 | disqusShortname = "spf13" 6 | # Enable Google Analytics be inserting your tracking code 7 | googleAnalytics = "" 8 | # Number of posts per page 9 | paginate = 10 10 | 11 | [params] 12 | title = "Steam" 13 | subtitle = "a minimal theme for ~~Ghost~~ Hugo" 14 | copyright = "Released under the MIT license." 15 | 16 | # You can choose between green, orange, red and blue. 17 | themecolor = "green" 18 | 19 | # Link custom assets relative to /static 20 | favicon = "favicon.ico" 21 | customCSS = [] 22 | customJS = [] 23 | 24 | # To provide some metadata for search engines and the about section in the footer 25 | # feel free to add a few information about you and your website. 26 | name = "John Doe" 27 | bio = "programmer - blogger - coffee aficionado" 28 | description = "Your description of the blog" 29 | 30 | # Link your social networks (optional) 31 | location = "" 32 | twitter = "spf13" 33 | linkedin = "" 34 | googleplus = "" 35 | facebook = "" 36 | instagram = "" 37 | github = "spf13" 38 | gitlab = "" 39 | bitbucket = "" 40 | 41 | # Customize or translate the strings 42 | keepReadingStr = "Keep reading" 43 | backtotopStr = "Back to top" 44 | shareStr = "Share" 45 | pageNotFoundTitle = "404 - Page not found" 46 | -------------------------------------------------------------------------------- /layouts/partials/social.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ .Title }}{{ if not .IsHome }} · {{ .Site.Title }}{{ end }} 8 | {{ with .Site.Params.name }}{{ end }} 9 | {{ with .Site.Params.description }}{{ end }} 10 | {{ .Hugo.Generator }} 11 | 12 | 13 | 14 | 15 | {{ "" | safeHTML }} 16 | {{ if .RSSLink }} 17 | 19 | 21 | {{ end }} 22 | 23 | 24 | 25 | 26 | {{ "" | safeHTML }} 27 | 28 | 29 | 30 | {{ range .Site.Params.customCSS }} 31 | 32 | {{ end }} 33 | 34 | {{ with .Site.Params.favicon }} 35 | 36 | 37 | {{ end }} 38 | 39 | {{ "" | safeHTML }} 40 | {{ partial (printf "themes/%s-theme" .Site.Params.themecolor) . }} 41 | 42 | -------------------------------------------------------------------------------- /static/css/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #596364; 12 | background: #f7f7f7; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-comment, 17 | .hljs-template_comment, 18 | .diff .hljs-header, 19 | .hljs-javadoc { 20 | color: #998; 21 | font-style: italic; 22 | } 23 | 24 | .hljs-keyword, 25 | .css .rule .hljs-keyword, 26 | .hljs-winutils, 27 | .javascript .hljs-title, 28 | .nginx .hljs-title, 29 | .hljs-subst, 30 | .hljs-request, 31 | .hljs-status { 32 | color: #596364; 33 | font-weight: bold; 34 | } 35 | 36 | .hljs-number, 37 | .hljs-hexcolor, 38 | .ruby .hljs-constant { 39 | color: #008080; 40 | } 41 | 42 | .hljs-string, 43 | .hljs-tag .hljs-value, 44 | .hljs-phpdoc, 45 | .hljs-dartdoc, 46 | .tex .hljs-formula { 47 | color: #d14; 48 | } 49 | 50 | .hljs-title, 51 | .hljs-id, 52 | .scss .hljs-preprocessor { 53 | color: #900; 54 | font-weight: bold; 55 | } 56 | 57 | .javascript .hljs-title, 58 | .hljs-list .hljs-keyword, 59 | .hljs-subst { 60 | font-weight: normal; 61 | } 62 | 63 | .hljs-class .hljs-title, 64 | .hljs-type, 65 | .vhdl .hljs-literal, 66 | .tex .hljs-command { 67 | color: #458; 68 | font-weight: bold; 69 | } 70 | 71 | .hljs-tag, 72 | .hljs-tag .hljs-title, 73 | .hljs-rules .hljs-property, 74 | .django .hljs-tag .hljs-keyword { 75 | color: #000080; 76 | font-weight: normal; 77 | } 78 | 79 | .hljs-attribute, 80 | .hljs-variable, 81 | .lisp .hljs-body { 82 | color: #008080; 83 | } 84 | 85 | .hljs-regexp { 86 | color: #009926; 87 | } 88 | 89 | .hljs-symbol, 90 | .ruby .hljs-symbol .hljs-string, 91 | .lisp .hljs-keyword, 92 | .clojure .hljs-keyword, 93 | .scheme .hljs-keyword, 94 | .tex .hljs-special, 95 | .hljs-prompt { 96 | color: #990073; 97 | } 98 | 99 | .hljs-built_in { 100 | color: #0086b3; 101 | } 102 | 103 | .hljs-preprocessor, 104 | .hljs-pragma, 105 | .hljs-pi, 106 | .hljs-doctype, 107 | .hljs-shebang, 108 | .hljs-cdata { 109 | color: #999; 110 | font-weight: bold; 111 | } 112 | 113 | .hljs-deletion { 114 | background: #fdd; 115 | } 116 | 117 | .hljs-addition { 118 | background: #dfd; 119 | } 120 | 121 | .diff .hljs-change { 122 | background: #0086b3; 123 | } 124 | 125 | .hljs-chunk { 126 | color: #aaa; 127 | } 128 | -------------------------------------------------------------------------------- /exampleSite/content/post/hugoisforlovers.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Getting Started with Hugo" 3 | tags = [ 4 | "go", 5 | "golang", 6 | "hugo", 7 | "development", 8 | ] 9 | date = "2014-04-02" 10 | categories = [ 11 | "Development", 12 | "golang", 13 | ] 14 | description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Earum similique, ipsum officia amet blanditiis provident ratione nihil ipsam dolorem repellat." 15 | +++ 16 | 17 | ## Step 1. Install Hugo 18 | 19 | Goto [hugo releases](https://github.com/spf13/hugo/releases) and download the 20 | appropriate version for your os and architecture. 21 | 22 | Save it somewhere specific as we will be using it in the next step. 23 | 24 | More complete instructions are available at [installing hugo](/overview/installing/) 25 | 26 | ## Step 2. Build the Docs 27 | 28 | Hugo has its own example site which happens to also be the documentation site 29 | you are reading right now. 30 | 31 | Follow the following steps: 32 | 33 | 1. Clone the [hugo repository](http://github.com/spf13/hugo) 34 | 2. Go into the repo 35 | 3. Run hugo in server mode and build the docs 36 | 4. Open your browser to http://localhost:1313 37 | 38 | Corresponding pseudo commands: 39 | 40 | git clone https://github.com/spf13/hugo 41 | cd hugo 42 | /path/to/where/you/installed/hugo server --source=./docs 43 | > 29 pages created 44 | > 0 tags index created 45 | > in 27 ms 46 | > Web Server is available at http://localhost:1313 47 | > Press ctrl+c to stop 48 | 49 | Once you've gotten here, follow along the rest of this page on your local build. 50 | 51 | ## Step 3. Change the docs site 52 | 53 | Stop the Hugo process by hitting ctrl+c. 54 | 55 | Now we are going to run hugo again, but this time with hugo in watch mode. 56 | 57 | /path/to/hugo/from/step/1/hugo server --source=./docs --watch 58 | > 29 pages created 59 | > 0 tags index created 60 | > in 27 ms 61 | > Web Server is available at http://localhost:1313 62 | > Watching for changes in /Users/spf13/Code/hugo/docs/content 63 | > Press ctrl+c to stop 64 | 65 | 66 | Open your [favorite editor](http://vim.spf13.com) and change one of the source 67 | content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*. 68 | 69 | Content files are found in `docs/content/`. Unless otherwise specified, files 70 | are located at the same relative location as the url, in our case 71 | `docs/content/overview/quickstart.md`. 72 | 73 | Change and save this file.. Notice what happened in your terminal. 74 | 75 | > Change detected, rebuilding site 76 | 77 | > 29 pages created 78 | > 0 tags index created 79 | > in 26 ms 80 | 81 | Refresh the browser and observe that the typo is now fixed. 82 | 83 | Notice how quick that was. Try to refresh the site before it's finished building.. I double dare you. 84 | Having nearly instant feedback enables you to have your creativity flow without waiting for long builds. 85 | 86 | ## Step 4. Have fun 87 | 88 | The best way to learn something is to play with it. 89 | -------------------------------------------------------------------------------- /static/js/smooth-scroll.min.js: -------------------------------------------------------------------------------- 1 | /** smooth-scroll v7.0.2, by Chris Ferdinandi | http://github.com/cferdinandi/smooth-scroll | Licensed under MIT: http://gomakethings.com/mit/ */ 2 | !function(t,e){"function"==typeof define&&define.amd?define([],e(t)):"object"==typeof exports?module.exports=e(t):t.smoothScroll=e(t)}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";var e,n,o,r,a={},u=!!t.document.querySelector&&!!t.addEventListener,c={speed:500,easing:"easeInOutCubic",offset:0,updateURL:!0,callback:function(){}},i=function(){var t={},e=!1,n=0,o=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],n++);for(var r=function(n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=e&&"[object Object]"===Object.prototype.toString.call(n[o])?i(!0,t[o],n[o]):n[o])};o>n;n++){var a=arguments[n];r(a)}return t},s=function(t){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},l=function(t,e){var n,o,r=e.charAt(0),a="classList"in document.documentElement;for("["===r&&(e=e.substr(1,e.length-2),n=e.split("="),n.length>1&&(o=!0,n[1]=n[1].replace(/"/g,"").replace(/'/g,"")));t&&t!==document;t=t.parentNode){if("."===r)if(a){if(t.classList.contains(e.substr(1)))return t}else if(new RegExp("(^|\\s)"+e.substr(1)+"(\\s|$)").test(t.className))return t;if("#"===r&&t.id===e.substr(1))return t;if("["===r&&t.hasAttribute(n[0])){if(!o)return t;if(t.getAttribute(n[0])===n[1])return t}if(t.tagName.toLowerCase()===e)return t}return null},f=function(t){for(var e,n=String(t),o=n.length,r=-1,a="",u=n.charCodeAt(0);++r=1&&31>=e||127==e||0===r&&e>=48&&57>=e||1===r&&e>=48&&57>=e&&45===u?"\\"+e.toString(16)+" ":e>=128||45===e||95===e||e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e?n.charAt(r):"\\"+n.charAt(r)}return a},d=function(t,e){var n;return"easeInQuad"===t&&(n=e*e),"easeOutQuad"===t&&(n=e*(2-e)),"easeInOutQuad"===t&&(n=.5>e?2*e*e:-1+(4-2*e)*e),"easeInCubic"===t&&(n=e*e*e),"easeOutCubic"===t&&(n=--e*e*e+1),"easeInOutCubic"===t&&(n=.5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1),"easeInQuart"===t&&(n=e*e*e*e),"easeOutQuart"===t&&(n=1- --e*e*e*e),"easeInOutQuart"===t&&(n=.5>e?8*e*e*e*e:1-8*--e*e*e*e),"easeInQuint"===t&&(n=e*e*e*e*e),"easeOutQuint"===t&&(n=1+--e*e*e*e*e),"easeInOutQuint"===t&&(n=.5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e),n||e},h=function(t,e,n){var o=0;if(t.offsetParent)do o+=t.offsetTop,t=t.offsetParent;while(t);return o=o-e-n,o>=0?o:0},m=function(){return Math.max(t.document.body.scrollHeight,t.document.documentElement.scrollHeight,t.document.body.offsetHeight,t.document.documentElement.offsetHeight,t.document.body.clientHeight,t.document.documentElement.clientHeight)},p=function(t){return t&&"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(t):{}},g=function(e,n){t.history.pushState&&(n||"true"===n)&&t.history.pushState(null,null,[t.location.protocol,"//",t.location.host,t.location.pathname,t.location.search,e].join(""))},b=function(t){return null===t?0:s(t)+t.offsetTop};a.animateScroll=function(e,n,a){var u=p(e?e.getAttribute("data-options"):null),s=i(s||c,a||{},u);n="#"+f(n.substr(1));var l="#"===n?t.document.documentElement:t.document.querySelector(n),v=t.pageYOffset;o||(o=t.document.querySelector("[data-scroll-header]")),r||(r=b(o));var y,O,S,I=h(l,r,parseInt(s.offset,10)),E=I-v,L=m(),H=0;g(n,s.updateURL);var j=function(o,r,a){var u=t.pageYOffset;(o==r||u==r||t.innerHeight+u>=L)&&(clearInterval(a),l.focus(),s.callback(e,n))},w=function(){H+=16,O=H/parseInt(s.speed,10),O=O>1?1:O,S=v+E*d(s.easing,O),t.scrollTo(0,Math.floor(S)),j(S,I,y)},C=function(){y=setInterval(w,16)};0===t.pageYOffset&&t.scrollTo(0,0),C()};var v=function(t){var n=l(t.target,"[data-scroll]");n&&"a"===n.tagName.toLowerCase()&&(t.preventDefault(),a.animateScroll(n,n.hash,e))},y=function(t){n||(n=setTimeout(function(){n=null,r=b(o)},66))};return a.destroy=function(){e&&(t.document.removeEventListener("click",v,!1),t.removeEventListener("resize",y,!1),e=null,n=null,o=null,r=null)},a.init=function(n){u&&(a.destroy(),e=i(c,n||{}),o=t.document.querySelector("[data-scroll-header]"),r=b(o),t.document.addEventListener("click",v,!1),o&&t.addEventListener("resize",y,!1))},a}); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Steam 2 | 3 | Steam is a minimal and customizable theme for bloggers and was developed by [Tommaso Barbato](//github.com/epistrephein). He created it as a slightly adapted version of the [Vapor](//github.com/sethlilly/Vapor) Ghost theme by [Seth Lilly](//github.com/sethlilly). Noteworthy features of this Hugo port are the integration of a comment-system powered by Disqus, the customizable appearance by changing theme colors, support for RSS feeds, syntax highlighting via Highlight.js for source code and the optional use of Google Analytics. Enough to read. Let's take the first steps to get started. 4 | 5 | #### Please note that this theme is no longer maintained. 6 | 7 | ![Screenshot](https://raw.githubusercontent.com/digitalcraftsman/hugo-steam-theme/dev/images/screenshot.png) 8 | 9 | 10 | ## Installation 11 | 12 | Inside the folder of your Hugo site run: 13 | 14 | $ cd themes 15 | $ git clone https://github.com/digitalcraftsman/hugo-steam-theme.git 16 | 17 | For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo. 18 | 19 | ### The config file 20 | 21 | Take a look inside the [`exampleSite`](//github.com/digitalcraftsman/hugo-steam-theme/blob/dev/exampleSite/) folder of this theme. You'll find a file called [`config.toml`](//github.com/digitalcraftsman/hugo-steam-theme/blob/dev/exampleSite/config.toml). 22 | 23 | To use it, copy the [`config.toml`](//github.com/digitalcraftsman/hugo-steam-theme/blob/dev/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to change strings as you like to customize your website. 24 | 25 | ## Add links to the navigation 26 | 27 | You can add custom pages like this by adding `menu = "main"` in the frontmatter: 28 | 29 | ```toml 30 | +++ 31 | date = "2015-08-22" 32 | title = "About me" 33 | menu = "main" 34 | +++ 35 | ``` 36 | 37 | If no document contains menu = "main" in the frontmatter than the navigation will not be shown 38 | 39 | 40 | ## Customize theme colors 41 | 42 | This theme features four different theme colors (green as default, blue, red and orange) that change the appearance of you Hugo site slightly. Just set the `themeColor` variable to the color you like. 43 | 44 | Furthermore you can create your own theme. Under [`layouts/partials/themes`](//github.com/digitalcraftsman/hugo-steam-theme/tree/dev/layouts/partials/themes) you'll find a stylesheet template called [`custom-theme.html`](//github.com/digitalcraftsman/hugo-steam-theme/blob/dev/layouts/partials/themes/custom-theme.html). Customize the colors as you like and save the new theme with the schema `-theme.html` within the same folder. As you can see, the color is the prefix of the stylesheet template. Therefore you just need to set `themeColor` in the [`configs`](//github.com/digitalcraftsman/hugo-steam-theme/blob/dev/exampleSite/config.toml)) to that self-defined prefix. 45 | 46 | ## Comments 47 | 48 | This theme features a comment system powered by Disqus. To enable it you have to add your Disqus shortname to the `disqusShortname` variable in the config file. 49 | 50 | ## Nearly finished 51 | 52 | In order to see your site in action, run Hugo's built-in local server. 53 | 54 | $ hugo server 55 | 56 | Now enter [`localhost:1313`](http://localhost:1313) in the address bar of your browser. 57 | 58 | ## Changelog 59 | 60 | You can find the latest changes and improvements of this theme in the [CHANGELOG.md](https://github.com/digitalcraftsman/hugo-steam-theme/blob/master/CHANGELOG.md) 61 | 62 | 63 | ## Contributing 64 | 65 | Did you found a bug or got an idea for a new feature? Feel free to use the [issue tracker](//github.com/digitalcraftsman/hugo-steam-theme/issues) to let me know. Or make directly a [pull request](//github.com/digitalcraftsman/hugo-steam-theme/pulls). 66 | 67 | 68 | ## License 69 | 70 | This theme is released under the MIT license. For more information read the [License](//github.com/digitalcraftsman/hugo-steam-theme/blob/master/LICENSE.md). 71 | 72 | 73 | ## Annotations 74 | 75 | Thanks to 76 | 77 | - [Steve Francia](//github.com/spf13) for creating Hugo and the awesome community around the project. 78 | - [Seth Lilly](//github.com/sethlilly) and [Tommaso Barbato](//github.com/epistrephein) for developing the original version(s) of this theme 79 | -------------------------------------------------------------------------------- /static/fonts/icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 25 | 35 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /exampleSite/content/post/migrate-from-jekyll.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: 2014-03-10 3 | linktitle: Migrating from Jekyll 4 | prev: /tutorials/mathjax 5 | title: Migrate to Hugo from Jekyll 6 | weight: 10 7 | description: Lorem ipsum dolor sit amet, consectetur adipisicing elit. Earum similique, ipsum officia amet blanditiis provident ratione nihil ipsam dolorem repellat. 8 | --- 9 | 10 | ## Move static content to `static` 11 | Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there. 12 | With Jekyll, something that looked like 13 | 14 | ▾ / 15 | ▾ images/ 16 | logo.png 17 | 18 | should become 19 | 20 | ▾ / 21 | ▾ static/ 22 | ▾ images/ 23 | logo.png 24 | 25 | Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`. 26 | 27 | ## Create your Hugo configuration file 28 | Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details. 29 | 30 | ## Set your configuration publish folder to `_site` 31 | The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives: 32 | 33 | 1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended). 34 | 35 | git submodule deinit _site 36 | git rm _site 37 | git submodule add -b gh-pages git@github.com:your-username/your-repo.git public 38 | 39 | 2. Or, change the Hugo configuration to use `_site` instead of `public`. 40 | 41 | { 42 | .. 43 | "publishdir": "_site", 44 | .. 45 | } 46 | 47 | ## Convert Jekyll templates to Hugo templates 48 | That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way. 49 | 50 | As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours. 51 | 52 | ## Convert Jekyll plugins to Hugo shortcodes 53 | Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port. 54 | 55 | ### Implementation 56 | As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing. 57 | 58 | Jekyll's plugin: 59 | 60 | ```ruby 61 | module Jekyll 62 | class ImageTag < Liquid::Tag 63 | @url = nil 64 | @caption = nil 65 | @class = nil 66 | @link = nil 67 | // Patterns 68 | IMAGE_URL_WITH_CLASS_AND_CAPTION = 69 | IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i 70 | IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i 71 | IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i 72 | IMAGE_URL = /((https?:\/\/|\/)(\S+))/i 73 | def initialize(tag_name, markup, tokens) 74 | super 75 | if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK 76 | @class = $1 77 | @url = $3 78 | @caption = $7 79 | @link = $9 80 | elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION 81 | @class = $1 82 | @url = $3 83 | @caption = $7 84 | elsif markup =~ IMAGE_URL_WITH_CAPTION 85 | @url = $1 86 | @caption = $5 87 | elsif markup =~ IMAGE_URL_WITH_CLASS 88 | @class = $1 89 | @url = $3 90 | elsif markup =~ IMAGE_URL 91 | @url = $1 92 | end 93 | end 94 | def render(context) 95 | if @class 96 | source = "
" 97 | else 98 | source = "
" 99 | end 100 | if @link 101 | source += "" 102 | end 103 | source += "" 104 | if @link 105 | source += "" 106 | end 107 | source += "
#{@caption}
" if @caption 108 | source += "
" 109 | source 110 | end 111 | end 112 | end 113 | Liquid::Template.register_tag('image', Jekyll::ImageTag) 114 | ``` 115 | 116 | is written as this Hugo shortcode: 117 | 118 | 119 |
120 | {{ with .Get "link"}}{{ end }} 121 | 122 | {{ if .Get "link"}}{{ end }} 123 | {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} 124 |
{{ if isset .Params "title" }} 125 | {{ .Get "title" }}{{ end }} 126 | {{ if or (.Get "caption") (.Get "attr")}}

127 | {{ .Get "caption" }} 128 | {{ with .Get "attrlink"}} {{ end }} 129 | {{ .Get "attr" }} 130 | {{ if .Get "attrlink"}} {{ end }} 131 |

{{ end }} 132 |
133 | {{ end }} 134 |
135 | 136 | 137 | ### Usage 138 | I simply changed: 139 | 140 | {% 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/ %} 141 | 142 | to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`): 143 | 144 | {{%/* 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/" */%}} 145 | 146 | As a bonus, the shortcode named parameters are, arguably, more readable. 147 | 148 | ## Finishing touches 149 | ### Fix content 150 | Depending 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. 151 | 152 | ### Clean up 153 | You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it. 154 | 155 | ## A practical example in a diff 156 | [Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610). 157 | -------------------------------------------------------------------------------- /exampleSite/content/post/goisforlovers.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "(Hu)go Template Primer" 3 | tags = [ 4 | "go", 5 | "golang", 6 | "templates", 7 | "themes", 8 | "development", 9 | ] 10 | date = "2014-04-02" 11 | categories = [ 12 | "Development", 13 | "golang", 14 | ] 15 | description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Earum similique, ipsum officia amet blanditiis provident ratione nihil ipsam dolorem repellat." 16 | +++ 17 | 18 | Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for 19 | its template engine. It is an extremely lightweight engine that provides a very 20 | small amount of logic. In our experience that it is just the right amount of 21 | logic to be able to create a good static website. If you have used other 22 | template systems from different languages or frameworks you will find a lot of 23 | similarities in go templates. 24 | 25 | This document is a brief primer on using go templates. The [go docs][gohtmltemplate] 26 | provide more details. 27 | 28 | ## Introduction to Go Templates 29 | 30 | Go templates provide an extremely simple template language. It adheres to the 31 | belief that only the most basic of logic belongs in the template or view layer. 32 | One consequence of this simplicity is that go templates parse very quickly. 33 | 34 | A unique characteristic of go templates is they are content aware. Variables and 35 | content will be sanitized depending on the context of where they are used. More 36 | details can be found in the [go docs][gohtmltemplate]. 37 | 38 | ## Basic Syntax 39 | 40 | Go lang templates are html files with the addition of variables and 41 | functions. 42 | 43 | **Go variables and functions are accessible within {{ }}** 44 | 45 | Accessing a predefined variable "foo": 46 | 47 | {{ foo }} 48 | 49 | **Parameters are separated using spaces** 50 | 51 | Calling the add function with input of 1, 2: 52 | 53 | {{ add 1 2 }} 54 | 55 | **Methods and fields are accessed via dot notation** 56 | 57 | Accessing the Page Parameter "bar" 58 | 59 | {{ .Params.bar }} 60 | 61 | **Parentheses can be used to group items together** 62 | 63 | {{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }} 64 | 65 | 66 | ## Variables 67 | 68 | Each go template has a struct (object) made available to it. In hugo each 69 | template is passed either a page or a node struct depending on which type of 70 | page you are rendering. More details are available on the 71 | [variables](/layout/variables) page. 72 | 73 | A variable is accessed by referencing the variable name. 74 | 75 | {{ .Title }} 76 | 77 | Variables can also be defined and referenced. 78 | 79 | {{ $address := "123 Main St."}} 80 | {{ $address }} 81 | 82 | 83 | ## Functions 84 | 85 | Go template ship with a few functions which provide basic functionality. The go 86 | template system also provides a mechanism for applications to extend the 87 | available functions with their own. [Hugo template 88 | functions](/layout/functions) provide some additional functionality we believe 89 | are useful for building websites. Functions are called by using their name 90 | followed by the required parameters separated by spaces. Template 91 | functions cannot be added without recompiling hugo. 92 | 93 | **Example:** 94 | 95 | {{ add 1 2 }} 96 | 97 | ## Includes 98 | 99 | When including another template you will pass to it the data it will be 100 | able to access. To pass along the current context please remember to 101 | include a trailing dot. The templates location will always be starting at 102 | the /layout/ directory within Hugo. 103 | 104 | **Example:** 105 | 106 | {{ template "chrome/header.html" . }} 107 | 108 | 109 | ## Logic 110 | 111 | Go templates provide the most basic iteration and conditional logic. 112 | 113 | ### Iteration 114 | 115 | Just like in go, the go templates make heavy use of range to iterate over 116 | a map, array or slice. The following are different examples of how to use 117 | range. 118 | 119 | **Example 1: Using Context** 120 | 121 | {{ range array }} 122 | {{ . }} 123 | {{ end }} 124 | 125 | **Example 2: Declaring value variable name** 126 | 127 | {{range $element := array}} 128 | {{ $element }} 129 | {{ end }} 130 | 131 | **Example 2: Declaring key and value variable name** 132 | 133 | {{range $index, $element := array}} 134 | {{ $index }} 135 | {{ $element }} 136 | {{ end }} 137 | 138 | ### Conditionals 139 | 140 | If, else, with, or, & and provide the framework for handling conditional 141 | logic in Go Templates. Like range, each statement is closed with `end`. 142 | 143 | 144 | Go Templates treat the following values as false: 145 | 146 | * false 147 | * 0 148 | * any array, slice, map, or string of length zero 149 | 150 | **Example 1: If** 151 | 152 | {{ if isset .Params "title" }}

{{ index .Params "title" }}

{{ end }} 153 | 154 | **Example 2: If -> Else** 155 | 156 | {{ if isset .Params "alt" }} 157 | {{ index .Params "alt" }} 158 | {{else}} 159 | {{ index .Params "caption" }} 160 | {{ end }} 161 | 162 | **Example 3: And & Or** 163 | 164 | {{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} 165 | 166 | **Example 4: With** 167 | 168 | An alternative way of writing "if" and then referencing the same value 169 | is to use "with" instead. With rebinds the context `.` within its scope, 170 | and skips the block if the variable is absent. 171 | 172 | The first example above could be simplified as: 173 | 174 | {{ with .Params.title }}

{{ . }}

{{ end }} 175 | 176 | **Example 5: If -> Else If** 177 | 178 | {{ if isset .Params "alt" }} 179 | {{ index .Params "alt" }} 180 | {{ else if isset .Params "caption" }} 181 | {{ index .Params "caption" }} 182 | {{ end }} 183 | 184 | ## Pipes 185 | 186 | One of the most powerful components of go templates is the ability to 187 | stack actions one after another. This is done by using pipes. Borrowed 188 | from unix pipes, the concept is simple, each pipeline's output becomes the 189 | input of the following pipe. 190 | 191 | Because of the very simple syntax of go templates, the pipe is essential 192 | to being able to chain together function calls. One limitation of the 193 | pipes is that they only can work with a single value and that value 194 | becomes the last parameter of the next pipeline. 195 | 196 | A few simple examples should help convey how to use the pipe. 197 | 198 | **Example 1 :** 199 | 200 | {{ if eq 1 1 }} Same {{ end }} 201 | 202 | is the same as 203 | 204 | {{ eq 1 1 | if }} Same {{ end }} 205 | 206 | It does look odd to place the if at the end, but it does provide a good 207 | illustration of how to use the pipes. 208 | 209 | **Example 2 :** 210 | 211 | {{ index .Params "disqus_url" | html }} 212 | 213 | Access the page parameter called "disqus_url" and escape the HTML. 214 | 215 | **Example 3 :** 216 | 217 | {{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} 218 | Stuff Here 219 | {{ end }} 220 | 221 | Could be rewritten as 222 | 223 | {{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }} 224 | Stuff Here 225 | {{ end }} 226 | 227 | 228 | ## Context (aka. the dot) 229 | 230 | The most easily overlooked concept to understand about go templates is that {{ . }} 231 | always refers to the current context. In the top level of your template this 232 | will be the data set made available to it. Inside of a iteration it will have 233 | the value of the current item. When inside of a loop the context has changed. . 234 | will no longer refer to the data available to the entire page. If you need to 235 | access this from within the loop you will likely want to set it to a variable 236 | instead of depending on the context. 237 | 238 | **Example:** 239 | 240 | {{ $title := .Site.Title }} 241 | {{ range .Params.tags }} 242 |
  • {{ . }} - {{ $title }}
  • 243 | {{ end }} 244 | 245 | Notice how once we have entered the loop the value of {{ . }} has changed. We 246 | have defined a variable outside of the loop so we have access to it from within 247 | the loop. 248 | 249 | # Hugo Parameters 250 | 251 | Hugo provides the option of passing values to the template language 252 | through the site configuration (for sitewide values), or through the meta 253 | data of each specific piece of content. You can define any values of any 254 | type (supported by your front matter/config format) and use them however 255 | you want to inside of your templates. 256 | 257 | 258 | ## Using Content (page) Parameters 259 | 260 | In each piece of content you can provide variables to be used by the 261 | templates. This happens in the [front matter](/content/front-matter). 262 | 263 | An example of this is used in this documentation site. Most of the pages 264 | benefit from having the table of contents provided. Sometimes the TOC just 265 | doesn't make a lot of sense. We've defined a variable in our front matter 266 | of some pages to turn off the TOC from being displayed. 267 | 268 | Here is the example front matter: 269 | 270 | ``` 271 | --- 272 | title: "Permalinks" 273 | date: "2013-11-18" 274 | aliases: 275 | - "/doc/permalinks/" 276 | groups: ["extras"] 277 | groups_weight: 30 278 | notoc: true 279 | --- 280 | ``` 281 | 282 | Here is the corresponding code inside of the template: 283 | 284 | {{ if not .Params.notoc }} 285 |
    286 | {{ .TableOfContents }} 287 |
    288 | {{ end }} 289 | 290 | 291 | 292 | ## Using Site (config) Parameters 293 | In your top-level configuration file (eg, `config.yaml`) you can define site 294 | parameters, which are values which will be available to you in chrome. 295 | 296 | For instance, you might declare: 297 | 298 | ```yaml 299 | params: 300 | CopyrightHTML: "Copyright © 2013 John Doe. All Rights Reserved." 301 | TwitterUser: "spf13" 302 | SidebarRecentLimit: 5 303 | ``` 304 | 305 | Within a footer layout, you might then declare a `