Change sorting of tutorials to weight

Closes rdwatters/hugo-docs-concept#11
This commit is contained in:
Ryan Watters committed 2017-03-10 14:23:21 -06:00
1 parent 0f24f21742
commit b841193d49
6 files changed
+10 -13

No files matched your search

+3 -3
View File
@@ -21,18 +21,18 @@ The `AddDate` function takes three arguments in logical order of `years`, `month
## Example: Randomized Tweets from the Last 2 Years
Let's assume you have a filed at `data/tweets.toml` that contains a long list of Tweets you've been collecting to display on your site's homepage. This file is filled with hundreds of `[[tweet]]` blocks; e.g.---
Let's assume you have a file at `data/tweets.toml` that contains a list of Tweets to display on your site's homepage. The file is filled with `[[tweet]]` blocks; e.g.---
```toml
[[tweet]]
name = "Steve Francia"
twitter_handle = "@spf13"
quote = "I am the creator of Hugo. #metadocreference"
quote = "I'm creator of Hugo. #metadocreference"
link = "https://twitter.com/spf13"
date = "2017-01-07T00:00:00Z"
```
Let's assume you want to grab Tweets from the last two years and present them in a random order. In conjunction with the [`where`](functions/where/) and [`now`](/functions/now/) functions, we can limit our range to the last two years via `now.AddDate -2 0 0`, which represents a point in time 2 years, 0 days, and 0 hours before the time of your last site build.
Let's assume you want to grab Tweets from the last two years and present them in a random order. In conjunction with the [`where`](functions/where/) and [`now`](/functions/now/) functions, you can limit our range to the last two years via `now.AddDate -2 0 0`, which represents a point in time 2 years, 0 days, and 0 hours before the time of your last site build.
{{% code file="partials/templates/random-tweets.html" download="tweets.html" %}}
```html
+1 -1
View File
@@ -111,7 +111,7 @@ layout: reviewarticle
```
{{% /code %}}
Here is the way Hugo's traverses the single-page lookup order for `my-second-post.md`:
Here is the way Hugo traverses the single-page lookup order for `my-second-post.md`:
1. <span class="yes">`/layouts/review/reviewarticle.html`</span>
<br><span class="break">BREAK</span>
+2 -7
View File
@@ -35,11 +35,7 @@ A [section’s][section] RSS will be rendered at `/<SECTION>/index.xml` (e.g., h
Hugo provides the ability for you to define any RSS type you wish and can have different RSS files for each section and taxonomy.
## 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.
## Lookup Order for RSS Templates
### Main RSS
@@ -65,7 +61,7 @@ Hugo will use the following prioritized list. If a file isn’t present, then th
## Configuring RSS
The following values will be included in the RSS output if specified in your site’s [`config` file][config]. Example values are provided.
Hugo's default behavior is to create an unlimited number of RSS entries. You can customize this behavior vi`rssLimit:` in your [`config`][config] file. The following values will also be included in the RSS output if specified in your site’s configuration:
```toml
languageCode = "en-us"
@@ -75,7 +71,6 @@ copyright = "This work is licensed under a Creative Commons Attribution-ShareAli
name = "My Name Here"
```
## The Embedded rss.xml
This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.0 Specification][RSS 2.0].
+1 -1
View File
@@ -59,7 +59,7 @@ tutorials:
title: "Tutorials"
url: "tutorials"
haschildren: true
sortsubpagesby: "title"
sortsubpagesby: "weight"
desc: "Community-aggregated articles and code examples for approaching different projects with Hugo"
tools:
order: 10
+2
View File
@@ -62,9 +62,11 @@
.icon-bitbucket:before { content: '\e80a'; } /* '' */
.icon-cancel:before { content: '\e80e'; } /* '' */
.icon-chrome:before { content: '\e841'; } /* '' */
.icon-clipboard:before { content: '\f0c5'; } /* '' */
.icon-clock:before { content: '\e817'; } /* '' */
.icon-code:before { content: '\f121'; } /* '' */
.icon-cog-alt:before { content: '\e816'; } /* '' */
.icon-copy:before { content: '\f0c5'; } /* '' */
.icon-discuss:before { content: '\f03d'; } /* '' */
.icon-docs:before { content: '\f0c5'; } /* '' */
.icon-download:before { content: '\e806'; } /* '' */
+1 -1
View File
@@ -1 +1 @@
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box;border-radius:0px !important;outline:none}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html,body{margin:0px;padding:0px;outline:none;border:none;font-size:18px;font-family:"lato","muli","Helvetica Neue","Helvetica","Roboto","Arial",sans-serif;color:#222;line-height:1.6;font-weight:400;overflow-x:hidden}html,body{overflow-y:auto !important;-webkit-overflow-scrolling:touch !important}body{font-size:93%;overflow-x:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}@media only screen and (min-width: 760px){body{font-size:97%}}@media only screen and (min-width: 960px){body{font-size:100%}}strong{font-weight:700;color:#222}p{margin-top:0px;margin-bottom:1.5em;line-height:1.6}::-webkit-scrollbar{display:none}@font-face{font-family:'fontello';src:url("/fonts/fontello/fontello.eot?12848190");src:url("/fonts/fontello/fontello.eot?12848190#iefix") format("embedded-opentype"),url("/fonts/fontello/fontello.woff2?12848190") format("woff2"),url("/fonts/fontello/fontello.woff?12848190") format("woff"),url("/fonts/fontello/fontello.ttf?12848190") format("truetype"),url("/fonts/fontello/fontello.svg?12848190#fontello") format("svg");font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-apple:before{content:'\f179'}.icon-attach:before{content:'\e814'}.icon-attention:before{content:'\e815'}.icon-bash:before{content:'\e808'}.icon-bitbucket:before{content:'\e80a'}.icon-cancel:before{content:'\e80e'}.icon-chrome:before{content:'\e841'}.icon-clock:before{content:'\e817'}.icon-code:before{content:'\f121'}.icon-cog-alt:before{content:'\e816'}.icon-discuss:before{content:'\f03d'}.icon-docs:before{content:'\f0c5'}.icon-download:before{content:'\e806'}.icon-edge:before{content:'\f282'}.icon-file-pdf:before{content:'\f1c1'}.icon-firefox:before{content:'\e840'}.icon-forum:before{content:'\f03d'}.icon-forums:before{content:'\f03d'}.icon-freebsd:before{content:'\e800'}.icon-git:before{content:'\f1d3'}.icon-github-alt:before{content:'\f056'}.icon-github:before{content:'\f09b'}.icon-gitlab:before{content:'\f296'}.icon-gitter:before{content:'\e805'}.icon-golang:before{content:'\e801'}.icon-heart:before{content:'\e804'}.icon-home:before{content:'\e813'}.icon-html:before{content:'\f13b'}.icon-hugo:before{content:'\e802'}.icon-ie:before{content:'\e843'}.icon-link-external:before{content:'\f08e'}.icon-link:before{content:'\e812'}.icon-linux:before{content:'\f17c'}.icon-mail-alt:before{content:'\f0e0'}.icon-md:before{content:'\e818'}.icon-netlify:before{content:'\e80b'}.icon-opera:before{content:'\e842'}.icon-pencil:before{content:'\e807'}.icon-pin:before{content:'\e811'}.icon-quote-left:before{content:'\e819'}.icon-quote-right:before{content:'\e81a'}.iLine truncated
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box;border-radius:0px !important;outline:none}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html,body{margin:0px;padding:0px;outline:none;border:none;font-size:18px;font-family:"lato","muli","Helvetica Neue","Helvetica","Roboto","Arial",sans-serif;color:#222;line-height:1.6;font-weight:400;overflow-x:hidden}html,body{overflow-y:auto !important;-webkit-overflow-scrolling:touch !important}body{font-size:93%;overflow-x:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}@media only screen and (min-width: 760px){body{font-size:97%}}@media only screen and (min-width: 960px){body{font-size:100%}}strong{font-weight:700;color:#222}p{margin-top:0px;margin-bottom:1.5em;line-height:1.6}::-webkit-scrollbar{display:none}@font-face{font-family:'fontello';src:url("/fonts/fontello/fontello.eot?12848190");src:url("/fonts/fontello/fontello.eot?12848190#iefix") format("embedded-opentype"),url("/fonts/fontello/fontello.woff2?12848190") format("woff2"),url("/fonts/fontello/fontello.woff?12848190") format("woff"),url("/fonts/fontello/fontello.ttf?12848190") format("truetype"),url("/fonts/fontello/fontello.svg?12848190#fontello") format("svg");font-weight:normal;font-style:normal}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:"fontello";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-apple:before{content:'\f179'}.icon-attach:before{content:'\e814'}.icon-attention:before{content:'\e815'}.icon-bash:before{content:'\e808'}.icon-bitbucket:before{content:'\e80a'}.icon-cancel:before{content:'\e80e'}.icon-chrome:before{content:'\e841'}.icon-clipboard:before{content:'\f0c5'}.icon-clock:before{content:'\e817'}.icon-code:before{content:'\f121'}.icon-cog-alt:before{content:'\e816'}.icon-copy:before{content:'\f0c5'}.icon-discuss:before{content:'\f03d'}.icon-docs:before{content:'\f0c5'}.icon-download:before{content:'\e806'}.icon-edge:before{content:'\f282'}.icon-file-pdf:before{content:'\f1c1'}.icon-firefox:before{content:'\e840'}.icon-forum:before{content:'\f03d'}.icon-forums:before{content:'\f03d'}.icon-freebsd:before{content:'\e800'}.icon-git:before{content:'\f1d3'}.icon-github-alt:before{content:'\f056'}.icon-github:before{content:'\f09b'}.icon-gitlab:before{content:'\f296'}.icon-gitter:before{content:'\e805'}.icon-golang:before{content:'\e801'}.icon-heart:before{content:'\e804'}.icon-home:before{content:'\e813'}.icon-html:before{content:'\f13b'}.icon-hugo:before{content:'\e802'}.icon-ie:before{content:'\e843'}.icon-link-external:before{content:'\f08e'}.icon-link:before{content:'\e812'}.icon-linux:before{content:'\f17c'}.icon-mail-alt:before{content:'\f0e0'}.icon-md:before{content:'\e818'}.icon-netlify:before{content:'\e80b'}.icon-opera:before{content:'\e842'}.icon-pencil:before{content:'\e807'}.icon-pin:before{content:'\e811'}.icon-quotLine truncated