{generate:section}

Description

Marks the spot in a site-module page where AA should drop the CSS and JavaScript that the rest of the page asked for. You normally place generate:HEAD just before the closing head tag and generate:FOOT just before the closing body tag. AA collects every library, stylesheet and script registered by require, css, eucookies, widgets and other commands across the whole page render, removes duplicates, orders libraries before the code that depends on them, and writes the head part at generate:HEAD and the footer part at generate:FOOT. Without these two markers the collected includes have nowhere to go and page features that depend on them stop working. Internally generate does not output the links immediately: it emits a placeholder comment (AAGenerate plus the section name) and registers a final postprocess pass that replaces the placeholder once the page is fully built. Because of this it only does its job when the page is finished by the Site module (or by an item-edit form), and its result depends on what the page required, so it is not a fixed string. generate is never cached - it is recomputed on every request. Google Analytics consent wiring is handled by the same pass when a tracking id and a consent bar are configured.

Parameters

section optional default (empty)

Which part of the page to render: HEAD for the head includes (stylesheets, early scripts) or FOOT for the footer includes (deferred libraries, init code). The two markers split the collected requires into a head block and a footer block. Empty or any other word simply emits the matching placeholder comment, which stays in the page because nothing fills it - in practice you use HEAD and FOOT.

Examples

virtual<head>{generate:HEAD}</head><body>...{generate:FOOT}</body>
Expected(head includes inside , footer scripts before )
Actual ...
The canonical site-module pattern: HEAD in the head, FOOT at the end of the body. This is the layout AA expects so that require, css, eucookies and widget scripts all land in the right place. Output depends on what the page required.
virtual{generate:FOOT}
Expected(the deferred
Put this once inside the page head element. On a finished Site page AA replaces it with all the stylesheets and head scripts the page required. At expand time on its own it only emits the placeholder comment, so the output depends on the whole page - it is illustrative, not a fixed value.
virtual{require:aa-jslib}{generate:HEAD}
Expected(the aa-jslib
require and css register includes; generate:HEAD and generate:FOOT are where they come out. Here require asks for the aa-jslib library and generate:HEAD renders its script tag. On a real page many commands contribute; the exact tags depend on the whole page.