Using Extensions
Extensions provide a convenient way of turning custom PHP code into Automad statements. Besides the fact that extensions have to be called by their names including their namespace, the syntax is the same as for Toolbox or pipe functions.
<# Generic extension. #>
<@ namespace/name { options } @>
<# Custom pipe function. #>
@{ variable | namespace/name }
Find out more about developing extensions here.
Example
A good example to visualize how to use extensions is the MetaTag extension. As mentioned above the basic syntax is similar to Toolbox methods.
<head>
<@ Automad/MetaTags {
description: @{ metaDescription | def(@{ text | stripTags }) },
ogTitle: @{ ogTitle | def('@{ sitename } / @{ title }') },
ogDescription: @{ ogDescription | def(@{ text | stripTags }) },
ogType: 'website',
ogImage: @{ ogImage | def('/shared/og*.png') }
} @>
<# Add some CSS or JS tags here ... #>
</head>