class PostProcessor (View source)

The post-processor class.

Properties

private $Automad The Automad instance.
private $headless A boolean variable that contains the headless state
private $InPage The InPage instance.

Methods

__construct(Automad $Automad, InPage $InPage, bool $headless)

The post-processor constructor.

string
process(string $output)

Run all required post-process steps.

string
addCacheBustingTimestamps(string $str)

Find all locally hosted assests and append a timestamp in order to avoid serving outdated files.

string
addMetaTags(string $str)

Add meta tags to the head of $str.

string
createExtensionAssetTags(string $str)

Create the HTML tags for each file in the asset collection and prepend them to the closing tag.

string
obfuscateEmails(string $str)

Obfuscate all stand-alone eMail addresses matched in $str.

string
resizeImages(string $str)

Resize any image in the output in case it has a specified size as query string like for example "/shared/image.jpg?200x200".

Details

__construct(Automad $Automad, InPage $InPage, bool $headless)

The post-processor constructor.

Parameters

Automad $Automad
InPage $InPage
bool $headless

string process(string $output)

Run all required post-process steps.

Parameters

string $output

Return Value

string the final output

private string addCacheBustingTimestamps(string $str)

Find all locally hosted assests and append a timestamp in order to avoid serving outdated files.

Parameters

string $str

Return Value

string the processed output

private string addMetaTags(string $str)

Add meta tags to the head of $str.

Parameters

string $str

Return Value

string The meta tag

private string createExtensionAssetTags(string $str)

Create the HTML tags for each file in the asset collection and prepend them to the closing tag.

Parameters

string $str

Return Value

string The processed string

private string obfuscateEmails(string $str)

Obfuscate all stand-alone eMail addresses matched in $str.

Addresses in links are ignored. In headless mode, obfuscation is disabled.

Parameters

string $str

Return Value

string The processed string

private string resizeImages(string $str)

Resize any image in the output in case it has a specified size as query string like for example "/shared/image.jpg?200x200".

Parameters

string $str

Return Value

string The processed string