Skip to content

Commit

Permalink
add docs for sort order for lists
Browse files Browse the repository at this point in the history
  • Loading branch information
maks committed Aug 7, 2020
1 parent 2f8a4dc commit a788b59
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,16 @@ Listing files are in yaml format with the following parameters supported: `path`

The `path` is a path relative to `.dsg/html/_content`.
The `filter` specifies which files to list within the given path.
The `sort_by` specifies a property.
The `sort_by` specifies a property **AND** the `ASC` or `DESC`.

eg.
eg. to sort in chronological descending order based on a front-matter property called `pub_date`

```yaml
path: blog
filter: "*.md"
sort_by: lastModified
sort_by: pub_date DESC
```
**note:** `sortby` not yet implemented.

**DSG** injects your listings into a global `_lists` variable. For each file all of the files YAML front-matter properties are available along with the files:

* `filename`: the files name without extension.
Expand Down

0 comments on commit a788b59

Please sign in to comment.