From 667e11c4ec3835d959aab1797647bd0a49869674 Mon Sep 17 00:00:00 2001 From: etienne Date: Tue, 21 Oct 2014 23:35:24 +0200 Subject: Init commit --- README.md | 78 + archetypes/default.md | 6 + archetypes/showcase.md | 14 + config.toml | 66 + content/community/contributing.md | 67 + content/community/mailing-list.md | 50 + content/community/press.md | 65 + content/content/archetypes.md | 75 + content/content/example.md | 49 + content/content/front-matter.md | 95 + content/content/ordering.md | 39 + content/content/organization.md | 164 ++ content/content/sections.md | 51 + content/content/types.md | 76 + content/extras/aliases.md | 40 + content/extras/builders.md | 60 + content/extras/comments.md | 100 ++ content/extras/highlighting.md | 102 ++ content/extras/livereload.md | 61 + content/extras/menus.md | 178 ++ content/extras/permalinks.md | 53 + content/extras/shortcodes.md | 237 +++ content/extras/toc.md | 37 + content/extras/urls.md | 45 + content/meta/license.md | 78 + content/meta/release-notes.md | 139 ++ content/meta/roadmap.md | 25 + content/overview/configuration.md | 70 + content/overview/installing.md | 68 + content/overview/introduction.md | 126 ++ content/overview/quickstart.md | 159 ++ content/overview/source-directory.md | 90 + content/overview/usage.md | 89 + content/showcase/antzucaro.md | 15 + content/showcase/asc.md | 14 + content/showcase/carlorat.md | 14 + content/showcase/chimera-art-space.md | 14 + content/showcase/chingli.md | 14 + content/showcase/cloudshark.md | 14 + content/showcase/danmux.md | 14 + content/showcase/devmonk.md | 14 + content/showcase/hackmeeting.md | 14 + content/showcase/heyitsalex.md | 14 + content/showcase/hugo.md | 14 + content/showcase/ifup.md | 14 + content/showcase/kieranhealy.md | 15 + content/showcase/lk4d4.darth.io.md | 14 + content/showcase/michaelwhatcott.md | 14 + content/showcase/minodisk.md | 14 + content/showcase/nickoneill.md | 14 + content/showcase/ninya.io.md | 14 + content/showcase/npf.md | 14 + content/showcase/peteraba.md | 14 + content/showcase/spf13.md | 14 + content/showcase/techmadeplain.md | 13 + content/showcase/tendermint.md | 13 + content/showcase/ucsb.md | 13 + content/showcase/vurt.co.md | 14 + content/showcase/yslow-rules.md | 15 + content/taxonomies/displaying.md | 119 ++ content/taxonomies/methods.md | 54 + content/taxonomies/ordering.md | 77 + content/taxonomies/overview.md | 92 + content/taxonomies/templates.md | 25 + content/taxonomies/usage.md | 72 + content/templates/404.md | 41 + content/templates/content.md | 161 ++ content/templates/functions.md | 164 ++ content/templates/go-templates.md | 379 ++++ content/templates/homepage.md | 78 + content/templates/list.md | 338 ++++ content/templates/overview.md | 72 + content/templates/partials.md | 103 ++ content/templates/rss.md | 100 ++ content/templates/sitemap.md | 52 + content/templates/terms.md | 160 ++ content/templates/variables.md | 82 + content/templates/views.md | 127 ++ content/themes/creation.md | 73 + content/themes/customizing.md | 57 + content/themes/installing.md | 28 + content/themes/overview.md | 31 + content/themes/usage.md | 22 + content/tutorials/github_pages_blog.md | 201 +++ content/tutorials/mathjax.md | 82 + content/tutorials/migrate-from-jekyll.md | 156 ++ layouts/_default/list.html | 0 layouts/_default/single.html | 3 + layouts/index.html | 74 + layouts/partials/analytics.html | 0 layouts/partials/footer.html | 61 + layouts/partials/header.html | 24 + layouts/partials/menu.html | 40 + layouts/partials/top-block.html | 19 + layouts/section/showcase.html | 12 + layouts/showcase/thumbnail.html | 15 + static/apple-touch-icon.png | Bin 0 -> 7993 bytes static/assets/font-awesome/css/font-awesome.css | 1566 +++++++++++++++++ .../assets/font-awesome/css/font-awesome.min.css | 4 + static/assets/font-awesome/fonts/FontAwesome.otf | Bin 0 -> 75188 bytes .../font-awesome/fonts/fontawesome-webfont.eot | Bin 0 -> 72449 bytes .../font-awesome/fonts/fontawesome-webfont.svg | 504 ++++++ .../font-awesome/fonts/fontawesome-webfont.ttf | Bin 0 -> 141564 bytes .../font-awesome/fonts/fontawesome-webfont.woff | Bin 0 -> 83760 bytes .../assets/font-awesome/less/bordered-pulled.less | 16 + static/assets/font-awesome/less/core.less | 12 + static/assets/font-awesome/less/fixed-width.less | 6 + static/assets/font-awesome/less/font-awesome.less | 17 + static/assets/font-awesome/less/icons.less | 412 +++++ static/assets/font-awesome/less/larger.less | 13 + static/assets/font-awesome/less/list.less | 19 + static/assets/font-awesome/less/mixins.less | 20 + static/assets/font-awesome/less/path.less | 14 + .../assets/font-awesome/less/rotated-flipped.less | 9 + static/assets/font-awesome/less/spinning.less | 30 + static/assets/font-awesome/less/stacked.less | 20 + static/assets/font-awesome/less/variables.less | 381 ++++ .../assets/font-awesome/scss/_bordered-pulled.scss | 16 + static/assets/font-awesome/scss/_core.scss | 12 + static/assets/font-awesome/scss/_fixed-width.scss | 6 + static/assets/font-awesome/scss/_icons.scss | 412 +++++ static/assets/font-awesome/scss/_larger.scss | 13 + static/assets/font-awesome/scss/_list.scss | 19 + static/assets/font-awesome/scss/_mixins.scss | 20 + static/assets/font-awesome/scss/_path.scss | 14 + .../assets/font-awesome/scss/_rotated-flipped.scss | 9 + static/assets/font-awesome/scss/_spinning.scss | 30 + static/assets/font-awesome/scss/_stacked.scss | 20 + static/assets/font-awesome/scss/_variables.scss | 381 ++++ static/assets/font-awesome/scss/font-awesome.scss | 17 + static/assets/font/octicons.eot | Bin 0 -> 27278 bytes static/assets/font/octicons.svg | 198 +++ static/assets/font/octicons.ttf | Bin 0 -> 53560 bytes static/assets/font/octicons.woff | Bin 0 -> 30608 bytes static/css/HPstyles.css | 269 +++ static/css/bootstrap-theme.css | 1430 +++++++++++++++ static/css/hugofont.css | 191 ++ static/css/monokai_sublime.css | 149 ++ static/css/owl.carousel.css | 216 +++ static/css/owl.theme.default.css | 60 + static/css/style-responsive.css | 68 + static/css/style.css | 433 +++++ static/favicon.ico | Bin 0 -> 15086 bytes static/fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20335 bytes static/fonts/glyphicons-halflings-regular.svg | 229 +++ static/fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 41280 bytes static/fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23320 bytes static/fonts/hugo.eot | Bin 0 -> 16380 bytes static/fonts/hugo.svg | 63 + static/fonts/hugo.ttf | Bin 0 -> 16228 bytes static/fonts/hugo.woff | Bin 0 -> 11728 bytes static/img/antzucaro-tn.jpg | Bin 0 -> 26326 bytes static/img/asc-tn.jpg | Bin 0 -> 31491 bytes static/img/carlorat-tn.jpg | Bin 0 -> 24072 bytes static/img/chimera-tn.jpg | Bin 0 -> 34473 bytes static/img/chingli-tn.jpg | Bin 0 -> 37598 bytes static/img/cloudshark-tn.jpg | Bin 0 -> 32670 bytes static/img/danmux-tn.jpg | Bin 0 -> 22847 bytes static/img/desk-long.jpg | Bin 0 -> 198917 bytes static/img/desk-mini.jpg | Bin 0 -> 61635 bytes static/img/desk-sm.jpg | Bin 0 -> 139803 bytes static/img/desk.jpg | Bin 0 -> 383437 bytes static/img/devmonk-tn.jpg | Bin 0 -> 25360 bytes static/img/gray.png | Bin 0 -> 19856 bytes static/img/hackmeeting-tn.jpg | Bin 0 -> 50350 bytes static/img/heyitsalex-tn.jpg | Bin 0 -> 29394 bytes static/img/hugo-logo-med.png | Bin 0 -> 35873 bytes static/img/hugo-logo.png | Bin 0 -> 20061 bytes static/img/hugo-tn.jpg | Bin 0 -> 70522 bytes static/img/hugo.png | Bin 0 -> 49531 bytes static/img/hugoSM.png | Bin 0 -> 1869 bytes static/img/ifup-tn.jpg | Bin 0 -> 18155 bytes static/img/kjhealy-tn.jpg | Bin 0 -> 37932 bytes static/img/lk4d4-tn.jpg | Bin 0 -> 39146 bytes static/img/michaelwhatcott-tn.jpg | Bin 0 -> 12223 bytes static/img/minodisk-tn.jpg | Bin 0 -> 20824 bytes static/img/nickoneill-tn.jpg | Bin 0 -> 36535 bytes static/img/ninya-tn.jpg | Bin 0 -> 33215 bytes static/img/npf-tn.jpg | Bin 0 -> 34938 bytes static/img/peteraba-tn.jpg | Bin 0 -> 43715 bytes static/img/spf13-tn.jpg | Bin 0 -> 33008 bytes static/img/techmadeplain-tn.jpg | Bin 0 -> 50148 bytes static/img/tendermint-tn.jpg | Bin 0 -> 28086 bytes static/img/ucsb-tn.jpg | Bin 0 -> 62716 bytes static/img/vurt.co-tn.jpg | Bin 0 -> 36001 bytes static/img/yslow-rules.jpg | Bin 0 -> 68401 bytes static/js/bootstrap.min.js | 11 + static/js/buttons.css | 1846 ++++++++++++++++++++ static/js/buttons.html | 19 + static/js/buttons.js | 1 + static/js/highlight.pack.js | 1 + static/js/instantclick.min.js | 12 + static/js/jquery-2.1.1.min.js | 4 + static/js/jquery.scrollTo.min.js | 7 + static/js/livereload.js | 1132 ++++++++++++ static/js/owl.carousel.min.js | 2 + static/js/scripts.js | 283 +++ static/share/hugo-tall.png | Bin 0 -> 9971 bytes static/share/made-with-hugo-dark.png | Bin 0 -> 8764 bytes static/share/made-with-hugo-long-dark.png | Bin 0 -> 9116 bytes static/share/made-with-hugo-long.png | Bin 0 -> 9318 bytes static/share/made-with-hugo.png | Bin 0 -> 8900 bytes static/share/powered-by-hugo-dark.png | Bin 0 -> 3545 bytes static/share/powered-by-hugo-long-dark.png | Bin 0 -> 3857 bytes static/share/powered-by-hugo-long.png | Bin 0 -> 3773 bytes static/share/powered-by-hugo.png | Bin 0 -> 3527 bytes theme.toml | 6 + 207 files changed, 16852 insertions(+) create mode 100644 README.md create mode 100644 archetypes/default.md create mode 100644 archetypes/showcase.md create mode 100644 config.toml create mode 100644 content/community/contributing.md create mode 100644 content/community/mailing-list.md create mode 100644 content/community/press.md create mode 100644 content/content/archetypes.md create mode 100644 content/content/example.md create mode 100644 content/content/front-matter.md create mode 100644 content/content/ordering.md create mode 100644 content/content/organization.md create mode 100644 content/content/sections.md create mode 100644 content/content/types.md create mode 100644 content/extras/aliases.md create mode 100644 content/extras/builders.md create mode 100644 content/extras/comments.md create mode 100644 content/extras/highlighting.md create mode 100644 content/extras/livereload.md create mode 100644 content/extras/menus.md create mode 100644 content/extras/permalinks.md create mode 100644 content/extras/shortcodes.md create mode 100644 content/extras/toc.md create mode 100644 content/extras/urls.md create mode 100644 content/meta/license.md create mode 100644 content/meta/release-notes.md create mode 100644 content/meta/roadmap.md create mode 100644 content/overview/configuration.md create mode 100644 content/overview/installing.md create mode 100644 content/overview/introduction.md create mode 100644 content/overview/quickstart.md create mode 100644 content/overview/source-directory.md create mode 100644 content/overview/usage.md create mode 100644 content/showcase/antzucaro.md create mode 100644 content/showcase/asc.md create mode 100644 content/showcase/carlorat.md create mode 100644 content/showcase/chimera-art-space.md create mode 100644 content/showcase/chingli.md create mode 100644 content/showcase/cloudshark.md create mode 100644 content/showcase/danmux.md create mode 100644 content/showcase/devmonk.md create mode 100644 content/showcase/hackmeeting.md create mode 100644 content/showcase/heyitsalex.md create mode 100644 content/showcase/hugo.md create mode 100644 content/showcase/ifup.md create mode 100644 content/showcase/kieranhealy.md create mode 100644 content/showcase/lk4d4.darth.io.md create mode 100644 content/showcase/michaelwhatcott.md create mode 100644 content/showcase/minodisk.md create mode 100644 content/showcase/nickoneill.md create mode 100644 content/showcase/ninya.io.md create mode 100644 content/showcase/npf.md create mode 100644 content/showcase/peteraba.md create mode 100644 content/showcase/spf13.md create mode 100644 content/showcase/techmadeplain.md create mode 100644 content/showcase/tendermint.md create mode 100644 content/showcase/ucsb.md create mode 100644 content/showcase/vurt.co.md create mode 100644 content/showcase/yslow-rules.md create mode 100644 content/taxonomies/displaying.md create mode 100644 content/taxonomies/methods.md create mode 100644 content/taxonomies/ordering.md create mode 100644 content/taxonomies/overview.md create mode 100644 content/taxonomies/templates.md create mode 100644 content/taxonomies/usage.md create mode 100644 content/templates/404.md create mode 100644 content/templates/content.md create mode 100644 content/templates/functions.md create mode 100644 content/templates/go-templates.md create mode 100644 content/templates/homepage.md create mode 100644 content/templates/list.md create mode 100644 content/templates/overview.md create mode 100644 content/templates/partials.md create mode 100644 content/templates/rss.md create mode 100644 content/templates/sitemap.md create mode 100644 content/templates/terms.md create mode 100644 content/templates/variables.md create mode 100644 content/templates/views.md create mode 100644 content/themes/creation.md create mode 100644 content/themes/customizing.md create mode 100644 content/themes/installing.md create mode 100644 content/themes/overview.md create mode 100644 content/themes/usage.md create mode 100644 content/tutorials/github_pages_blog.md create mode 100644 content/tutorials/mathjax.md create mode 100644 content/tutorials/migrate-from-jekyll.md create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100755 layouts/index.html create mode 100644 layouts/partials/analytics.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/menu.html create mode 100644 layouts/partials/top-block.html create mode 100644 layouts/section/showcase.html create mode 100644 layouts/showcase/thumbnail.html create mode 100644 static/apple-touch-icon.png create mode 100755 static/assets/font-awesome/css/font-awesome.css create mode 100755 static/assets/font-awesome/css/font-awesome.min.css create mode 100755 static/assets/font-awesome/fonts/FontAwesome.otf create mode 100755 static/assets/font-awesome/fonts/fontawesome-webfont.eot create mode 100755 static/assets/font-awesome/fonts/fontawesome-webfont.svg create mode 100755 static/assets/font-awesome/fonts/fontawesome-webfont.ttf create mode 100755 static/assets/font-awesome/fonts/fontawesome-webfont.woff create mode 100755 static/assets/font-awesome/less/bordered-pulled.less create mode 100755 static/assets/font-awesome/less/core.less create mode 100755 static/assets/font-awesome/less/fixed-width.less create mode 100755 static/assets/font-awesome/less/font-awesome.less create mode 100755 static/assets/font-awesome/less/icons.less create mode 100755 static/assets/font-awesome/less/larger.less create mode 100755 static/assets/font-awesome/less/list.less create mode 100755 static/assets/font-awesome/less/mixins.less create mode 100755 static/assets/font-awesome/less/path.less create mode 100755 static/assets/font-awesome/less/rotated-flipped.less create mode 100755 static/assets/font-awesome/less/spinning.less create mode 100755 static/assets/font-awesome/less/stacked.less create mode 100755 static/assets/font-awesome/less/variables.less create mode 100755 static/assets/font-awesome/scss/_bordered-pulled.scss create mode 100755 static/assets/font-awesome/scss/_core.scss create mode 100755 static/assets/font-awesome/scss/_fixed-width.scss create mode 100755 static/assets/font-awesome/scss/_icons.scss create mode 100755 static/assets/font-awesome/scss/_larger.scss create mode 100755 static/assets/font-awesome/scss/_list.scss create mode 100755 static/assets/font-awesome/scss/_mixins.scss create mode 100755 static/assets/font-awesome/scss/_path.scss create mode 100755 static/assets/font-awesome/scss/_rotated-flipped.scss create mode 100755 static/assets/font-awesome/scss/_spinning.scss create mode 100755 static/assets/font-awesome/scss/_stacked.scss create mode 100755 static/assets/font-awesome/scss/_variables.scss create mode 100755 static/assets/font-awesome/scss/font-awesome.scss create mode 100644 static/assets/font/octicons.eot create mode 100644 static/assets/font/octicons.svg create mode 100644 static/assets/font/octicons.ttf create mode 100644 static/assets/font/octicons.woff create mode 100755 static/css/HPstyles.css create mode 100755 static/css/bootstrap-theme.css create mode 100755 static/css/hugofont.css create mode 100644 static/css/monokai_sublime.css create mode 100644 static/css/owl.carousel.css create mode 100644 static/css/owl.theme.default.css create mode 100755 static/css/style-responsive.css create mode 100755 static/css/style.css create mode 100644 static/favicon.ico create mode 100755 static/fonts/glyphicons-halflings-regular.eot create mode 100755 static/fonts/glyphicons-halflings-regular.svg create mode 100755 static/fonts/glyphicons-halflings-regular.ttf create mode 100755 static/fonts/glyphicons-halflings-regular.woff create mode 100755 static/fonts/hugo.eot create mode 100755 static/fonts/hugo.svg create mode 100755 static/fonts/hugo.ttf create mode 100755 static/fonts/hugo.woff create mode 100644 static/img/antzucaro-tn.jpg create mode 100644 static/img/asc-tn.jpg create mode 100644 static/img/carlorat-tn.jpg create mode 100644 static/img/chimera-tn.jpg create mode 100644 static/img/chingli-tn.jpg create mode 100644 static/img/cloudshark-tn.jpg create mode 100644 static/img/danmux-tn.jpg create mode 100644 static/img/desk-long.jpg create mode 100644 static/img/desk-mini.jpg create mode 100644 static/img/desk-sm.jpg create mode 100644 static/img/desk.jpg create mode 100644 static/img/devmonk-tn.jpg create mode 100644 static/img/gray.png create mode 100644 static/img/hackmeeting-tn.jpg create mode 100644 static/img/heyitsalex-tn.jpg create mode 100644 static/img/hugo-logo-med.png create mode 100644 static/img/hugo-logo.png create mode 100644 static/img/hugo-tn.jpg create mode 100644 static/img/hugo.png create mode 100644 static/img/hugoSM.png create mode 100644 static/img/ifup-tn.jpg create mode 100644 static/img/kjhealy-tn.jpg create mode 100644 static/img/lk4d4-tn.jpg create mode 100644 static/img/michaelwhatcott-tn.jpg create mode 100644 static/img/minodisk-tn.jpg create mode 100644 static/img/nickoneill-tn.jpg create mode 100644 static/img/ninya-tn.jpg create mode 100644 static/img/npf-tn.jpg create mode 100644 static/img/peteraba-tn.jpg create mode 100644 static/img/spf13-tn.jpg create mode 100644 static/img/techmadeplain-tn.jpg create mode 100644 static/img/tendermint-tn.jpg create mode 100644 static/img/ucsb-tn.jpg create mode 100644 static/img/vurt.co-tn.jpg create mode 100644 static/img/yslow-rules.jpg create mode 100755 static/js/bootstrap.min.js create mode 100644 static/js/buttons.css create mode 100644 static/js/buttons.html create mode 100644 static/js/buttons.js create mode 100644 static/js/highlight.pack.js create mode 100644 static/js/instantclick.min.js create mode 100644 static/js/jquery-2.1.1.min.js create mode 100755 static/js/jquery.scrollTo.min.js create mode 100644 static/js/livereload.js create mode 100644 static/js/owl.carousel.min.js create mode 100755 static/js/scripts.js create mode 100644 static/share/hugo-tall.png create mode 100644 static/share/made-with-hugo-dark.png create mode 100644 static/share/made-with-hugo-long-dark.png create mode 100644 static/share/made-with-hugo-long.png create mode 100644 static/share/made-with-hugo.png create mode 100644 static/share/powered-by-hugo-dark.png create mode 100644 static/share/powered-by-hugo-long-dark.png create mode 100644 static/share/powered-by-hugo-long.png create mode 100644 static/share/powered-by-hugo.png create mode 100644 theme.toml diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec43ce2 --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +# Hugo base theme + +Hugo theme based on [gohugo](https://gohugo.io) + +## How to use + - Place a image in `static/img/` + - Create posts to display your services. Use the follow as an example: + +### post + +```toml ++++ +date = 2014-10-13T20:07:19Z +draft = true +title = "First" +description = "Ceci est mon premier post \n bla bla bla" +weight = 1 +icon = "pacman" ++++ + +Hello first post +``` +### carrousel + + +```toml ++++ +date = 2014-10-13T19:54:21Z +draft = true +title = "About" +weight = 5 +icon = "circlestar" +[[carousel]] + quote = "First quote" + author ="John Do" + url = "" + quote_date = "13 August" +[[carousel]] + quote = "Second quote" + author ="Nhoj Od" + url = "" + quote_date = "14 August" ++++ +``` + + + +## Demo +View gohugo.io theme in action [here](https://gohugo.io) + + +=== + +Work also with YAML header + +For more Hugo details, read [documentation](http://jekyllrb.com/). + +## Config + +exemple of config.toml file +```toml +baseurl = "http://yourSiteHere" +languageCode = "fr-fr" +title = "my new web site" +[params] + description = "I <3 making web site" + mainIcon = "/img/hugo.png" + +[[params.social]] + title = "twitter" + url = "https://twitter.com/SBootstrap" +[[params.social]] + title = "github" + url = "https://github.com/IronSummitMedia/startbootstrap" +[[params.social]] + title = "linkedin" + url = "" +``` diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..6d6497c --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ ++++ +weight = 5 +[menu] + [menu.main] + parent = "x" ++++ diff --git a/archetypes/showcase.md b/archetypes/showcase.md new file mode 100644 index 0000000..f4c5aff --- /dev/null +++ b/archetypes/showcase.md @@ -0,0 +1,14 @@ +--- +date: 2013-07-01T07:32:00Z +description: "" +license: "" +licenseLink: "" +sitelink: http://spf13.com +sourceLink: http://github.com/spf13/spf13.com +tags: +- personal +- blog +thumbnail: /img/spf13-tn.jpg +title: spf13.com +--- + diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..90dc360 --- /dev/null +++ b/config.toml @@ -0,0 +1,66 @@ +baseurl = "http://gohugo.io" +MetaDataFormat = "yaml" + +[indexes] + tag = "tags" + group = "groups" + +[[menu.main]] + name = "Download Hugo" + pre = "" + url = "https://github.com/spf13/hugo/releases" + weight = -200 +[[menu.main]] + name = "Showcase" + pre = "" + url = "/showcase/" + weight = -180 +[[menu.main]] + name = "Discuss Hugo" + pre = "" + url = "http://discuss.gohugo.io" + weight = -150 +[[menu.main]] + name = "about hugo" + pre = "" + weight = -110 + identifier = "about" +[[menu.main]] + name = "getting started" + pre = "" + weight = -100 +[[menu.main]] + name = "content" + pre = "" + weight = -90 +[[menu.main]] + name = "themes" + pre = "" + weight = -85 +[[menu.main]] + name = "templates" + identifier = "layout" + pre = "" + weight = -80 +[[menu.main]] + name = "taxonomies" + identifier = "taxonomy" + pre = "" + weight = -70 +[[menu.main]] + name = "extras" + pre = "" + weight = -60 +[[menu.main]] + name = "tutorials" + pre = "" + weight = -40 +[[menu.main]] + name = "community" + pre = "" + weight = -50 +[[menu.main]] + parent = "community" + name = "Discussion Forum" + url = "http://discuss.gohugo.io" + weight = 150 diff --git a/content/community/contributing.md b/content/community/contributing.md new file mode 100644 index 0000000..687a730 --- /dev/null +++ b/content/community/contributing.md @@ -0,0 +1,67 @@ +--- +aliases: +- /doc/contributing/ +- /meta/contributing/ +date: 2013-07-01 +menu: + main: + parent: community +next: /tutorials/github_pages_blog +prev: /community/press +title: Contributing to Hugo +weight: 30 +--- + +All contributions to Hugo are welcome. Whether you want to scratch an itch, or simply contribute to the project, feel free to pick something from the roadmap +or contact [spf13](http://spf13.com) about what may make sense +to do next. + +You should fork the project and make your changes. *We encourage pull requests to discuss code changes.* + + +When you're ready to create a pull request, be sure to: + + * Have test cases for the new code. If you have questions about how to do it, please ask in your pull request. + * Run `go fmt` + * Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request. + * Make sure `go test ./...` passes, and `go build` completes. Our Travis CI loop will catch most things that are missing. The exception: Windows. We run on Windows from time to time, but if you have access, please check on a Windows machine too. + +## Contribution Overview + +1. Fork Hugo from https://github.com/spf13/hugo +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Commit passing tests to validate changes. +5. Run `go fmt` +6. Squash commits into a single (or logically grouped) commits (`git rebase -i`) +7. Push to the branch (`git push origin my-new-feature`) +8. Create new Pull Request + + +# Building from source + +## Clone locally (for contributors): + + git clone https://github.com/spf13/hugo + cd hugo + go get + +Because Go expects all of your libraries to be found in either +$GOROOT or $GOPATH, it's helpful to symlink the project to one +of the following paths: + + * ln -s /path/to/your/hugo $GOPATH/src/github.com/spf13/hugo + * ln -s /path/to/your/hugo $GOROOT/src/pkg/github.com/spf13/hugo + +## Running Hugo + + cd /path/to/hugo + go install github.com/spf13/hugo/hugo + go run main.go + +## Building Hugo + + cd /path/to/hugo + go build -o hugo main.go + mv hugo /usr/local/bin/ + diff --git a/content/community/mailing-list.md b/content/community/mailing-list.md new file mode 100644 index 0000000..4961b74 --- /dev/null +++ b/content/community/mailing-list.md @@ -0,0 +1,50 @@ +--- +date: 2013-07-01 +menu: + main: + parent: community +next: /community/press +prev: /extras/urls +title: Mailing List +weight: 10 +--- + +# Discussion Forum + +Hugo has its own [discussion forum](http://discuss.gohugo.io) powered by [Discourse](http://www.discourse.org/). + +Please use this for all discussions, questions, etc. + +# Mailing List + +Hugo has two mailing lists: + +## Announcements +Very low traffic. Only releases will be emailed here. + +https://groups.google.com/forum/#!forum/hugo-announce + +## Discussion (Archive) + +**This has been replaced with the [Hugo discussion forum](http://discuss.gohugo.io).** + +It is available for archival purposes. + +https://groups.google.com/forum/#!forum/hugo-discuss + + +# Other Resources + +## GoNuts + +For general Go questions or discussion please refer to the Go mailing list. + +https://groups.google.com/forum/#!forum/golang-nuts + +## GitHub Issues + +https://github.com/spf13/hugo/issues + +## Twitter + +Hugo doesn't have its own Twitter handle, but feel free to tweet [@spf13](http://twitter.com/spf13). diff --git a/content/community/press.md b/content/community/press.md new file mode 100644 index 0000000..b4029ad --- /dev/null +++ b/content/community/press.md @@ -0,0 +1,65 @@ +--- +date: 2014-03-24T20:00:00Z +linktitle: Press +menu: + main: + parent: community +next: /community/contributing +notoc: true +prev: /community/mailing-list +title: Press, Blogs and Media Coverage +weight: 20 +--- + +Hugo has been featured in the following Blog Posts, Press and Media. + + +| Title | Author | Date | +| ------ | ------ | -----: | +| [Hugo para crear sitios web estáticos](http://www.webbizarro.com/noticias/1076/hugo-para-crear-sitios-web-estaticos/) | Web Bizarro | 19 Aug 2014 | +| [Hello Hugo!](http://commiechink.com/2014/08/hello-hugo/) | Jason Yee | 19 Aug 2014 | +| [Going with hugo](http://www.markuseliasson.se/article/going-with-hugo/) | Markus Eliasson | 18 Aug 2014 | +| [Benchmarking Jekyll, Hugo and Wintersmith](http://www.internaldeployment.se/post/2014-08-12-Jekyll-and-its-alternatives-from-a-site-generation-point-of-view/) | Fredrik Loch | 12 Aug 2014 | +| [Goodbye Octopress, Hello Hugo!](http://andreimihu.com/blog/2014/08/11/goodbye-octopress-hello-hugo/) | Andrei Mihu | 11 Aug 2014 | +| [Beautiful sites for Open Source projects](http://beautifulopen.com/2014/08/09/hugo/) | Beautiful Open | 9 Aug 2014 | +| [Hugo: Beyond the Defaults](http://npf.io/2014/08/hugo-beyond-the-defaults/) | Nate Finch | 8 Aug 2014 | +| [First Impressions of Hugo](https://peteraba.com/blog/first-impressions-of-hugo/) | Peter Aba | 6 Aug 2014 | +| [New Site Workflow](http://vurt.co.uk/post/new_website/) | Giles Paterson | 5 Aug 2014 | +| [How I Learned to Stop Worrying and Love the (Static) Web](http://cognition.ca/post/about-hugo/) | Joshua McKenty | 4 Aug 2014 | +| [Hugo over Octopress](http://kennywoo.com/blog/hugo---golang-based-static-site-generator/) | Kenny Woo | 3 Aug 2014 | +| [Hugo Is Friggin' Awesome](http://npf.io/2014/08/hugo-is-awesome/) | Nate Finch | 1 Aug 2014 | +| [Embedding Gists in Hugo](http://danmux.com/posts/embedded_gists/) | Dan Mull | 5 July 2014 | +| [An Introduction To Hugo](http://www.cirrushosting.com/web-hosting-blog/an-introduction-to-hugo/) | Dan Silber | 1 July 2014 | +| [Moving to Hugo](http://danmux.com/posts/hugo_based_blog/) | Dan Mull | 29 May 2014 | +| [开源之静态站点生成器排行榜](http://code.csdn.net/news/2819909) | csdn.net | 23 May 2014 | +| [How I deploy this site using Fabric](http://carlorat.me/quote/fabric/) | Carlo Ratam | 21 May 2014 | +| [Finally, a satisfying and effective blog setup](http://michaelwhatcott.com/now-powered-by-hugo/) | Michael Whatcott | 20 May 2014 | +| [Hugo from scratch](http://zackofalltrades.com/notes/2014/05/hugo-from-scratch/) | Zack Williams | 18 May 2014 | +| [Why I switched away from Jekyll](http://www.jakejanuzelli.com/why-I-switched-away-from-jekyll/) | Jake Januzelli | 10 May 2014 | +| [Welcome our new blog](http://blog.ninya.io/posts/welcome-our-new-blog/) | Ninya.io | 11 Apr 2014 | +| [Mission Not Accomplished](http://johnsto.co.uk/blog/mission-not-accomplished/) | Dave Johnston | 3 Apr 2014 | +| [Hugo - A Static Site Builder in Go](http://deepfriedcode.com/post/hugo/) | Deep Fried Code | 30 Mar 2014 | +| [Adventures in Angular Podcast](http://devchat.tv/adventures-in-angular/003-aia-gdes) | Matias Niemela | 28 Mar 2014 | +| [Hugo](http://bra.am/post/hugo/) | bra.am | 23 Mar 2014 | +| [Converting Blogger To Markdown](http://trishagee.github.io/project/atom-to-hugo/) | Trisha Gee | 20 Mar 2014 | +| [Moving to Hugo Static Web Pages](http://tepid.org/tech/hugo-web/) | Tobias Weingartner | 16 Mar 2014 | +| [Hugo and Github Pages](http://sglyon.com/blog/2014/creating-the-site/) | Spencer Lyon | 15 Mar 2014 | +| [New Blog Engine: Hugo](https://blog.afoolishmanifesto.com/posts/hugo/) | fREW Schmidt | 15 Mar 2014 | +| [Hugo + gulp.js = Huggle](http://ktmud.github.io/huggle/intro/) | Jesse Yang | 8 Mar 2014 | +| [Powered by Hugo](http://kieranhealy.org/blog/archives/2014/02/24/powered-by-hugo/) | Kieran Healy | 24 Feb 2014 | +| [静的サイトを素早く構築するためにGoLangで作られたジェネレータHugo](http://hamasyou.com/blog/2014/02/21/hugo/) | Shogo Hamada | 21 Feb 2014 | +| [Latest Roundup of Useful Tools For Developers](http://codegeekz.com/latest-roundup-of-useful-tools-for-developers/) | CodeGeekz | 13 Feb 2014 | +| [Hugo: Static Site Generator written in Go](http://www.braveterry.com/2014/02/06/hugo-static-site-generator-written-in-go/) | Brave Terry | 6 Feb 2014 | +| [10 Useful HTML5 Tools for Web Designers and Developers](http://designdizzy.com/10-useful-html5-tools-for-web-designers-and-developers/) | Design Dizzy | 4 Feb 2014 | +| [Hugo – Fast, Flexible Static Site Generator](http://cube3x.com/hugo-fast-flexible-static-site-generator/) | Joby Joseph | 18 Jan 2014 | +| [Hugo: A new way to build static website](http://www.w3update.com/opensource/hugo-a-new-way-to-build-static-website.html) | w3update | 17 Jan 2014 | +| [Xaprb now uses Hugo](http://xaprb.com/blog/2014/01/15/using-hugo/) | Baron Schwartz | 15 Jan 2014 | +| [New jQuery Plugins And Resources That Web Designers Need](http://www.designyourway.net/blog/resources/new-jquery-plugins-and-resources-that-web-designers-need/) | Design Your Way | 2014 | +| [On Blog Construction](http://alexla.sh/post/on-blog-construction/) | Alexander Lash | 27 Dec 2013 | +| [Hugo](http://onethingwell.org/post/69070926608/hugo) | One Thing Well | 5 Dec 2013 | +| [In Praise Of Hugo](http://sound-guru.com/blog/post/hello-world/) | sound-guru.com | 19 Oct 2013 | +| [Hosting a blog on S3 and Cloudfront](http://www.danesparza.net/2013/07/hosting-a-blog-on-s3-and-cloudfront/) | Dan Esparza | 24 July 2013 | + +### Wrote a post, article or tutorial? + +Have you written a post, article or tutorial on hugo? Send us a pull request or issue with the addition. diff --git a/content/content/archetypes.md b/content/content/archetypes.md new file mode 100644 index 0000000..6878018 --- /dev/null +++ b/content/content/archetypes.md @@ -0,0 +1,75 @@ +--- +date: 2014-05-14T02:13:50Z +menu: + main: + parent: content +next: /content/ordering +prev: /content/types +title: Archetypes +weight: 50 +--- + +Hugo v0.11 introduced the concept of a content builder. Using the +command: `hugo new [relative new content path]` you can start a content file +with the date and title automatically set. This is a welcome feature, but +active writers need more. + +Hugo presents the concept of archetypes which are archetypal content files. + +## Example archetype + +In this example scenario I have a blog with a single content type (blog post). +I use ‘tags’ and ‘categories’ for my taxonomies. + +### archetypes/default.md + + +++ + tags = ["x", "y"] + categories = ["x", "y"] + +++ + + +## Using archetypes + +If I wanted to create a new post in the `posts` section, I would run the following command: + +`hugo new posts/my-new-post.md` + +Hugo would create the file with the following contents: + +### contents/posts/my-new-post.md + + +++ + title = "my new post" + date = 2014-05-14T02:13:50Z + tags = ["x", "y"] + categories = ["x", "y"] + +++ + + +## Using a different front matter format + +By default, the front matter will be created in the TOML format +regardless of what format the archetype is using. + +You can specify a different default format in your config file using +the `MetaDataFormat` directive. Possible values are `toml`, `yaml` and `json`. + + +## Which archetype is being used + +The following rules apply: + +* If an archetype with a filename that matches the content type being created, it will be used. +* If no match is found, `archetypes/default.md` will be used. +* If neither are present and a theme is in use, then within the theme: + * If an archetype with a filename that matches the content type being created, it will be used. + * If no match is found, `archetypes/default.md` will be used. +* If no archetype files are present, then the one that ships with Hugo will be used. + +Hugo provides a simple archetype which sets the title (based on the +file name) and the date based on `now()`. + +Content type is automatically detected based on the path. You are welcome to declare which +type to create using the `--kind` flag during creation. + diff --git a/content/content/example.md b/content/content/example.md new file mode 100644 index 0000000..ff00830 --- /dev/null +++ b/content/content/example.md @@ -0,0 +1,49 @@ +--- +aliases: +- /doc/example/ +date: 2013-07-01 +linktitle: Example +menu: + main: + parent: content +next: /themes/overview +notoc: true +prev: /content/ordering +title: Example Content File +weight: 70 +--- + +Some things are better shown than explained. The following is a very basic example of a content file: + +**mysite/project/nitro.md ← http://mysite.com/project/nitro.html** + + --- + Title: "Nitro : A quick and simple profiler for Go" + Description: "Nitro is a simple profiler for you go lang applications" + Tags: [ "Development", "Go", "profiling" ] + date: "2013-06-19" + Topics: [ "Development", "Go" ] + Slug: "nitro" + project_url: "http://github.com/spf13/nitro" + --- + + # Nitro + + Quick and easy performance analyzer library for Go. + + ## Overview + + Nitro is a quick and easy performance analyzer library for Go. + It is useful for comparing A/B against different drafts of functions + or different functions. + + ## Implementing Nitro + + Using Nitro is simple. First use go get to install the latest version + of the library. + + $ go get github.com/spf13/nitro + + Next include nitro in your application. + + diff --git a/content/content/front-matter.md b/content/content/front-matter.md new file mode 100644 index 0000000..c0ad151 --- /dev/null +++ b/content/content/front-matter.md @@ -0,0 +1,95 @@ +--- +aliases: +- /doc/front-matter/ +date: 2013-07-01 +menu: + main: + parent: content +next: /content/sections +prev: /content/organization +title: Front Matter +weight: 20 +--- + +The front matter is one of the features that gives Hugo its strength. It enables +you to include the meta data of the content right with it. Hugo supports a few +different formats, each with their own identifying tokens. + +Supported formats: + + * **YAML**, identified by '`---`'. + * **TOML**, identified with '`+++`'. + * **JSON**, a single JSON object which is surrounded by '`{`' and '`}`', each on their own line. + +### 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 + +### 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 + +### 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 + +## Variables + +There are a few predefined variables that Hugo is aware of and utilizes. The user can also create +any variable they want to. These will be placed into the `.Params` variable available to the templates. +Field names are always normalized to lowercase (e.g. `camelCase: true` is available as `.Params.camelcase`). + +### Required + +* **title** The title for the content +* **description** The description for the content +* **date** The date the content will be sorted by +* **taxonomies** These will use the field name of the plural form of the index (see tags and categories above) + +### Optional + +* **redirect** Mark the post as a redirect post +* **draft** If true, the content will not be rendered unless `hugo` is called with `--buildDrafts` +* **publishdate** If in the future, content will not be rendered unless `hugo` is called with `--buildFuture` +* **type** The type of the content (will be derived from the directory automatically if unset) +* **weight** Used for sorting +* **markup** (Experimental) Specify "rst" for reStructuredText (requires + `rst2html`,) or "md" (default) for the Markdown +* **slug** The token to appear in the tail of the URL + *or*
+* **url** The full path to the content from the web root.
+ +*If neither slug or url is present, the filename will be used.* + diff --git a/content/content/ordering.md b/content/content/ordering.md new file mode 100644 index 0000000..5190d77 --- /dev/null +++ b/content/content/ordering.md @@ -0,0 +1,39 @@ +--- +date: 2014-03-06 +linktitle: Ordering +menu: + main: + parent: content +next: /content/example +prev: /content/archetypes +title: Ordering Content +weight: 60 +--- + +Hugo provides you with all the flexibility you need to organize how your content is ordered. + +By default, content is ordered by weight, then by date with the most +recent date first, but alternative sorting (by `title` and `linktitle`) is +also available. The order the content would appear is specified in +the [list template](/templates/list). + +_Both the `date` and `weight` fields are optional._ + +Unweighted pages appear at the end of the list. If no weights are provided (or +if weights are the same), `date` will be used to sort. If neither is provided, +content will be ordered based on how it's read off the disk, and no order is +guaranteed. + +## Assigning weight to content + + +++ + weight = 4 + title = "Three" + date = "2012-04-06" + +++ + Front Matter with Ordered Pages 3 + + +## Ordering Content Within Taxonomies + +Please see the [Taxonomy Ordering Documentation](/taxonomies/ordering/). diff --git a/content/content/organization.md b/content/content/organization.md new file mode 100644 index 0000000..da52e09 --- /dev/null +++ b/content/content/organization.md @@ -0,0 +1,164 @@ +--- +aliases: +- /doc/organization/ +date: 2013-07-01 +linktitle: Organization +menu: + main: + parent: content +next: /content/front-matter +prev: /overview/source-directory +title: Content Organization +weight: 10 +--- + +Hugo uses markdown files with headers commonly called the front matter. Hugo +respects the organization that you provide for your content to minimize any +extra configuration, though this can be overridden by additional configuration +in the front matter. + +## Organization + +In Hugo the content should be arranged in the same way they are intended for +the rendered website. Without any additional configuration the following will +just work. Hugo supports content nested at any level. The top level is special +in Hugo and is used as the [section](/content/sections). + + . + └── 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/ + +**Here's the same organization run with hugo -\-uglyurls** + + . + └── content + ├── post + | ├── firstpost.md // <- http://1.com/post/firstpost.html + | ├── happy + | | └── ness.md // <- http://1.com/post/happy/ness.html + | └── secondpost.md // <- http://1.com/post/secondpost.html + └── quote + ├── first.md // <- http://1.com/quote/first.html + └── second.md // <- http://1.com/quote/second.html + +## Destinations + +Hugo thinks that you organize your content with a purpose. The same structure +that works to organize your source content is used to organize the rendered +site. As displayed above, the organization of the source content will be +mirrored in the destination. + +There are times when one would need more control over their content. In these +cases there are a variety of things that can be specified in the front matter to +determine the destination of a specific piece of content. + +The following items are defined in order, latter items in the list will override +earlier settings. + +### filename +This isn't in the front matter, but is the actual name of the file minus the +extension. This will be the name of the file in the destination. + +### slug +Defined in the front matter, the slug can take the place of the filename for the +destination. + +### filepath +The actual path to the file on disk. Destination will create the destination +with the same path. Includes [section](/content/sections). + +### section +section can be provided in the front matter overriding the section derived from +the source content location on disk. See [section](/content/sections). + +### path +path can be provided in the front matter. This will replace the actual +path to the file on disk. Destination will create the destination with the same +path. Includes [section](/content/sections). + +### url +A complete url can be provided. This will override all the above as it pertains +to the end destination. This must be the path from the baseurl (starting with a "/"). +When a url is provided it will be used exactly. Using url will ignore the +-\-uglyurls setting. + + +## Path breakdown in Hugo + +### Content + + . path slug + . ⊢-------^----⊣ ⊢------^-------⊣ + content/extras/indexes/category-example/index.html + + + . section slug + . ⊢--^--⊣ ⊢------^-------⊣ + content/extras/indexes/category-example/index.html + + + . section slug + . ⊢--^--⊣⊢--^--⊣ + content/extras/indexes/index.html + +### Destination + + + permalink + ⊢--------------^-------------⊣ + http://spf13.com/projects/hugo + + + baseUrl section slug + ⊢-----^--------⊣ ⊢--^---⊣ ⊢-^⊣ + http://spf13.com/projects/hugo + + + baseUrl section slug + ⊢-----^--------⊣ ⊢--^--⊣ ⊢--^--⊣ + http://spf13.com/extras/indexes/example + + + baseUrl path slug + ⊢-----^--------⊣ ⊢------^-----⊣ ⊢--^--⊣ + http://spf13.com/extras/indexes/example + + + baseUrl url + ⊢-----^--------⊣ ⊢-----^-----⊣ + http://spf13.com/projects/hugo + + + baseUrl url + ⊢-----^--------⊣ ⊢--------^-----------⊣ + http://spf13.com/extras/indexes/example + + + +**section** = which type the content is by default + +* based on content location +* front matter overrides + +**slug** = name.ext or name/ + +* based on content-name.md +* front matter overrides + +**path** = section + path to file excluding slug + +* based on path to content location + + +**url** = relative URL + +* defined in front matter +* overrides all the above + diff --git a/content/content/sections.md b/content/content/sections.md new file mode 100644 index 0000000..72d7464 --- /dev/null +++ b/content/content/sections.md @@ -0,0 +1,51 @@ +--- +date: 2013-07-01 +menu: + main: + parent: content +next: /content/types +notoc: true +prev: /content/front-matter +title: Sections +weight: 30 +--- + +Hugo thinks that you organize your content with a purpose. The same structure +that works to organize your source content is used to organize the rendered +site (see [Organization](/content/organization)). Following this pattern Hugo +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/ + + +## Section Lists + +Hugo will automatically create pages for each section root that list all +of the content in that section. See [List Templates](/templates/list) +for details on customizing the way they appear. + +## Sections and Types + +By default everything created within a section will use the content type +that matches the section name. + +Section defined in the front matter have the same impact. + +To change the type of a given piece of content, simply define the type +in the front matter. + +If a layout for a given type hasn't been provided, a default type template will +be used instead provided it exists. + + diff --git a/content/content/types.md b/content/content/types.md new file mode 100644 index 0000000..ef259d2 --- /dev/null +++ b/content/content/types.md @@ -0,0 +1,76 @@ +--- +date: 2013-07-01 +linktitle: Types +menu: + main: + parent: content +next: /content/archetypes +prev: /content/sections +title: Content Types +weight: 40 +--- + +Hugo has full support for different types of content. A content type can have a +unique set of meta data, template and can be automatically created by the new +command through using content [archetypes](/content/archetypes). + +A good example of when multiple types are needed is to look at [Tumblr](https://www.tumblr.com/). A piece +of content could be a photo, quote or post, each with different meta data and +rendered differently. + +## Assigning a content type + +Hugo assumes that your site will be organized into [sections](/content/sections) +and each section will use the corresponding type. If you are taking advantage of +this, then each new piece of content you place into a section will automatically +inherit the type. + +Alternatively you can set the type in the meta data under the key "type". + + +## Creating new content of a specific type + +Hugo has the ability to create a new content file and populate the front matter +with the data set corresponding to that type. Hugo does this by utilizing +[archetypes](/content/archetypes). + +To create a new piece of content, use: + + hugo new relative/path/to/content.md + +For example, if I wanted to create a new post inside the post section, I would type: + + hugo new post/my-newest-post.md + + +## Defining a content type + +Creating a new content type is easy in Hugo. You simply provide the templates and archetype +that the new type will use. You only need to define the templates, archetypes and/or views +unique to that content type. Hugo will fall back to using the general templates and default archetype +whenever a specific file is not present. + +*Remember, all of the following are optional:* + +### Create Type Directory +Create a directory with the name of the type in layouts. Type is always singular. *Eg /layouts/post*. + +### Create single template +Create a file called single.html inside your directory. *Eg /layouts/post/single.html*. + +### Create list template +Create a file called list.html inside your directory. *Eg /layouts/post/list.html*. + +### Create views +Many sites support rendering content in a few different ways, for +instance a single page view and a summary view to be used when displaying a list +of contents on a single page. Hugo makes no assumptions here about how you want +to display your content, and will support as many different views of a content +type as your site requires. All that is required for these additional views is +that a template exists in each layout/type directory with the same name. + +### Create a corresponding archetype + +Create a file called `type`.md in the /archetypes directory *Eg /archetypes/post.md*. + +More details about archetypes can be found at the [archetypes docs](/content/archetypes) diff --git a/content/extras/aliases.md b/content/extras/aliases.md new file mode 100644 index 0000000..1822135 --- /dev/null +++ b/content/extras/aliases.md @@ -0,0 +1,40 @@ +--- +aliases: +- /doc/redirects/ +- /doc/alias/ +- /doc/aliases/ +date: 2013-07-09 +menu: + main: + parent: extras +next: /extras/builders +prev: /taxonomies/ordering +title: Aliases +weight: 10 +--- + +For people migrating existing published content to Hugo, there's a good chance +you need a mechanism to handle redirecting old URLs. + +Luckily, this can be handled easily with aliases in Hugo. + +## Example +**content/posts/my-awesome-blog-post.md** + + --- + aliases: + - /posts/my-original-url/ + - /2010/even-earlier-url.html + --- + +Now when you go to any of the aliases locations, they +will redirect to the page. + +## 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.* + +2. *Aliases are rendered prior to any content and will be overwritten by +any content with the same location.* diff --git a/content/extras/builders.md b/content/extras/builders.md new file mode 100644 index 0000000..ce6854d --- /dev/null +++ b/content/extras/builders.md @@ -0,0 +1,60 @@ +--- +date: 2014-05-26 +linktitle: Builders +menu: + main: + parent: extras +next: /extras/comments +prev: /extras/aliases +title: Hugo Builders +weight: 12 +--- + +Hugo provides the functionality to quickly get a site, theme or page +started. + + +## New Site + +Want to get a site built quickly? + + hugo new site /path/to/site + +Hugo will create all the needed directories and files to get started +quickly. + +Hugo will only touch the files and create the directories (in the right +places), [configuration](/overview/configuration) and content are up to +you... but luckily we have builders for content (see below). + +## New Theme + +Want to design a new theme? + + hugo new theme `THEME_NAME` + +Run from your working directory, this will create a new theme with all +the needed files in your themes directory. Hugo will provide you with a +license and theme.toml file with most of the work done for you. + +Follow the [Theme Creation Guide](/themes/creation) once the builder is +done. + +## New Content + +You will use this builder the most of all. Every time you want to create +a new piece of content, the content builder will get you started right. + +Leveraging [content archetypes](/content/archetypes) the content builder +will not only insert the current date and appropriate metadata, but it +will pre-populate values based on the content type. + + hugo new relative/path/to/content + +This assumes it is being run from your working directory and the content +path starts from your content directory. + +I typically keep two different terminals open, one to run `hugo server +--watch`, and another to use the builders to create new content. + + diff --git a/content/extras/comments.md b/content/extras/comments.md new file mode 100644 index 0000000..c11c2ec --- /dev/null +++ b/content/extras/comments.md @@ -0,0 +1,100 @@ +--- +date: 2014-05-26 +linktitle: Comments +menu: + main: + parent: extras +next: /extras/livereload +prev: /extras/builders +title: Comments in Hugo +weight: 14 +--- + +As Hugo is a static site generator, the content produced is static and +doesn’t interact with the users. The most common interaction people ask +for is comment capability. + +Hugo ships with support for [Disqus](http://disqus.com), a third-party +service that provides comment and community capabilities to website via +JavaScript. + +Your theme may already support Disqus, but even it if doesn’t, it is easy +to add. + +# Disqus Support + +## Adding Disqus to a template + +Hugo comes with all the code you would need to include load Disqus. +Simply include the following line where you want your comments to appear: + + {{ template "_internal/disqus.html" . }} + + +## Configuring Disqus + +That template requires you to set a single value in your site config file, e.g. config.yaml. + + disqusShortname = "XYW" + +Additionally, you can optionally set the following in the front matter +for a given piece of content: + + * **disqus_identifier** + * **disqus_title** + * **disqus_url** + + +## Conditional Loading of Disqus Comments + +Users have noticed that enabling Disqus comments when running the Hugo web server on localhost causes the creation of unwanted discussions on the associated Disqus account. In order to prevent this, a slightly tweaked partial template is required. So, rather than using the built-in `"_internal/disqus.html"` template referenced above, create a template in your `partials` folder that looks like this: + +```javascript +
+ + +comments powered by Disqus +``` + +Notice that there is a simple `if` statement that detects when you are running on localhost and skips the initialization of the Disqus comment injection. + +Now, reference the partial template from your page template: + + {{ partial "disqus.html" . }} + + +# Alternatives + +A few alternatives exist to [Disqus](http://disqus.com): + +* [Intense Debate](http://intensedebate.com/) +* [LiveFyre](http://livefyre.com/) +* [Moot](http://muut.com) +* [多说](http://duoshuo.com/) ([Duoshuo](http://duoshuo.com/), popular in China) +* [Kaiju](http://github.com/spf13/kaiju) + + +[Kaiju](http://github.com/spf13/kaiju) is an open-source project started +by [spf13](http://spf13.com) (Hugo’s author) to bring easy and fast real +time discussions to the web. + +Written using Go, Socket.io and MongoDB, it is very fast and easy to +deploy. + +It is in early development but shows promise. If you have interest, +please help by contributing whether via a pull request, an issue or even +just a tweet. Everything helps. + diff --git a/content/extras/highlighting.md b/content/extras/highlighting.md new file mode 100644 index 0000000..a90a724 --- /dev/null +++ b/content/extras/highlighting.md @@ -0,0 +1,102 @@ +--- +aliases: +- /extras/highlight/ +date: 2013-07-01 +menu: + main: + parent: extras +next: /extras/toc +prev: /extras/shortcodes +title: Syntax Highlighting +weight: 50 +--- + +Hugo provides the ability for you to highlight source code in two different +ways — either pre-processed server side from your content, or to defer +the processing to the client side, using a JavaScript library. The advantage of +server side is that it doesn’t depend on a JavaScript library and consequently +works very well when read from an RSS feed. The advantage of client side is that +it doesn’t cost anything when building your site and some of the highlighting +scripts available cover more languages than Pygments does. + +For the pre-processed approach, Highlighting is performed by an external +Python-based program called [Pygments](http://pygments.org) and is triggered +via an embedded shortcode. If Pygments is absent from the path, it will +silently simply pass the content along unhighlighted. + +## Server-side + +### Disclaimers + + * **Warning:** Pygments is relatively slow. Expect much longer build times when using server-side highlighting. + * Languages available depends on your Pygments installation. + * Styles are inline in order to be supported in syndicated content when references +to style sheets are not carried over. + * We have sought to have the simplest interface possible, which consequently +limits configuration. An ambitious user is encouraged to extend the current +functionality to offer more customization. +* You can change appearance with config options `pygmentsstyle`(default +`"monokai"`) and `pygmentsuseclasses`(defaut `false`). + +### Usage +Highlight takes exactly one required parameter of language and requires a +closing shortcode. + +### Example +The example has an extra space between the “{{” and “%” characters to prevent rendering here. + + {{ % highlight html %}} +
+
+

{{ .Title }}

+ {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
+
+ {{ % /highlight %}} + + +### Example Output + + <section id="main"> + <div> + <h1 id="title">{{ .Title }}</h1> + {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} + </div> + </section> + +## Client-side + +Alternatively, code highlighting can be done in client-side JavaScript. + +Client-side syntax highlighting is very simple to add. You'll need to pick +a library and a corresponding theme. Some popular libraries are: + +- [Highlight.js] +- [Rainbow] +- [Syntax Highlighter] +- [Google Prettify] + +This example uses the popular [Highlight.js] library, hosted by [Yandex], a +popular Russian search engine. + +In your `./layouts/partials/` (or `./layouts/chrome/`) folder, depending on your specific theme, there +will be a snippet that will be included in every generated HTML page, such +as `header.html` or `header.includes.html`. Simply add: + + + + + +You can of course use your own copy of these files, typically in `./static/`. + +[Highlight.js]: http://highlightjs.org/ +[Rainbow]: http://craig.is/making/rainbows +[Syntax Highlighter]: http://alexgorbatchev.com/SyntaxHighlighter/ +[Google Prettify]: https://code.google.com/p/google-code-prettify/ +[Yandex]: http://yandex.ru/ + +Please see individual libraries documentation for how to implement the JavaScript-based libraries. diff --git a/content/extras/livereload.md b/content/extras/livereload.md new file mode 100644 index 0000000..aded2d0 --- /dev/null +++ b/content/extras/livereload.md @@ -0,0 +1,61 @@ +--- +date: 2014-05-26 +menu: + main: + parent: extras +next: /extras/menus +prev: /extras/comments +title: Live Reload +weight: 15 +--- + +Hugo may not be the first static site generator to utilize live reload +technology, but it’s the first to do it right. + +The combination of Hugo’s insane build speed and live reload make +crafting your content pure joy. Virtually instantly after you hit save +your rebuilt content will appear in your browser. + +## Using livereload + +Hugo comes with livereload built in. There are no additional packages to +install. A common way to use hugo while developing a site is to have +hugo run a server and watch for changes. + + hugo server --watch + +This will run a full functioning web server while simultaneously +watching your file system for additions, deletions or changes within +your: + + * static files + * content + * layouts + * current theme + +Whenever anything changes Hugo will rebuild the site, continue to serve +the content and as soon as the build is finished it will tell the +browser and silently reload the page. Because most hugo builds are so +fast they are barely noticeable, you merely need to glance at your open +browser and you will see the change already there. + +This means that keeping the site open on a second monitor (or another +half of your current monitor), allows you to see exactly what your +content looks like without even leaving your text editor. + +## Disabling livereload + +Live reload accomplishes this by injecting javascript into the pages it +creates that creates a web socket client to the hugo web socket server. + +Awesome for development, but not something you would want to do in +production. Since many people use `hugo server --watch` in production to +instantly display any updated content, we’ve made it easy to disable the +live reload functionality. + + hugo server --watch --disableLiveReload + + + + + diff --git a/content/extras/menus.md b/content/extras/menus.md new file mode 100644 index 0000000..57d87c0 --- /dev/null +++ b/content/extras/menus.md @@ -0,0 +1,178 @@ +--- +date: 2014-05-14T02:36:37Z +menu: + main: + parent: extras +next: /extras/permalinks +prev: /extras/livereload +title: Menus +weight: 20 +--- + +Hugo has a simple yet powerful menu system that permits content to be +placed in menus with a good degree of control without a lot of work. + +Some of the features of Hugo Menus: + +* Place content in one or many menus +* Handle nested menus with unlimited depth +* Create menu entries without being attached to any content +* Distinguish active element (and active branch) + +## What is a menu? + +A menu is a named array of menu entries accessible on the site under +`.Site.Menus` by name. For example, if I have a menu called `main`, I would +access it via `.Site.Menus.main`. + +A menu entry has the following properties: + +* **Url** string +* **Name** string +* **Menu** string +* **Identifier** string +* **Pre** template.HTML +* **Post** template.HTML +* **Weight** int +* **Parent** string +* **Children** Menu + +And the following functions: + +* **HasChildren** bool + +Additionally there are some relevant functions available on the page: + +* **IsMenuCurrent** (menu string, menuEntry *MenuEntry ) bool +* **HasMenuCurrent** (menu string, menuEntry *MenuEntry) bool + + +## Adding content to menus + +Hugo supports a couple of different methods of adding a piece of content +to the front matter. + +### Simple + +If all you need to do is add an entry to a menu, the simple form works +well. + +**A single menu:** + + --- + menu: "main" + --- + +**Multiple menus:** + + --- + menu: ["main", "footer"] + --- + + +### Advanced + +If more control is required, then the advanced approach gives you the +control you want. All of the menu entry properties listed above are +available. + + --- + menu: + main: + parent: 'extras' + weight: 20 + --- + + +## Adding (non-content) entries to a menu + +You can also add entries to menus that aren’t attached to a piece of +content. This takes place in the sitewide [config file](/overview/configuration). + +Here’s an example (in TOML): + + [[menu.main]] + name = "about hugo" + pre = "" + weight = -110 + identifier = "about" + [[menu.main]] + name = "getting started" + pre = "" + weight = -100 + +Here’s an example (in YAML): + + --- + menu: + main: + - Name: "about hugo" + Pre: "" + Weight: -110 + Identifier: "about" + - Name: "getting started" + Pre: "" + Weight: -100 + --- + +## Nesting + +All nesting of content is done via the `parent` field. + +The parent of an entry should be the identifier of another entry. +Identifier should be unique (within a menu). + +The following order is used to determine identity Identifier > Name > +LinkTitle > Title. This means that the title will be used unless +linktitle is present, etc. In practice Name and Identifier are never +displayed and only used to structure relationships. + +In this example, the top level of the menu is defined in the config file +and all content entries are attached to one of these entries via the +`parent` field. + +## Rendering menus + +Hugo makes no assumptions about how your rendered HTML will be +structured. Instead, it provides all of the functions you will need to be +able to build your menu however you want. + + +The following is an example: + + + + diff --git a/content/extras/permalinks.md b/content/extras/permalinks.md new file mode 100644 index 0000000..ed95612 --- /dev/null +++ b/content/extras/permalinks.md @@ -0,0 +1,53 @@ +--- +aliases: +- /doc/permalinks/ +date: 2013-11-18 +menu: + main: + parent: extras +next: /extras/shortcodes +notoc: true +prev: /extras/menus +title: Permalinks +weight: 30 +--- + +By default, content is laid out into the target `publishdir` (public) +namespace matching its layout within the `contentdir` hierarchy. +The `permalinks` site configuration option allows you to adjust this on a +per-section basis. +This will change where the files are written to and will change the page's +internal "canonical" location, such that template references to +`.RelPermalink` will honour the adjustments made as a result of the mappings +in this option. + +For instance, if one of your sections is called `post`, and you want to adjust +the canonical path to be hierarchical based on the year and month, then you +might use: + +```yaml +permalinks: + post: /:year/:month/:title/ +``` + +Only the content under `post/` will be so rewritten. +A file named `content/post/sample-entry` which contains a line +`date: 2013-11-18T19:20:00-05:00` might end up with the rendered page +appearing at `public/2013/11/sample-entry/index.html` and be reachable via +the URL . + +The following is a list of values that can be used in a permalink definition. +All references to time are dependent on the content's date. + + * **:year** the 4-digit year + * **:month** the 2-digit month + * **:monthname** the name of the month + * **:day** the 2-digit day + * **:weekday** the 1-digit day of the week (Sunday = 0) + * **:weekdayname** the name of the day of the week + * **:yearday** the 1- to 3-digit day of the year + * **:section** the content's section + * **:title** the content's title + * **:slug** the content's slug (or title if no slug) + * **:filename** the content's filename (without extension) + diff --git a/content/extras/shortcodes.md b/content/extras/shortcodes.md new file mode 100644 index 0000000..e1b72d3 --- /dev/null +++ b/content/extras/shortcodes.md @@ -0,0 +1,237 @@ +--- +aliases: +- /doc/shortcodes/ +date: 2013-07-01 +menu: + main: + parent: extras +next: /extras/highlighting +prev: /extras/permalinks +title: Shortcodes +weight: 40 +--- + +Hugo uses Markdown for its simple content format. However, there’s a lot +of things that Markdown doesn’t support well. + +We are unwilling to accept being constrained by our simple format. Also +unacceptable is writing raw HTML in our Markdown every time we want to include +unsupported content such as a video. To do so is in complete opposition to the +intent of using a bare bones format for our content and utilizing templates to +apply styling for display. + +To avoid both of these limitations, Hugo created shortcodes. + +A shortcode is a simple snippet inside a content file that Hugo will render +using a predefined template. Note that shortcodes will not work in template +files---if you need a functionality like that in a template, you most likely +want a [partial template](/templates/partial) instead. + +## Using a shortcode + +In your content files, a shortcode can be called by using '`{{% name parameters +%}}`' respectively. Shortcodes are space delimited (parameters with spaces +can be quoted). + +The first word is always the name of the shortcode. Parameters follow the name. +The format for named parameters models that of HTML with the format +`name="value"`. The current implementation only supports this exact format. Extra +spaces or different quotation marks will not parse properly. + +Some shortcodes use or require closing shortcodes. Like HTML, the opening and closing +shortcodes match (name only), the closing being prepended with a slash. + +Example of a paired shortcode: + + {{ % highlight go %}} A bunch of code here {{ % /highlight %}} + + +## Hugo Shortcodes + +Hugo ships with a set of predefined shortcodes. + +### highlight + +This shortcode will convert the source code provided into syntax highlighted +HTML. Read more on [highlighting](/extras/highlighting). + +#### Usage +`highlight` takes exactly one required parameter of _language_ and requires a +closing shortcode. + +#### Example +The example has an extra space between the “`{{`” and “`%`” characters to prevent rendering here. + + {{ % highlight html %}} +
+
+

{{ .Title }}

+ {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} +
+
+ {{ % /highlight %}} + + +#### Example Output + + <section id="main"> + <div> + <h1 id="title">{{ .Title }}</h1> + {{ range .Data.Pages }} + {{ .Render "summary"}} + {{ end }} + </div> + </section> + +### figure +`figure` is simply an extension of the image capabilities present with Markdown. +`figure` provides the ability to add captions, CSS classes, alt text, links etc. + +#### Usage + +`figure` can use the following parameters: + + * src + * link + * title + * caption + * attr (attribution) + * attrlink + * alt + +#### Example +*Example has an extra space so Hugo doesn’t actually render it*. + + {{ % figure src="/media/spf13.jpg" title="Steve Francia" %}} + +#### Example output + +
+ +
+

Steve Francia

+
+
+ +## Creating your own shortcodes + +To create a shortcode, place a template in the layouts/shortcodes directory. The +template name will be the name of the shortcode. + +In creating a shortcode, you can choose if the shortcode will use _positional +parameters_ or _named parameters_ (but not both). A good rule of thumb is that if a +shortcode has a single required value in the case of the `youtube` example below, +then positional works very well. For more complex layouts with optional +parameters, named parameters work best. + +**Inside the template** + +To access a parameter by position, the `.Get` method can be used: + + {{ .Get 0 }} + +To access a parameter by name, the `.Get` method should be utilized: + + {{ .Get "class" }} + +`with` is great when the output depends on a parameter being set: + + {{ with .Get "class"}} class="{{.}}"{{ end }} + +`.Get` can also be used to check if a parameter has been provided. This is +most helpful when the condition depends on either one value or another... +or both: + + {{ or .Get "title" | .Get "alt" | if }} alt="{{ with .Get "alt"}}{{.}}{{else}}{{.Get "title"}}{{end}}"{{ end }} + +If a closing shortcode is used, the variable `.Inner` will be populated with all +of the content between the opening and closing shortcodes. If a closing +shortcode is required, you can check the length of `.Inner` and provide a warning +to the user. + +The variable `.Params` contains the list of parameters in case you need to do more complicated things than `.Get`. + +You can also use the variable `.Page` to access all the normal [Page Variables](/templates/variables/). + +## Single Positional Example: youtube + + {{% youtube 09jf3ow9jfw %}} + +Would load the template /layouts/shortcodes/youtube.html + +
+ +
+ +This would be rendered as: + +
+ +
+ +## Single Named Example: image with caption +*Example has an extra space so Hugo doesn’t actually render it* + + {{ % img src="/media/spf13.jpg" title="Steve Francia" %}} + +Would load the template /layouts/shortcodes/img.html + + +
+ {{ with .Get "link"}}{{ end }} + + {{ if .Get "link"}}{{ end }} + {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} +
{{ if isset .Params "title" }} +

{{ .Get "title" }}

{{ end }} + {{ if or (.Get "caption") (.Get "attr")}}

+ {{ .Get "caption" }} + {{ with .Get "attrlink"}} {{ end }} + {{ .Get "attr" }} + {{ if .Get "attrlink"}} {{ end }} +

{{ end }} +
+ {{ end }} +
+ + +Would be rendered as: + +
+ +
+

Steve Francia

+
+
+ +## Paired Example: Highlight +*Hugo already ships with the `highlight` shortcode* + +*Example has an extra space so Hugo doesn’t actually render it*. + + + This HTML + + +The template for this utilizes the following code (already include in Hugo) + + {{ .Get 0 | highlight .Inner }} + +And will be rendered as: + +
<html>
+        <body> This HTML </body>
+    </html>
+    
+ +Please notice that this template makes use of a Hugo-specific template function +called `highlight` which uses Pygments to add the highlighting code. + +More shortcode examples can be found at [spf13.com](https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes). diff --git a/content/extras/toc.md b/content/extras/toc.md new file mode 100644 index 0000000..68376e1 --- /dev/null +++ b/content/extras/toc.md @@ -0,0 +1,37 @@ +--- +date: 2013-07-09 +menu: + main: + parent: extras +next: /extras/urls +prev: /extras/highlighting +title: Table of Contents +weight: 60 +--- + +Hugo will automatically parse the Markdown for your content and create +a Table of Contents you can use to guide readers to the sections within +your content. + +## Usage + +Simply create content like you normally would with the appropriate +headers. + +Hugo will take this Markdown and create a table of contents stored in the +[content variable](/layout/variables) `.TableOfContents` + + +## Template Example + +This is example code of a [single.html template](/layout/content). + + {{ partial "header.html" . }} +
+ {{ .TableOfContents }} +
+

{{ .Title }}

+ {{ .Content }} + {{ partial "footer.html" . }} + + diff --git a/content/extras/urls.md b/content/extras/urls.md new file mode 100644 index 0000000..7bfaf33 --- /dev/null +++ b/content/extras/urls.md @@ -0,0 +1,45 @@ +--- +aliases: +- /doc/urls/ +date: 2014-01-03 +menu: + main: + parent: extras +next: /community/mailing-list +notoc: true +prev: /extras/toc +title: URLs +weight: 70 +--- + +## Pretty URLs + +By default Hugo will create content with 'pretty' URLs. For example +content created at /content/extras/urls.md will be rendered at +/content/extras/urls/index.html and accessible at /content/extras/urls. No +no standard server side configuration is required for these pretty urls to +work. + +If you would like to have ugly URLs, you are in luck. Hugo supports the +ability to create your entire site with ugly URLs. Simply use the +`--uglyUrls=true` flag on the command line. + +If you want a specific piece of content to have an exact URL, you can +specify this in the front matter under the url key. See [Content +Organization](/content/organization/) for more details. + +## Canonicalization + +By default, all relative URLs encountered in the input will be canonicalized +using `baseurl`, so that a link `/css/foo.css` becomes +`http://yoursite.example.com/css/foo.css`. + +Setting `canonifyurls` to `false` will prevent this canonicalization. + +Benefits of canonicalization include fixing all URLs to be absolute, which may +aid with some parsing tasks. Note though that all real browsers handle this +client-side without issues. + +Benefits of non-canonicalization include being able to have resource inclusion +be scheme-relative, so that http vs https can be decided based on how this +page was retrieved. diff --git a/content/meta/license.md b/content/meta/license.md new file mode 100644 index 0000000..5e71de6 --- /dev/null +++ b/content/meta/license.md @@ -0,0 +1,78 @@ +--- +aliases: +- /doc/license/ +- /license/ +- /meta/license/ +date: 2013-07-01 +menu: + main: + parent: about +title: License +weight: 50 +--- + +Hugo is released under the Simple Public License. + +## Simple Public License (SimPL-2.0) + +### Preamble + +This Simple Public License 2.0 (SimPL-2.0 for short) is a plain language +implementation of GPL 2.0. The words are different, but the goal is the +same - to guarantee for all users the freedom to share and change +software. If anyone wonders about the meaning of the SimPL, they should +interpret it as consistent with GPL 2.0. + + +## Simple Public License (SimPL) 2.0 + +The SimPL applies to the software's source and object code and comes +with any rights that I have in it (other than trademarks). You agree to +the SimPL by copying, distributing, or making a derivative work of the +software. + + You get the royalty free right to: + +- Use the software for any purpose; +- Make derivative works of it (this is called a "Derived Work"); +- Copy and distribute it and any Derived Work. + +If you distribute the software or a Derived Work, you must give back to +the community by: + +- Prominently noting the date of any changes you make; +- Leaving other people's copyright notices, warranty disclaimers, and + license terms in place; +- Providing the source code, build scripts, installation scripts, and + interface definitions in a form that is easy to get and best to + modify; +- Licensing it to everyone under SimPL, or substantially similar terms + (such as GPL 2.0), without adding further restrictions to the rights + provided; +- Conspicuously announcing that it is available under that license. + +There are some things that you must shoulder: + +- You get NO WARRANTIES. None of any kind; +- If the software damages you in any way, you may only recover direct + damages up to the amount you paid for it (that is zero if you did + not pay anything). You may not recover any other damages, including + those called "consequential damages." (The state or country where + you live may not allow you to limit your liability in this way, so + this may not apply to you); + +The SimPL continues perpetually, except that your license rights end +automatically if: + +- You do not abide by the "give back to the community" terms (your + licensees get to keep their rights if they abide); +- Anyone prevents you from distributing the software under the terms + of the SimPL. + +## License for the License + +You may do anything that you want with the SimPL text; it's a license +form to use in any way that you find helpful. To avoid confusion, +however, if you change the terms in any way then you may not call your +license the Simple Public License or the SimPL (but feel free to +acknowledge that your license is "based on the Simple Public License"). diff --git a/content/meta/release-notes.md b/content/meta/release-notes.md new file mode 100644 index 0000000..e26d7d7 --- /dev/null +++ b/content/meta/release-notes.md @@ -0,0 +1,139 @@ +--- +aliases: +- /doc/release-notes/ +- /meta/release-notes/ +date: 2013-07-01 +menu: + main: + parent: about +title: Release Notes +weight: 10 +--- + +## **0.12.0** Sept 1, 2014 + +A lot has happened since Hugo v0.11.0 was released. Most of the work has been +focused on polishing the theme engine and adding critical functionality to the +templates. + +This release represents over 90 code commits from 28 different contributors. + + * 10 [new themes](https://github.com/spf13/hugoThemes) created by the community + * Fully themable [Partials](/templates/partials) + * [404 template](/templates/404/) support in themes + * [Shortcode](/extras/shortcodes/) support in themes + * [Views](/templates/views/) support in themes + * Inner [shortcode](/extras/shortcodes/) content now treated as Markdown + * Support for header ids in Markdown (# Header {#myid}) + * [Where](/templates/list) template function to filter lists of content, taxonomies, etc + * [GroupBy](/templates/list) & [GroupByDate](/templates/list) methods to group pages + * Taxonomy [pages list](/taxonomies/methods/) now sortable, filterable, limitable & groupable + * General cleanup to taxonomies & documentation to make it more clear and consistent + * [Showcase](/showcase/) returned and has been expanded + * Pretty links now always have trailing slashes + * [BaseUrl](/overview/configuration/) can now include a subdirectory + * Better feedback about draft & future post rendering + * A variety of improvements to [the website](http://gohugo.io) + +## **0.11.0** May 28, 2014 + +This release represents over 110 code commits from 29 different contributors. + + * Considerably faster... about 3 - 4x faster on average + * [Live Reload](/extras/livereload). Hugo will automatically reload the browser when the build is complete + * Theme engine w/[Theme Repository](http://github.com/spf13/hugoThemes) + * [Menu system](/extras/menus) with support for active page + * [Builders](/extras/builders) to quickly create a new site, content or theme + * [XML sitemap](/templates/sitemap) generation + * [Integrated Disqus](/extras/comments) support + * Streamlined [template organization](/templates/overview) + * [Brand new docs site](http://gohugo.io) + * Support for publishDate which allows for posts to be dated in the future + * More [sort](/content/ordering) options + * Logging support + * Much better error handling + * More informative verbose output + * Renamed Indexes > [Taxonomies](/taxonomies/overview) + * Renamed Chrome > [Partials](/templates/partials) + +## **0.10.0** March 1, 2014 + +This release represents over 110 code commits from 29 different contributors. + + * [Syntax highlighting](/extras/highlighting) powered by pygments (**slow**) + * Ability to [sort content](/content/ordering) many more ways + * Automatic [table of contents](/extras/toc) generation + * Support for unicode urls, aliases and indexes + * Configurable per-section [permalink](/extras/permalinks) pattern support + * Support for [paired shortcodes](/extras/shortcodes) + * Shipping with some [shortcodes](/extras/shortcodes) (highlight & figure) + * Adding [canonify](/extras/urls) option to keep urls relative + * A bunch of [additional template functions](/layout/functions) + * Watching very large sites now works on mac + * RSS generation improved. Limited to 50 items by default, can limit further in [template](/layout/rss) + * Boolean params now supported in [frontmatter](/content/front-matter) + * Launched website [showcase](/showcase). Show off your own hugo site! + * A bunch of [bug fixes](https://github.com/spf13/hugo/commits/master) + +## **0.9.0** November 15, 2013 + +This release represents over 220 code commits from 22 different contributors. + + * New [command based interface](/overview/usage) similar to git (hugo server -s ./ ) + * Amber template support + * [Aliases](/extras/aliases) (redirects) + * Support for top level pages (in addition to homepage) + * Complete overhaul of the documentation site + * Full Windows support + * Better index support including [ordering by content weight](/content/ordering) + * Add params to site config, available in .Site.Params from templates + * Friendlier json support + * Support for html & xml content (with frontmatter support) + * Support for [summary](/content/summaries) content divider (<!–more–>) + * HTML in [summary](/content/summaries) (when using divider) + * Added ["Minutes to Read"](/layout/variables) functionality + * Support for a custom 404 page + * Cleanup of how content organization is handled + * Loads of unit and performance tests + * Integration with travis ci + * Static directory now watched and copied on any addition or modification + * Support for relative permalinks + * Fixed watching being triggered multiple times for the same event + * Watch now ignores temp files (as created by Vim) + * Configurable number of posts on [homepage](/layout/homepage/) + * [Front matter](/content/front-matter) supports multiple types (int, string, date, float) + * Indexes can now use a default template + * Addition of truncated bool to content to determine if should show 'more' link + * Support for [linkTitles](/layout/variables) + * Better handling of most errors with directions on how to resolve + * Support for more date / time formats + * Support for go 1.2 + * Support for `first` in templates + +## **0.8.0** August 2, 2013 + +This release represents over 65 code commits from 6 different contributors. + + * Added support for pretty urls (filename/index.html vs filename.html) + * Hugo supports a destination directory + * Will efficiently sync content in static to destination directory + * Cleaned up options.. now with support for short and long options + * Added support for TOML + * Added support for YAML + * Added support for Previous & Next + * Added support for indexes for the indexes + * Better Windows compatibility + * Support for series + * Adding verbose output + * Loads of bugfixes + +## **0.7.0** July 4, 2013 + * Hugo now includes a simple server + * First public release + +## **0.6.0** July 2, 2013 + * Hugo includes an example documentation site which it builds + +## **0.5.0** June 25, 2013 + * Hugo is quite usable and able to build spf13.com + diff --git a/content/meta/roadmap.md b/content/meta/roadmap.md new file mode 100644 index 0000000..1e2c6e8 --- /dev/null +++ b/content/meta/roadmap.md @@ -0,0 +1,25 @@ +--- +aliases: +- /doc/roadmap/ +- /meta/roadmap/ +date: 2013-07-01 +menu: + main: + parent: about +notoc: true +title: Hugo Roadmap +weight: 20 +--- + +In no particular order, here is what we are working on: + + * Intelligently Related Posts + * Even easier deployment to S3, SSH, GitHub, rsync + * Import from other website systems (WordPress, Jekyll) + * An interactive web based editor + * Additional themes + * Dynamic image resizing via shortcodes + * Support for additional formats + * Pagination + * Your best ideas + diff --git a/content/overview/configuration.md b/content/overview/configuration.md new file mode 100644 index 0000000..9b4b500 --- /dev/null +++ b/content/overview/configuration.md @@ -0,0 +1,70 @@ +--- +aliases: +- /doc/configuration/ +date: 2013-07-01 +linktitle: Configuration +menu: + main: + parent: getting started +next: /overview/source-directory +notoc: true +prev: /overview/usage +title: Configuring Hugo +weight: 40 +--- + +The directory structure and templates provide the majority of the +configuration for a site. In fact, a config file isn't even needed for many +websites since the defaults follow commonly used patterns. + +Hugo expects to find the config file in the root of the source directory and +will look there first for a `config.toml` file. If none is present, it will +then look for a `config.yaml` file, followed by a `config.json` file. + +The config file is a site-wide config. The config file provides directions to +hugo on how to build the site as well as site-wide parameters and menus. + +## Examples + +The following is an example of a typical yaml config file: + + --- + baseurl: "http://yoursite.example.com/" + ... + +The following is an example of a toml config file with some of the default values: + + contentdir = "content" + layoutdir = "layouts" + publishdir = "public" + builddrafts = false + baseurl = "http://yoursite.example.com/" + canonifyurls = true + + [indexes] + category = "categories" + tag = "tags" + +Here is a yaml configuration file which sets a few more options + + --- + baseurl: "http://yoursite.example.com/" + title: "Yoyodyne Widget Blogging" + footnotereturnlinkcontents: "↩" + permalinks: + post: /:year/:month/:title/ + params: + Subtitle: "Spinning the cogs in the widgets" + AuthorName: "John Doe" + GitHubUser: "spf13" + ListOfFoo: + - "foo1" + - "foo2" + SidebarRecentLimit: 5 + ... + +## Notes + +Config changes do not reflect with [Live Reload](/extras/livereload). + +Please restart `hugo server --watch` whenever you make a config change. diff --git a/content/overview/installing.md b/content/overview/installing.md new file mode 100644 index 0000000..1ae8068 --- /dev/null +++ b/content/overview/installing.md @@ -0,0 +1,68 @@ +--- +aliases: +- /doc/installing/ +date: 2013-07-01 +menu: + main: + parent: getting started +next: /overview/usage +prev: /overview/quickstart +title: Installing Hugo +weight: 20 +--- + +Hugo is written in Go with support for Windows, Linux, FreeBSD and OS X. + +The latest release can be found at [Hugo Releases](https://github.com/spf13/hugo/releases). +We currently build for Windows, Linux, FreeBSD and OS X for x64 +and i386 architectures. + +## Installing Hugo (binary) + +Installation is very easy. Simply download the appropriate version for your +platform from [Hugo Releases](https://github.com/spf13/hugo/releases). +Once downloaded it can be run from anywhere. You don't need to install +it into a global location. This works well for shared hosts and other systems +where you don't have a privileged account. + +Ideally you should install it somewhere in your path for easy use. `/usr/local/bin` +is the most probable location. + +If you have [Homebrew](http://brew.sh), installation is even easier. Just run +`brew install hugo`. + +### Installing Pygments (optional) + +The Hugo executable has one *optional* external dependency for source code highlighting (Pygments). + +If you want to have source code highlighting using the [highlight shortcode](/extras/highlighting), +you need to install the Python-based Pygments program. The procedure is outlined on the [Pygments home page](http://pygments.org). + +## Upgrading Hugo + +Upgrading Hugo is as easy as downloading and replacing the executable you’ve +placed in your path. + + +## Installing from source + +### Dependencies + +* Git +* Go 1.1+ +* Mercurial +* Bazaar + +### Get directly from GitHub: + + go get -v github.com/spf13/hugo + +### Building Hugo + + cd /path/to/hugo + go build -o hugo main.go + mv hugo /usr/local/bin/ + +## Contributing + +Please see the [contributing guide](/doc/contributing). diff --git a/content/overview/introduction.md b/content/overview/introduction.md new file mode 100644 index 0000000..8f76e4a --- /dev/null +++ b/content/overview/introduction.md @@ -0,0 +1,126 @@ +--- +date: 2013-07-01 +linktitle: Introduction +menu: + main: + parent: getting started +next: /overview/quickstart +title: Introduction to Hugo +weight: 5 +--- + +## What is Hugo? + +Hugo is a general-purpose website framework. Technically speaking, Hugo is +a static site generator. This means that, unlike systems like WordPress, +Ghost and Drupal, which run on your web server expensively building a page +every time a visitor requests one, Hugo does the building when you create +your content. Since websites are viewed far more often then they are +edited, Hugo is optimized for website viewing while providing a great +writing experience. + +Sites built with Hugo are extremely fast and very secure. Hugo sites can +be hosted anywhere, including Heroku, GoDaddy, GitHub Pages, Amazon S3 +and CloudFront, and work well with CDNs. Hugo sites run without dependencies +on expensive runtimes like Ruby, Python or PHP and without dependencies +on any databases. + +We think of Hugo as the ideal website creation tool. With nearly instant +build times and the ability to rebuild whenever a change is made, Hugo +provides a very fast feedback loop. This is essential when you are +designing websites, but also very useful when creating content. + +## What does Hugo do? + +In technical terms, Hugo takes a source directory of Markdown files and +templates and uses these as input to create a complete website. + +Hugo boasts the following features: + +### General + + * Extremely fast build times (~1 ms per page) + * Completely cross platform: Runs on Mac OS X, Linux and Windows + * Easy [installation](/overview/installing) + * Render changes [on the fly](/overview/usage) with [live reload](/extras/livereload) as you develop + * Complete theme support + * Host your site anywhere + +### Organization + + * Straightforward [organization](/content/organization) + * Support for [website sections](/content/sections) + * Completely customizable [URLs](/extras/urls) + * Support for configurable [taxonomies](/indexes/overview) which includes categories and tags. Create your own custom organization of content + * Ability to [sort content](/content/ordering) as you desire + * Automatic [table of contents](/extras/toc) generation + * Dynamic menu creation + * [Pretty URLs](/extras/urls) support + * [Permalink](/extras/permalinks) pattern support + * [Aliases](/extras/aliases) (redirects) + +### Content + + * Content written in [Markdown](/content/example) + * Support for TOML, YAML and JSON metadata in [frontmatter](/content/front-matter) + * Completely [customizable homepage](/layout/homepage) + * Support for multiple [content types](/content/types) + * Automatic and user defined [summaries](/content/summaries) + * [Shortcodes](/extras/shortcodes) to enable rich content inside of Markdown + * ["Minutes to Read"](/layout/variables) functionality + * ["Wordcount"](/layout/variables) functionality + +### Additional Features + + * Integrated Disqus comment support + * Automatic [RSS](/layout/rss) creation + * Support for Go and [Amber](https://github.com/eknkc/amber) templates + * Syntax [highlighting](/extras/highlighting) powered by pygments + +See what's coming next in the [roadmap](/meta/roadmap). + +## Who should use Hugo? + +Hugo is for people that prefer writing in a text editor over +a browser. + +Hugo is for people who want to hand code their own website without +worrying about setting up complicated runtimes, dependencies and +databases. + +Hugo is for people building a blog, company site, portfolio, tumblog, +documentation, single page site or a site with thousands of +pages. + +## Why did you write Hugo? + +I wrote Hugo ultimately for a few reasons. First, I was disappointed with +WordPress, my then website solution. It rendered slowly. I couldn't create +content as efficiently as I wanted to and needed to be online to write +posts. The constant security updates and the horror stories of people's +hacked blogs. I hated how content was written in HTML instead of the much +simpler Markdown. Overall, I felt like it got in my way more than it helped +me from writing great content. + +I looked at existing static site generators like Jekyll, Middleman and nanoc. +All had complicated dependencies to install and took far longer to render +my blog with hundreds of posts than I felt was acceptable. I wanted +a framework to be able to get rapid feedback while making changes to the +templates, and the 5+-minute render times was just too slow. In general, +they were also very blog minded and didn't have the ability to have +different content types and flexible URLs. + +I wanted to develop a fast and full-featured website framework without +dependencies. The Go language seemed to have all of the features I needed +in a language. I began developing Hugo in Go and fell in love with the +language. I hope you will enjoy using (and contributing to) Hugo as much +as I have writing it. + +## Next Steps + + * [Install Hugo](/overview/installing) + * [Quick start](/overview/quickstart) + * [Join the Mailing List](/community/mailing-list) + * [Star us on GitHub](http://github.com/spf13/hugo) + * [Discussion Forum](http://discuss.gohugo.io) + diff --git a/content/overview/quickstart.md b/content/overview/quickstart.md new file mode 100644 index 0000000..4f1ff24 --- /dev/null +++ b/content/overview/quickstart.md @@ -0,0 +1,159 @@ +--- +date: 2013-07-01 +linktitle: Quickstart +menu: + main: + parent: getting started +next: /overview/installing +prev: /overview/introduction +title: Hugo Quickstart Guide +weight: 10 +--- + +_This quickstart depends on features introduced in hugo v0.11. If you +have an earlier version of hugo you will need to [upgrade](/overview/installing/) before +proceeding._ + +## Step 1. Install Hugo + +Go to [Hugo Releases](https://github.com/spf13/hugo/releases) and download the +appropriate version for your os and architecture. + +Save it somewhere specific as we will be using it in the next step. + +More complete instructions are available at [Installing Hugo](/overview/installing/) + +## Step 2. Have Hugo Create a site for you + +Hugo has the ability to create a skeleton site. + + hugo new site /path/to/site + +For the rest of the operations we will be executing all commands from within the site directory + + cd /path/to/site + +The new site will have the following structure + + ▸ archetypes/ + ▸ content/ + ▸ layouts/ + ▸ static/ + config.toml + +Currently the site doesn’t have any content, nor is it configured. + +## Step 3. Create Some Content + +Hugo also has the ability to create content for you. + + hugo new about.md + +A new file is now created in `content/` with the following contents + + +++ + draft = true + title = "about" + date = 2014-05-20T10:04:31Z + +++ + +Notice the date is automatically set to the moment you created the content. + +Place some content in this file below the `+++` in the Markdown format. + +For example you could put this + + ## A headline + + Some Content + +For fun, let’s create another piece of content and place some Markdown in it as well. + + hugo new post/first.md + +The new file is located at `content/post/first.md` + +We still lack any templates to tell us how to display the content. + +## Step 4. Install some themes + +Hugo has rich theme support and a growing set of themes to choose from: + + git clone --recursive https://github.com/spf13/hugoThemes themes + +## Step 5. Run Hugo + +Hugo contains its own high performance web server. Simply run `hugo +server` and Hugo will find an available port and run a server with +your content: + + hugo server --theme=hyde --buildDrafts + 2 pages created + 0 tags created + 0 categories created + in 5 ms + Serving pages from exampleHugoSite/public + Web Server is available at http://localhost:1313 + Press ctrl+c to stop + +We specified two options here: + + * `--theme` to pick which theme; + * `--buildDrafts` because we want to display our content, both set to draft status. + +To learn about what other options hugo has, run: + + hugo help + +To learn about the server options: + + hugo help server + +## Step 6. Edit Content + +Not only can Hugo run a server, but it can also watch your files for +changes and automatically rebuild your site. Hugo will then +communicate with your browser and automatically reload any open page. +This even works in mobile browsers. + +Stop the Hugo process by hitting ctrl+c. Then run the following: + + hugo server --theme=hyde --buildDrafts --watch + 2 pages created + 0 tags created + 0 categories created + in 5 ms + Watching for changes in exampleHugoSite/content + Serving pages from exampleHugoSite/public + Web Server is available at http://localhost:1313 + Press ctrl+c to stop + +Open your [favorite editor](http://vim.spf13.com), edit and save your content and watch as Hugo rebuilds and reloads automatically. + +It’s especially productive to leave a browser open on a second monitor +and just glance at it whenever you save. You don’t even need to tab to +your browser. Hugo is so fast that the new site will be there before +you can look at the browser in most cases. + +Change and save this file. Notice what happened in your terminal. + + Change detected, rebuilding site + + 2 pages created + 0 tags created + 0 categories created + in 5 ms + +## Step 7. Have fun + +The best way to learn something is to play with it. + +Things to try: + + * Add a [new content file](/content/organization/) + * Create a [new section](/content/sections/) + * Modify [a template](/layout/templates/) + * Create content with [TOML front matter](/content/front-matter/) + * Define your own field in [front matter](/content/front-matter/) + * Display that [field in the template](/layout/variables/) + * Create a [new content type](/content/types/) diff --git a/content/overview/source-directory.md b/content/overview/source-directory.md new file mode 100644 index 0000000..0c3db7f --- /dev/null +++ b/content/overview/source-directory.md @@ -0,0 +1,90 @@ +--- +aliases: +- /doc/source-directory/ +date: 2013-07-01 +menu: + main: + parent: getting started +next: /content/organization +notoc: true +prev: /overview/configuration +title: Source Organization +weight: 50 +--- + +Hugo takes a single directory and uses it as the input for creating a complete +website. + + +The top level of a source directory will typically have the following elements: + + ▸ archetypes/ + ▸ content/ + ▸ layouts/ + ▸ static/ + ▸ themes/ + config.toml + +Learn more about the different directories and what their purpose is: + +* [config](/overview/configuration) +* [archetypes](/content/archetypes) +* [content](/content/organization) +* [layouts](/layout/overview) +* [static](/themes/creation#toc_4) +* [themes](/themes/overview) + + +## Example + +An example directory may look like: + + . + ├── config.toml + ├── archetypes + | └── default.md + ├── content + | ├── post + | | ├── firstpost.md + | | └── secondpost.md + | └── quote + | | ├── first.md + | | └── second.md + ├── layouts + | ├── _default + | | ├── single.html + | | └── list.html + | ├── partials + | | ├── header.html + | | └── footer.html + | ├── taxonomies + | | ├── category.html + | | ├── post.html + | | ├── quote.html + | | └── tag.html + | ├── post + | | ├── li.html + | | ├── single.html + | | └── summary.html + | ├── quote + | | ├── li.html + | | ├── single.html + | | └── summary.html + | ├── shortcodes + | | ├── img.html + | | ├── vimeo.html + | | └── youtube.html + | ├── index.html + | └── sitemap.xml + ├── themes + | ├── hyde + | └── doc + └── static + ├── css + └── js + +This directory structure tells us a lot about this site: + +1. The website intends to have two different types of content: posts and quotes. +2. It will also apply two different indexes to that content: categories and tags. +3. It will be displaying content in 3 different views: a list, a summary and a full page view. diff --git a/content/overview/usage.md b/content/overview/usage.md new file mode 100644 index 0000000..664e23a --- /dev/null +++ b/content/overview/usage.md @@ -0,0 +1,89 @@ +--- +aliases: +- /doc/usage/ +date: 2013-07-01 +menu: + main: + parent: getting started +next: /overview/configuration +notoc: true +prev: /overview/installing +title: Using Hugo +weight: 30 +--- + +Make sure either hugo is in your path or provide a path to it. + + + + $ hugo help + A Fast and Flexible Static Site Generator + built with love by spf13 and friends in Go. + + Complete documentation is available at http://gohugo.io + + Usage: + hugo [flags] + hugo [command] + + Available Commands: + server Hugo runs its own webserver to render the files + version Print the version number of Hugo + check Check content in the source directory + benchmark Benchmark hugo by building a site a number of times + new [path] Create new content for your site + help [command] Help about any command + + Available Flags: + -b, --baseUrl="": hostname (and path) to the root eg. http://spf13.com/ + -D, --buildDrafts=false: build content marked as draft + -F, --buildFuture=false: build content with PublishDate in the future + --config="": config file (default is path/config.yaml|json|toml) + -d, --destination="": filesystem path to write files to + --disableRSS=false: Do not build RSS files + --disableSitemap=false: Do not build Sitemap file + --log=false: Enable Logging + --logFile="": Log File path (if set, logging enabled automatically) + -s, --source="": filesystem path to read files relative from + --stepAnalysis=false: display memory and timing of different steps of the program + -t, --theme="": theme to use (located in /themes/THEMENAME/) + --uglyUrls=false: if true, use /filename.html instead of /filename/ + -v, --verbose=false: verbose output + --verboseLog=false: verbose logging + -w, --watch=false: watch filesystem for changes and recreate as needed + + Use "hugo help [command]" for more information about that command. + +## Common Usage Example + +The most common use is probably to run hugo with your current +directory being the input directory. + + $ hugo + > X pages created + in 8 ms + +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, rebuild your site as soon as a file +is saved. + + $ hugo -s ~/mysite --watch + 28 pages created + in 18 ms + Watching for changes in /Users/spf13/Code/hugo/docs/content + Press ctrl+c to stop + +Hugo can even run a server and create your site at the same time! Hugo +implements [live reload](/extras/livereload) technology to automatically reload any open pages in +all browsers (including mobile). + + $ hugo server -ws ~/mysite + Watching for changes in /Users/spf13/Code/hugo/docs/content + Web Server is available at http://localhost:1313 + Press ctrl+c to stop + 28 pages created + 0 tags created + in 18 ms + diff --git a/content/showcase/antzucaro.md b/content/showcase/antzucaro.md new file mode 100644 index 0000000..e51123c --- /dev/null +++ b/content/showcase/antzucaro.md @@ -0,0 +1,15 @@ +--- +date: 2014-02-03T20:00:00Z +description: Ant Zucaro's Blog +license: GPL +licenseLink: "" +sitelink: http://antzucaro.com +sourceLink: http://github.com/antzucaro/az.com +tags: +- personal +- blog +- foundation +thumbnail: /img/antzucaro-tn.jpg +title: Ant Zucaro +--- + diff --git a/content/showcase/asc.md b/content/showcase/asc.md new file mode 100644 index 0000000..bf04f90 --- /dev/null +++ b/content/showcase/asc.md @@ -0,0 +1,14 @@ +--- +date: 2014-01-22T07:32:00Z +description: "" +license: CC-BY-SA +licenseLink: "" +sitelink: http://andrewcodispoti.com +sourceLink: https://gitlab.com/acodispo/andrewcodispoti-com +tags: +- personal +- bootstrap +thumbnail: /img/asc-tn.jpg +title: Andrew S Codispoti +--- + diff --git a/content/showcase/carlorat.md b/content/showcase/carlorat.md new file mode 100644 index 0000000..c2d81b0 --- /dev/null +++ b/content/showcase/carlorat.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T09:18:19-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://carlorat.me/ +sourceLink: https://bitbucket.org/carloratm/carlorat.me/src +tags: +- personal +- blog +thumbnail: /img/carlorat-tn.jpg +title: carlorat +--- + diff --git a/content/showcase/chimera-art-space.md b/content/showcase/chimera-art-space.md new file mode 100644 index 0000000..cf0e00e --- /dev/null +++ b/content/showcase/chimera-art-space.md @@ -0,0 +1,14 @@ +--- +date: 2013-10-02T07:32:00Z +description: "" +license: CC-SA +licenseLink: "" +sitelink: http://chimeraarts.org +sourceLink: https://github.com/chimera/chimeraarts.org +tags: +- company +- bootstrap +thumbnail: /img/chimera-tn.jpg +title: Chimera Art Space +--- + diff --git a/content/showcase/chingli.md b/content/showcase/chingli.md new file mode 100644 index 0000000..e2e5b14 --- /dev/null +++ b/content/showcase/chingli.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T11:20:02-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://www.chingli.com/ +sourceLink: "" +tags: +- personal +- blog +thumbnail: /img/chingli-tn.jpg +title: chingli +--- + diff --git a/content/showcase/cloudshark.md b/content/showcase/cloudshark.md new file mode 100644 index 0000000..38f76df --- /dev/null +++ b/content/showcase/cloudshark.md @@ -0,0 +1,14 @@ +--- +date: 2014-03-27T09:45:00Z +description: CloudShark Appliance homepage and documentation +license: "" +licenseLink: "" +sitelink: https://appliance.cloudshark.org +tags: +- company +- documentation +- foundation +thumbnail: /img/cloudshark-tn.jpg +title: CloudShark +--- + diff --git a/content/showcase/danmux.md b/content/showcase/danmux.md new file mode 100644 index 0000000..5d1e664 --- /dev/null +++ b/content/showcase/danmux.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T10:55:23-04:00 +description: "" +license: MIT +licenseLink: "" +sitelink: http://danmux.com/ +sourceLink: https://github.com/danmux/danmux-hugo +tags: +- personal +- blog +thumbnail: /img/danmux-tn.jpg +title: Danmux +--- + diff --git a/content/showcase/devmonk.md b/content/showcase/devmonk.md new file mode 100644 index 0000000..0db4a08 --- /dev/null +++ b/content/showcase/devmonk.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T11:31:02-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: https://devmonk.com/ +sourceLink: https://github.com/peteraba/devmonk.com +tags: +- educational +- video +thumbnail: /img/devmonk-tn.jpg +title: devmonk +--- + diff --git a/content/showcase/hackmeeting.md b/content/showcase/hackmeeting.md new file mode 100644 index 0000000..516ac09 --- /dev/null +++ b/content/showcase/hackmeeting.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-25T18:30:40-04:00 +description: the website developed for the Hackmeeting 2014, the italian meeting of the digital countercultures held this year in Bologna +license: Unknown +licenseLink: "" +sitelink: http://it.hackmeeting.org/ +sourceLink: https://git.autistici.org/void/hackit14 +tags: +- foundation5 +- conference +thumbnail: /img/hackmeeting-tn.jpg +title: hackmeeting +--- + diff --git a/content/showcase/heyitsalex.md b/content/showcase/heyitsalex.md new file mode 100644 index 0000000..d27af3a --- /dev/null +++ b/content/showcase/heyitsalex.md @@ -0,0 +1,14 @@ +--- +date: 2014-03-09T06:00:00Z +description: "" +license: MIT +licenseLink: "" +sitelink: http://heyitsalex.net +sourceLink: https://github.com/alexandre-normand/alexandre-normand +tags: +- personal +- blog +thumbnail: /img/heyitsalex-tn.jpg +title: Hey, it's Alex +--- + diff --git a/content/showcase/hugo.md b/content/showcase/hugo.md new file mode 100644 index 0000000..40b71b4 --- /dev/null +++ b/content/showcase/hugo.md @@ -0,0 +1,14 @@ +--- +date: 2013-07-01T07:32:00Z +description: This site +license: Simpl +licenseLink: "" +sitelink: http://gohugo.io +sourceLink: http://github.com/spf13/hugo/docs +tags: +- documentation +- bootstrap +thumbnail: /img/hugo-tn.jpg +title: Hugo +--- + diff --git a/content/showcase/ifup.md b/content/showcase/ifup.md new file mode 100644 index 0000000..59cf74e --- /dev/null +++ b/content/showcase/ifup.md @@ -0,0 +1,14 @@ +--- +date: 2013-11-02T07:32:00Z +description: "" +license: MIT +licenseLink: "" +sitelink: http://ifup.org +sourceLink: http://www.ifup.org +tags: +- personal +- blog +thumbnail: /img/ifup-tn.jpg +title: ifup +--- + diff --git a/content/showcase/kieranhealy.md b/content/showcase/kieranhealy.md new file mode 100644 index 0000000..bb8a852 --- /dev/null +++ b/content/showcase/kieranhealy.md @@ -0,0 +1,15 @@ +--- +date: 2014-02-27T20:35:00Z +description: Kieran Healy's Website +license: "" +licenseLink: "" +sitelink: http://kieranhealy.org +sourceLink: http://github.com/kjhealy/kieranhealy.hugo +tags: +- personal +- blog +- academic +thumbnail: /img/kjhealy-tn.jpg +title: Kieran Healy +--- + diff --git a/content/showcase/lk4d4.darth.io.md b/content/showcase/lk4d4.darth.io.md new file mode 100644 index 0000000..0010511 --- /dev/null +++ b/content/showcase/lk4d4.darth.io.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-25T18:59:30-04:00 +description: Alexandr Morozov +license: "" +licenseLink: "" +sitelink: http://lk4d4.darth.io/ +sourceLink: https://github.com/LK4D4/lk4d4.darth.io +tags: +- personal +- blog +thumbnail: /img/lk4d4-tn.jpg +title: lk4d4.darth.io +--- + diff --git a/content/showcase/michaelwhatcott.md b/content/showcase/michaelwhatcott.md new file mode 100644 index 0000000..097d9d4 --- /dev/null +++ b/content/showcase/michaelwhatcott.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T11:47:11-04:00 +description: "" +license: Simpl-2.0 +licenseLink: "" +sitelink: http://michaelwhatcott.com/ +sourceLink: https://bitbucket.org/mdwhatcott/michaelwhatcott.com-boilerplate/src +tags: +- personal +- blog +thumbnail: /img/michaelwhatcott-tn.jpg +title: michaelwhatcott +--- + diff --git a/content/showcase/minodisk.md b/content/showcase/minodisk.md new file mode 100644 index 0000000..f0c7366 --- /dev/null +++ b/content/showcase/minodisk.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T09:07:59-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://dsk.mn/ +sourceLink: https://github.com/minodisk/blog +tags: +- personal +- blog +thumbnail: /img/minodisk-tn.jpg +title: minodisk +--- + diff --git a/content/showcase/nickoneill.md b/content/showcase/nickoneill.md new file mode 100644 index 0000000..550988e --- /dev/null +++ b/content/showcase/nickoneill.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T12:15:48-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://blog.nickoneill.name/ +sourceLink: https://github.com/nickoneill/blog.nickoneill.name +tags: +- personal +- blog +thumbnail: /img/nickoneill-tn.jpg +title: authenticgeek +--- + diff --git a/content/showcase/ninya.io.md b/content/showcase/ninya.io.md new file mode 100644 index 0000000..1391bd3 --- /dev/null +++ b/content/showcase/ninya.io.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T09:47:00-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://blog.ninya.io/ +sourceLink: https://github.com/ninya-io/ninya-io.github.io/tree/dev +tags: +- project +- blog +thumbnail: /img/ninya-tn.jpg +title: ninya.io +--- + diff --git a/content/showcase/npf.md b/content/showcase/npf.md new file mode 100644 index 0000000..d351b9e --- /dev/null +++ b/content/showcase/npf.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-21T12:21:18-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://npf.io +sourceLink: https://github.com/natefinch/npf +tags: +- personal +- blog +thumbnail: /img/npf-tn.jpg +title: npf.io +--- + diff --git a/content/showcase/peteraba.md b/content/showcase/peteraba.md new file mode 100644 index 0000000..4161f7b --- /dev/null +++ b/content/showcase/peteraba.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T11:30:57-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: https://peteraba.com/ +sourceLink: https://github.com/peteraba/peteraba.com +tags: +- personal +- blog +thumbnail: /img/peteraba-tn.jpg +title: peteraba +--- + diff --git a/content/showcase/spf13.md b/content/showcase/spf13.md new file mode 100644 index 0000000..1e2dc42 --- /dev/null +++ b/content/showcase/spf13.md @@ -0,0 +1,14 @@ +--- +date: 2013-07-01T07:32:00Z +description: The first Hugo powered website. +license: MIT +licenseLink: "" +sitelink: http://spf13.com +sourceLink: http://github.com/spf13/spf13.com +tags: +- personal +- blog +thumbnail: /img/spf13-tn.jpg +title: spf13.com +--- + diff --git a/content/showcase/techmadeplain.md b/content/showcase/techmadeplain.md new file mode 100644 index 0000000..b9f1005 --- /dev/null +++ b/content/showcase/techmadeplain.md @@ -0,0 +1,13 @@ +--- +date: 2014-05-22T19:54:00Z +description: Tech Coaching site +license: "" +licenseLink: "" +sitelink: http://techmadeplain.com +tags: +- personal +- blog +thumbnail: /img/techmadeplain-tn.jpg +title: Tech Made Plain +--- + diff --git a/content/showcase/tendermint.md b/content/showcase/tendermint.md new file mode 100644 index 0000000..0f123c6 --- /dev/null +++ b/content/showcase/tendermint.md @@ -0,0 +1,13 @@ +--- +date: 2014-08-26T09:34:42-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://tendermint.com/ +sourceLink: https://github.com/tendermint/tendermint.github.io +tags: +- project +thumbnail: /img/tendermint-tn.jpg +title: tendermint +--- + diff --git a/content/showcase/ucsb.md b/content/showcase/ucsb.md new file mode 100644 index 0000000..0dfeffc --- /dev/null +++ b/content/showcase/ucsb.md @@ -0,0 +1,13 @@ +--- +date: 2014-08-26T14:12:55-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://www.philosophy.ucsb.edu/ +sourceLink: https://github.com/grumble/philweb +tags: +- education +thumbnail: /img/ucsb-tn.jpg +title: ucsb +--- + diff --git a/content/showcase/vurt.co.md b/content/showcase/vurt.co.md new file mode 100644 index 0000000..ba7bf65 --- /dev/null +++ b/content/showcase/vurt.co.md @@ -0,0 +1,14 @@ +--- +date: 2014-08-26T12:09:39-04:00 +description: "" +license: "" +licenseLink: "" +sitelink: http://vurt.co.uk/ +sourceLink: https://github.com/gilesp/vurtcouk +tags: +- personal +- blog +thumbnail: /img/vurt.co-tn.jpg +title: vurt.co.uk +--- + diff --git a/content/showcase/yslow-rules.md b/content/showcase/yslow-rules.md new file mode 100644 index 0000000..b9112a6 --- /dev/null +++ b/content/showcase/yslow-rules.md @@ -0,0 +1,15 @@ +--- +date: 2014-04-07T10:45:00Z +description: Community project of YSlow rules translations +license: MIT License +licenseLink: https://raw.github.com/checkmyws/yslow-rules/master/LICENSE +sitelink: http://checkmyws.github.io/yslow-rules/ +sourceLink: https://github.com/checkmyws/yslow-rules +tags: +- community +- documentation +- translation +thumbnail: /img/yslow-rules.jpg +title: YSlow Rules +--- + diff --git a/content/taxonomies/displaying.md b/content/taxonomies/displaying.md new file mode 100644 index 0000000..d5779ba --- /dev/null +++ b/content/taxonomies/displaying.md @@ -0,0 +1,119 @@ +--- +aliases: +- /indexes/displaying/ +date: 2013-07-01 +linktitle: Displaying +menu: + main: + parent: taxonomy +next: /taxonomies/templates +prev: /taxonomies/usage +title: Displaying Taxonomies +weight: 20 +--- + +There are four common ways you can display the data in your +taxonomies in addition to the automatic taxonomy pages created by hugo +using the [list templates](/templates/list): + +1. For a given piece of content, you can list the terms attached +2. For a given piece of content, you can list other content with the same + term +3. You can list all terms for a taxonomy +4. You can list all taxonomies (with their terms) + +## 1. Displaying taxonomy terms assigned to this content + +Within your content templates, you may wish to display +the taxonomies that that piece of content is assigned to. + +Because we are leveraging the front matter system to +define taxonomies for content, the taxonomies assigned to +each content piece are located in the usual place +(.Params.`plural`). + +### Example + + + +## 2. Listing content with the same taxonomy term + +First, you may be asking why you would use this. If you are using a +taxonomy for something like a series of posts, this is exactly how you +would do it. It’s also an quick and dirty way to show some related +content. + + +### Example + + + +## 3. Listing all content in a given taxonomy + +This would be very useful in a sidebar as “featured content”. You could +even have different sections of “featured content” by assigning +different terms to the content. + +### Example + + + + +## 4. Rendering a Site's Taxonomies + +If you wish to display the list of all keys for an taxonomy, you can find retrieve +them from the `.Site` variable which is available on every page. + +This may take the form of a tag cloud, a menu or simply a list. + +The following example displays all tag keys: + +### Example + + + +### Complete Example +This example will list all taxonomies, each of their keys and all the content assigned to each key. + +
+
    + {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} +
  • {{ $taxonomyname }} +
      + {{ range $key, $value := $taxonomy }} +
    • {{ $key }}
    • + + {{ end }} +
    +
  • + {{ end }} +
+
+ diff --git a/content/taxonomies/methods.md b/content/taxonomies/methods.md new file mode 100644 index 0000000..d7a3bc3 --- /dev/null +++ b/content/taxonomies/methods.md @@ -0,0 +1,54 @@ +--- +date: 2014-05-26 +linktitle: Structure & Methods +menu: + main: + parent: taxonomy +next: /extras/aliases +prev: /taxonomies/ordering +title: Using Taxonomies +weight: 75 +--- + +Hugo makes a set of values and methods available on the various Taxonomy structures. + +## Taxonomy Methods + +A Taxonomy is a `map[string]WeightedPages`. + +**.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 + } + +Each element of the slice has: + +**.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.
+**.Pages** Returns a slice of pages, which then can be ordered using any of the [list methods](/templates/list/).
+ + + + + + + diff --git a/content/taxonomies/ordering.md b/content/taxonomies/ordering.md new file mode 100644 index 0000000..0db830b --- /dev/null +++ b/content/taxonomies/ordering.md @@ -0,0 +1,77 @@ +--- +aliases: +- /indexes/ordering/ +date: 2013-07-01 +linktitle: Ordering +menu: + main: + identifier: Ordering Taxonomies + parent: taxonomy +next: /taxonomies/functions +prev: /taxonomies/templates +title: Ordering Taxonomies +weight: 60 +--- + +Hugo provides the ability to both: + + 1. Order the way the keys for an taxonomy are displayed + 2. Order the way taxonomyed content appears + + +## Ordering Taxonomies +Taxonomies can be ordered by either alphabetical key or by the number of content pieces assigned to that key. + +### Order Alphabetically Example: + + + +### Order by Popularity Example: + + + + +[See Also Taxonomy Lists](/taxonomies/lists/) + +## Ordering Content within Taxonomies + +Hugo uses both **Date** and **Weight** to order content within taxonomies. + +Each piece of content in Hugo can optionally be assigned a date. +It can also be assigned a weight for each taxonomy it is assigned to. + +When iterating over content within taxonomies the default sort is first by weight then by date. This means that if the weights for two pieces of content are the same, than the more recent content will be displayed first. The default weight for any piece of content is 0. + +### Assigning Weight + +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 + + +The convention is `taxonomyname_weight`. + +In the above example, this piece of content has a weight of 22 which applies to the sorting when rendering the pages assigned to the "a", "b" and "c" values of the 'tag' taxonomy. + +It has also been assigned the weight of 44 when rendering the 'd' category. + +With this the same piece of content can appear in different positions in different taxonomies. + +Currently taxonomies only support the default ordering of content which is weight -> date. diff --git a/content/taxonomies/overview.md b/content/taxonomies/overview.md new file mode 100644 index 0000000..579864a --- /dev/null +++ b/content/taxonomies/overview.md @@ -0,0 +1,92 @@ +--- +aliases: +- /indexes/overview/ +- /doc/indexes/ +- /extras/indexes +date: 2013-07-01 +linktitle: Overview +menu: + main: + identifier: taxonomy overview + parent: taxonomy +next: /taxonomies/usage +prev: /templates/404 +title: Taxonomy Overview +weight: 10 +--- + +Hugo includes support for user defined groupings of content called +taxonomies. Taxonomies give us a way to classify our content so we can +demonstrate relationships in a variety of logical ways. + +The default taxonomies for Hugo are tags and categories. These +taxonomies are common to many website systems (WordPress, Drupal, +Jekyll). Unlike all of those systems, Hugo makes it trivial to customize +the taxonomies you will be using for your site however you wish. Another +good use for taxonomies is to group a set of posts into a series. Other +common uses would include categories, tags, groups, series and many +more. + +When taxonomies are used (and templates are provided), Hugo will +automatically create pages listing all of the taxonomies, their terms +and all of the content attached to those terms. + +## Definitions + +**Taxonomy:** A categorization that can be used to classify content + +**Term:** A key within that taxonomy + +**Value:** A piece of content assigned to that Term + +## Example + +For example, if I was writing about movies, I may want the following +taxonomies: + +* Actors +* Directors +* Studios +* Genre +* Year +* Awards + +I would then specify in each movie’s front-matter the specific terms for +each of those taxonomies. Hugo would then automatically create pages for +each Actor, Director, Studio, Genre, Year and Award listing all of the +Movies that matched that specific Actor, Director, etc. + + +### Taxonomy Organization + +Let’s use an example to demonstrate the different labels in action. +From the perspective of the taxonomy, it could be visualized as: + + Actor <- Taxonomy + Bruce Willis <- Term + The Six Sense <- Content + Unbreakable <- Content + Moonrise Kingdom <- Content + Samuel L. Jackson <- Term + Unbreakable <- Content + The Avengers <- Content + xXx <- Content + +From the perspective of the content, it would appear differently, though +the data and labels used are the same: + + Unbreakable <- Content + Actors <- Taxonomy + Bruce Willis <- Term + Samuel L. Jackson <- Term + Director <- Taxonomy + M. Night Shyamalan <- Term + ... + Moonrise Kingdom <- Content + Actors <- Taxonomy + Bruce Willis <- Term + Bill Murray <- Term + Director <- Taxonomy + Wes Anderson <- Term + ... + diff --git a/content/taxonomies/templates.md b/content/taxonomies/templates.md new file mode 100644 index 0000000..43e27a6 --- /dev/null +++ b/content/taxonomies/templates.md @@ -0,0 +1,25 @@ +--- +aliases: +- /indexes/templates/ +date: 2013-07-01 +linktitle: Templates +menu: + main: + parent: taxonomy +next: /taxonomies/ordering +prev: /templates/displaying +title: Taxonomy Templates +weight: 30 +--- + +There are two different templates that the use of taxonomies will require you to provide. + +Both templates are covered in detail in the templates section. + +A [list template](/templates/list/) is any template that will be used to render multiple pieces of +content in a single html page. This template will be used to generate +all the automatically created taxonomy pages. + +A [taxonomy terms template](/templates/terms/) is a template used to +generate the list of terms for a given template. + diff --git a/content/taxonomies/usage.md b/content/taxonomies/usage.md new file mode 100644 index 0000000..f55b865 --- /dev/null +++ b/content/taxonomies/usage.md @@ -0,0 +1,72 @@ +--- +date: 2014-05-26 +linktitle: Usage +menu: + main: + parent: taxonomy +next: /taxonomies/displaying +prev: /taxonomies/overview +title: Using Taxonomies +weight: 15 +--- + +## Defining taxonomies for a site + +Taxonomies must be defined in the site configuration before they can be +used throughout the site. You need to provide both the plural and +singular labels for each taxonomy. + +Here is an example configuration in YAML that specifies three taxonomies +(the default two, plus `series`). + +Notice the format is **singular key** : *plural value*. +### config.yaml + + --- + Taxonomies: + tag: "tags" + category: "categories" + series: "series" + --- + +## Assigning taxonomy values to content + +Once an taxonomy is defined at the site level, any piece of content +can be assigned to it regardless of content type or section. + +Assigning content to an taxonomy is done in the front matter. +Simply create a variable with the *plural* name of the taxonomy +and assign all terms you want to apply to this content. + +**taxonomy values are case insensitive** + +### 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 = "http://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": "http://github.com/spf13/hugo" + } diff --git a/content/templates/404.md b/content/templates/404.md new file mode 100644 index 0000000..1591782 --- /dev/null +++ b/content/templates/404.md @@ -0,0 +1,41 @@ +--- +aliases: +- /layout/404/ +date: 2013-08-21 +linktitle: "404" +menu: + main: + parent: layout +next: /taxonomies/overview +notoc: true +prev: /templates/sitemap +title: 404.html Templates +weight: 100 +--- + +When using Hugo with [GitHub Pages](http://pages.github.com/) you can provide +your own 404 template by creating a 404.html file in the root. + +404 pages are of the type "node" and have all the [node +variables](/layout/variables/) available to use in the templates. + +In addition to the standard node variables, the homepage has access to +all site content accessible from .Data.Pages + + ▾ layouts/ + 404.html + +## 404.html +This is a basic example of a 404.html template: + + {{ partial "header.html" . }} + {{ partial "subheader.html" . }} + +
+
+

{{ .Title }}

+
+
+ + {{ partial "footer.html" }} + diff --git a/content/templates/content.md b/content/templates/content.md new file mode 100644 index 0000000..14d613c --- /dev/null +++ b/content/templates/content.md @@ -0,0 +1,161 @@ +--- +aliases: +- /layout/functions/ +date: 2013-07-01 +linktitle: Single Content +menu: + main: + parent: layout +next: /templates/list +prev: /templates/variables +title: Single Content Template +weight: 30 +--- + +The primary view of content in Hugo is the single view. Hugo, for every +Markdown file provided, will render it with a single template. + + +## Which Template will be rendered? +Hugo uses a set of rules to figure out which template to use when +rendering a specific page. + +Hugo will use the following prioritized list. If a file isn’t present, +then the next one in the list will be used. This enables you to craft +specific layouts when you want to without creating more templates +than necessary. For most sites only the \_default file at the end of +the list will be needed. + +Users can specify the `type` and `layout` in the [front-matter](/content/front-matter). `Section` +is determined based on the content file’s location. If `type` is provide, +it will be used instead of `section`. + +### Single + +* /layouts/`TYPE`-or-`SECTION`/`LAYOUT`.html +* /layouts/`TYPE`-or-`SECTION`/single.html +* /layouts/\_default/single.html +* /themes/`THEME`/layouts/`TYPE`-or-`SECTION`/`LAYOUT`.html +* /themes/`THEME`/layouts/`TYPE`-or-`SECTION`/single.html +* /themes/`THEME`/layouts/\_default/single.html + +## Example Single Template File + +Content pages are of the type "page" and have all the [page +variables](/layout/variables/) and [site +variables](/templates/variables/) available to use in the templates. + +In the following examples we have created two different content types as well as +a default content type. + +The default content template to be used in the event that a specific +template has not been provided for that type. The default type works the +same as the other types, but the directory must be called "\_default". + + ▾ layouts/ + ▾ _default/ + single.html + ▾ post/ + single.html + ▾ project/ + single.html + + +## post/single.html +This content template is used for [spf13.com](http://spf13.com). +It makes use of [partial templates](/layout/partials) + + {{ partial "header.html" . }} + {{ partial "subheader.html" . }} + {{ $baseurl := .Site.BaseUrl }} + +
+

{{ .Title }}

+
+
+ {{ .Content }} +
+
+
+ + + + {{ partial "disqus.html" . }} + {{ partial "footer.html" . }} + + +## project/single.html +This content template is used for [spf13.com](http://spf13.com). +It makes use of [partial templates](/layout/partials) + + + {{ partial "header.html" . }} + {{ partial "subheader.html" . }} + {{ $baseurl := .Site.BaseUrl }} + +
+

{{ .Title }}

+
+
+ {{ .Content }} +
+
+
+ + + + {{if isset .Params "project_url" }} + + {{ end }} + + {{ partial "footer.html" }} + +Notice how the project/single.html template uses an additional parameter unique +to this template. This doesn't need to be defined ahead of time. If the key is +present in the front matter than it can be used in the template. To +easily generate new content of this type with these keys ready use +[content archetypes](/content/archetypes). diff --git a/content/templates/functions.md b/content/templates/functions.md new file mode 100644 index 0000000..4d4d933 --- /dev/null +++ b/content/templates/functions.md @@ -0,0 +1,164 @@ +--- +aliases: +- /layout/functions/ +date: 2013-07-01 +linktitle: Functions +menu: + main: + parent: layout +next: /templates/variables +prev: /templates/go-templates +title: Hugo Template Functions +weight: 20 +--- + +Hugo uses the excellent Go html/template library for its template engine. +It is an extremely lightweight engine that provides a very small amount of +logic. In our experience it is just the right amount of logic to be able +to create a good static website. + +Go templates are lightweight but extensible. Hugo has added the following +functions to the basic template logic. + +(Go itself supplies built-in functions, including comparison operators +and other basic tools; these are listed in the +[Go template documentation](http://golang.org/pkg/text/template/#hdr-Functions).) + +## General + +### isset +Return true if the parameter is set. +Takes either a slice, array or channel and an index or a map and a key as input. + +e.g. {{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }} + +### echoParam +If parameter is set, then echo it. + +e.g. {{echoParam .Params "project_url" }} + +### eq +Return true if the parameters are equal. + +e.g. + {{ if eq .Section "blog" }}current{{ end}}" + +### first +Slices an array to only the first X elements. + +Works on [lists](/templates/list/), [taxonomies](/taxonomies/displaying/), [terms](/templates/terms/), [groups](/templates/list/) + +e.g. + {{ range first 10 .Data.Pages }} + {{ .Render "summary"}} + {{ end }} + +### where +Filters an array to only elements containing a matching value for a given field. + +Works on [lists](/templates/list/), [taxonomies](/taxonomies/displaying/), [terms](/templates/terms/), [groups](/templates/list/) + +e.g. + + {{ range where .Data.Pages "Section" "post" }} + {{ .Content}} + {{ end }} + +*where and first can be stacked* + +e.g. + + {{ range first 5 (where .Data.Pages "Section" "post") }} + {{ .Content}} + {{ end }} + +### in +Checks if an element is in an array (or slice) and returns a boolean. The elements supported are strings, integers and floats (only float64 will match as expected). In addition, it can also check if a substring exists in a string. + +e.g. + {{ if in .Params.tags "Git" }}Follow me on GitHub!{{ end }} +or + {{ if in "this string contains a substring" "substring" }}Substring found!{{ end }} + +### intersect +Given two arrays (or slices), this function will return the common elements in the arrays. The elements supported are strings, integers and floats (only float64). + +A useful example of this functionality is a 'similar posts' block. Create a list of links to posts where any of the tags in the current post match any tags in other posts. + +e.g. + + + +## Math + +### add +Adds two integers. + +e.g. {{add 1 2}} → 3 + +### sub +Subtracts two integers. + +e.g. {{sub 3 2}} → 1 + +### div +Divides two integers. + +e.g. {{div 6 3}} → 2 + +### mul +Multiplies two integers. + +e.g. {{mul 2 3}} → 6 + +### mod +Modulus of two integers. + +e.g. {{mod 15 3}} → 0 + +### modBool +Boolean of modulus of two integers. +true if modulus is 0. + +e.g. {{modBool 15 3}} → true + +## Strings + +### urlize +Takes a string and sanitizes it for usage in URLs, converts spaces to "-". + +e.g. <a href="/tags/{{ . | urlize }}">{{ . }}</a> + +### safeHtml +Declares the provided string as "safe" so Go templates will not filter it. + +e.g. {{ .Params.CopyrightHTML | safeHtml }} + +### lower +Convert all characters in string to lowercase. + +e.g. {{lower "BatMan"}} → "batman" + +### upper +Convert all characters in string to uppercase. + +e.g. {{upper "BatMan"}} → "BATMAN" + +### title +Convert all characters in string to titlecase. + +e.g. {{title "BatMan"}} → "Batman" + +### highlight +Take a string of code and a language, uses Pygments to return the syntax +highlighted code in HTML. Used in the [highlight shortcode](/extras/highlighting). diff --git a/content/templates/go-templates.md b/content/templates/go-templates.md new file mode 100644 index 0000000..ccfa3a9 --- /dev/null +++ b/content/templates/go-templates.md @@ -0,0 +1,379 @@ +--- +aliases: +- /layout/go-templates/ +- /layouts/go-templates/ +date: 2013-07-01 +menu: + main: + parent: layout +next: /templates/functions +prev: /templates/overview +title: Go Template Primer +weight: 15 +--- + +Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for +its template engine. It is an extremely lightweight engine that provides a very +small amount of logic. In our experience it is just the right amount of +logic to be able to create a good static website. If you have used other +template systems from different languages or frameworks, you will find a lot of +similarities in Go templates. + +This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate] +go into more depth and cover features that aren't mentioned here. + +## Introduction to Go Templates + +Go templates provide an extremely simple template language. It adheres to the +belief that only the most basic of logic belongs in the template or view layer. +One consequence of this simplicity is that Go templates parse very quickly. + +A unique characteristic of Go templates is they are content aware. Variables and +content will be sanitized depending on the context of where they are used. More +details can be found in the [Go docs][gohtmltemplate]. + +## Basic Syntax + +Go lang templates are HTML files with the addition of variables and +functions. + +**Go variables and functions are accessible within {{ }}** + +Accessing a predefined variable "foo": + + {{ foo }} + +**Parameters are separated using spaces** + +Calling the `add` function with input of 1, 2: + + {{ add 1 2 }} + +**Methods and fields are accessed via dot notation** + +Accessing the Page Parameter "bar" + + {{ .Params.bar }} + +**Parentheses can be used to group items together** + + {{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }} + + +## Variables + +Each Go template has a struct (object) made available to it. In Hugo, each +template is passed either a page or a node struct depending on which type of +page you are rendering. More details are available on the +[variables](/layout/variables) page. + +A variable is accessed by referencing the variable name. + + {{ .Title }} + +Variables can also be defined and referenced. + + {{ $address := "123 Main St."}} + {{ $address }} + + +## Functions + +Go template ships with a few functions which provide basic functionality. The Go +template system also provides a mechanism for applications to extend the +available functions with their own. [Hugo template +functions](/layout/functions) provide some additional functionality we believe +are useful for building websites. Functions are called by using their name +followed by the required parameters separated by spaces. Template +functions cannot be added without recompiling Hugo. + +**Example 1: Adding numbers** + + {{ add 1 2 }} + +**Example 2: Comparing numbers** + + {{ lt 1 2 }} + +(There are more boolean operators, detailed in the +[template documentation](http://golang.org/pkg/text/template/#hdr-Functions).) + +## Includes + +When including another template, you will pass to it the data it will be +able to access. To pass along the current context, please remember to +include a trailing dot. The templates location will always be starting at +the /layout/ directory within Hugo. + +**Example:** + + {{ template "partials/header.html" . }} + +And, starting with Hugo v0.12, you may also use the `partial` call +for [partial templates](/templates/partials/): + + {{ partial "header.html" . }} + + +## Logic + +Go templates provide the most basic iteration and conditional logic. + +### Iteration + +Just like in Go, the Go templates make heavy use of `range` to iterate over +a map, array or slice. The following are different examples of how to use +range. + +**Example 1: Using Context** + + {{ range array }} + {{ . }} + {{ end }} + +**Example 2: Declaring value variable name** + + {{range $element := array}} + {{ $element }} + {{ end }} + +**Example 2: Declaring key and value variable name** + + {{range $index, $element := array}} + {{ $index }} + {{ $element }} + {{ end }} + +### Conditionals + +`if`, `else`, `with`, `or` & `and` provide the framework for handling conditional +logic in Go Templates. Like `range`, each statement is closed with `end`. + +Go Templates treat the following values as false: + +* false +* 0 +* any array, slice, map, or string of length zero + +**Example 1: `if`** + + {{ if isset .Params "title" }}

{{ index .Params "title" }}

{{ end }} + +**Example 2: `if` … `else`** + + {{ if isset .Params "alt" }} + {{ index .Params "alt" }} + {{else}} + {{ index .Params "caption" }} + {{ end }} + +**Example 3: `and` & `or`** + + {{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} + +**Example 4: `with`** + +An alternative way of writing "`if`" and then referencing the same value +is to use "`with`" instead. `with` rebinds the context `.` within its scope, +and skips the block if the variable is absent. + +The first example above could be simplified as: + + {{ with .Params.title }}

{{ . }}

{{ end }} + +**Example 5: `if` … `else if`** + + {{ if isset .Params "alt" }} + {{ index .Params "alt" }} + {{ else if isset .Params "caption" }} + {{ index .Params "caption" }} + {{ end }} + +## Pipes + +One of the most powerful components of Go templates is the ability to +stack actions one after another. This is done by using pipes. Borrowed +from Unix pipes, the concept is simple, each pipeline's output becomes the +input of the following pipe. + +Because of the very simple syntax of Go templates, the pipe is essential +to being able to chain together function calls. One limitation of the +pipes is that they only can work with a single value and that value +becomes the last parameter of the next pipeline. + +A few simple examples should help convey how to use the pipe. + +**Example 1:** + + {{ if eq 1 1 }} Same {{ end }} + +is the same as + + {{ eq 1 1 | if }} Same {{ end }} + +It does look odd to place the `if` at the end, but it does provide a good +illustration of how to use the pipes. + +**Example 2:** + + {{ index .Params "disqus_url" | html }} + +Access the page parameter called "disqus_url" and escape the HTML. + +**Example 3:** + + {{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}} + Stuff Here + {{ end }} + +Could be rewritten as + + {{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }} + Stuff Here + {{ end }} + +### Internet Explorer conditional comments using Pipes + +By default, Go Templates remove HTML comments from output. This has the unfortunate side effect of removing Internet Explorer conditional comments. As a workaround, use something like this: + + {{ "" | safeHtml }} + +## Context (a.k.a. the dot) + +The most easily overlooked concept to understand about Go templates is that `{{ . }}` +always refers to the current context. In the top level of your template this +will be the data set made available to it. Inside of a iteration it will have +the value of the current item. When inside of a loop the context has changed. +`.` will no longer refer to the data available to the entire page. If you need +to +access this from within the loop, you will likely want to set it to a variable +instead of depending on the context. + +**Example:** + + {{ $title := .Site.Title }} + {{ range .Params.tags }} +
  • {{ . }} - {{ $title }}
  • + {{ end }} + +Notice how once we have entered the loop the value of `{{ . }}` has changed. We +have defined a variable outside of the loop so we have access to it from within +the loop. + +# Hugo Parameters + +Hugo provides the option of passing values to the template language +through the site configuration (for sitewide values), or through the meta +data of each specific piece of content. You can define any values of any +type (supported by your front matter/config format) and use them however +you want to inside of your templates. + + +## Using Content (page) Parameters + +In each piece of content, you can provide variables to be used by the +templates. This happens in the [front matter](/content/front-matter). + +An example of this is used in this documentation site. Most of the pages +benefit from having the table of contents provided. Sometimes the TOC just +doesn't make a lot of sense. We've defined a variable in our front matter +of some pages to turn off the TOC from being displayed. + +Here is the example front matter: + +``` +--- +title: "Permalinks" +date: "2013-11-18" +aliases: + - "/doc/permalinks/" +groups: ["extras"] +groups_weight: 30 +notoc: true +--- +``` + +Here is the corresponding code inside of the template: + + {{ if not .Params.notoc }} +
    + {{ .TableOfContents }} +
    + {{ end }} + + + +## Using Site (config) Parameters +In your top-level configuration file (e.g., `config.yaml`) you can define site +parameters, which are values which will be available to you in partials. + +For instance, you might declare: + +```yaml +params: + CopyrightHTML: "Copyright © 2013 John Doe. All Rights Reserved." + TwitterUser: "spf13" + SidebarRecentLimit: 5 +``` + +Within a footer layout, you might then declare a `