From a788b594667fe2c71f8c18ba61ffcf86d3a9c85b Mon Sep 17 00:00:00 2001 From: Maksim Lin Date: Fri, 7 Aug 2020 18:00:57 +1000 Subject: [PATCH] add docs for sort order for lists --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1ce8861..324382f 100644 --- a/README.md +++ b/README.md @@ -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.