mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-22 12:50:40 +00:00
Robert Kaussow
128a55e974
BREAKING CHANGE: To enable sorting of elements in the `properties` shortcode, it was necessary to change the structure of the properties file. Due to this change, the `properties` object now requires a list of maps instead of a map. A [sample file](https://raw.githubusercontent.com/thegeeklab/hugo-geekdoc/main/exampleSite/data/properties/demo.yaml) can be found in the repository.
1.3 KiB
1.3 KiB
title |
---|
Properties |
The property list shortcode creates a custom HTML description list that can be used to display properties or variables and general dependent information. The shortcode requires a data file in data/properties/
, e.g. data/properties/demo.yaml
.
Attributes
Name | Description | default |
---|---|---|
name | name of the file from the data/properties/ directory |
undefined |
sort (optional) | field name to use for sorting | undefined |
order (optional) | sort order, only applied if sort is set |
asc |
Usage
{{</* propertylist name=demo (sort=name) (order=[asc|desc]) */>}}
The supported attributes can be taken from the following example:
{{< include file="/data/properties/demo.yaml" language="Yaml" options="linenos=table" >}}
Example
{{< propertylist name=demo sort=name order=asc >}}