I’m referring to
Under the heading “Methods/byType” it says that
resources.byType "image" returns all images in a page bundle. If that is to mean that the images from the
image directory in the example configuration at the start of this page are returned, it would be helpful to explicitly state that, I think. Something like “This will return
The next section (“Match”) uses the sample code
resource.Match ("images/*). If this does indeed return exactly the same entries as the example before under “byType”, the documentation should say so. Also, this section (“Match”) says that the result is returned as a slice. This detail is missing from the “byType” section. It would make things clearer if this fact would be either mentioned once unter the “Methods” heading or for every method where it is appropriate (and of course explicitly stating what the other methods do return instead).
In fact, I’d suggest to explicitly state that all methods return a special type of data, namely resource(s) that might be processed further with specialized methods like those for images.
Also, the whole section on “Page Resources” starts with a sample directory layout using the images “a/b/c.jpg”. However, the example right under the heading “Pattern Matching” uses some image called “sunset.jpg”. This is unexpected and has no relation to the afore mentioned sample layout. To make the whole thing more consistent, I suggest to use images “sunset/sunrise/moonrise.jpg” in the sample layout (and also in the explanations for “byType” and “Matches”). Then one could amend the example under “Pattern Matching” clearer by explicitly stating which images are returned by the working method calls (i.e. those marked with a green checkmark now).