Context

Pagelists & Tags
A pagelist is essentially a curated selection of pages that are rendered using a shared template. Each page in the selection is iterated and displayed in a consistent way, which makes pagelists suitable for many common use cases. They can power a simple navigation, but they work just as well for more visual layouts, such as a portfolio grid or blog where each entry shows a preview, title, or other page-specific information.
Pagelist
The pagelist contains by default all pages that are not hidden and has no specific type. Changing the type of the pagelist updates the selection of pages accordingly. The main purpose of the pagelist is to provide an easy way of iterating a defined set of pages using a foreach loop, for example to build navigations, blog indexes, search results or lists of related pages.
foreach
The foreach loop iterates collections and lists of files. Depending on the type of list, Automad provides different runtime variables within the code block of the loop to refer to the current item. The :i variable always contains the index of the current iteration.
with
The with statement processes a block of code within the context of a given page or file. When using the URL of a page or one of the keywords prev and next as argument, the context changes to that page. When using a file path, the related runtime variables can be used and images can be resized or cropped directly. In case there is no matching page or file, an optional else block is processed instead.