Closed revosw closed 6 years ago
Hi @revosw
As you may have noticed, this repo is no longer maintained since we have moved everything over to the official Hugo org. I agree with some of your points, but please open all issues here:
https://github.com/gohugoio/hugoDocs
Thanks much for your contributions and considered support of Hugo :smile:
I see many issues here writing about what to document, but not how. Now, while I do believe you guys are way more experienced than me writing documentation, I just want to give my two cents.
The 5W1H method, or at least at minimum what, why and how, should be used to explain the various Hugo approaches and features.
Let's take an example,
shuffle
What
shuffle
is a Hugo function that takes a collection (also known as an array, or list) as an argument. It is used to randomize the order of the indeces (elements) in a collection.Why (This can also include "When", talk about some use cases)
shuffle
can be used as part of a random text or number generator. This can solve a problem with twoSite.Menu.<menu>
pages having the same name.Since Hugo internally automatically sets the
identity
of the page to the title, two pages with the same identity that is contained within the same menu would clash. By setting the identity to something random, we can prevent this error, and multiple pages can have the same name, even if it is placed within the same menu.How
To use
shuffle
, you can either use enclosement with parenthesis:{{ shuffle ( slice "a" "b" "c" ) }}
Or by piping:{{ slice "a" "b" "c" | shuffle }}
Or use it on a variable:{{ shuffle $array }}
My point of this is that the documentation should not just contain the what and a little bit of how, but also explain why it even exists. What problems does it solve?