Run template functions based on data attributes
Instead of relying on pages that use the template to run
header() and similar functions, the template should run those functions based on the data embedded in, say, the meta tags or based on data attributes attached to the
body. For example, using meta tags, the page using the template could include
<meta name="fwd:nav:name" value="/Tools/" /> <meta name="fwd:header:title" value="Tools" /> <meta name="fwd:header:description" value="An overview of tools I have created" /> <meta name="fwd:footer:vscURL" value="https://git.fwdekker.com/FWDekker/tools/" /> <meta name="fwd:footer:version" value="v1.4.2" />
Maybe some tags (such as
fwd:header:description) are not necessary since there is also the
description meta tag already. (But maybe I'll just keep the duplicate tag.)
Not including the tag means that
undefined is passed to the function. Not including the
value attribute in the tag means
null is passed to the function. Using
value="" means that the empty string is passed to the function.
Not including any
fwd:footer:* tags at all means that the template will not run its
footer function. To run
footer with all
undefined values, the tag
fwd:footer should be added without the value attribute.
The advantage of this method is that pages such as the error pages do not need to include and compile scripts, which simplifies the page.
Deleting a branch is permanent. It CANNOT be undone. Continue?