You are here

protected function AmpPrepareMetadataJson::prepareAuthor in Accelerated Mobile Pages (AMP) 8

Prepare author information.

1 call to AmpPrepareMetadataJson::prepareAuthor()
AmpPrepareMetadataJson::prepareMetadataJson in src/Utility/AmpPrepareMetadataJson.php
Prepares a metadata array to be ready for JSON conversion.

File

src/Utility/AmpPrepareMetadataJson.php, line 182

Class

AmpPrepareMetadataJson
Class AmpPrepareMetadataJson

Namespace

Drupal\amp\Utility

Code

protected function prepareAuthor() {
  if (isset($this->ampMetadataSettings['content_author_token']) && !empty($this->ampMetadataSettings['content_author_token'])) {
    $this->ampPreparedMetadataJson['author'] = [
      '@type' => 'Person',
      'name' => PlainTextOutput::renderFromHtml($this->token
        ->replace($this->ampMetadataSettings['content_author_token'], [
        'node' => $this->node,
      ])),
    ];
  }
}