mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-25 15:58:53 +00:00
Change sorting of tutorials to weight
Closes rdwatters/hugo-docs-concept#11
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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].
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'; } /* '' */
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user