<xf:if is="$article.meta_description">
<xf:set var="$descSnippet" value="{{ snippet($article.meta_description, 250, {'stripBbCode': true}) }}" />
<xf:elseif is="$article.description" />
<xf:set var="$descSnippet" value="{{ snippet($article.description, 250, {'stripBbCode': true}) }}" />
<xf:else />
<xf:set var="$descSnippet" value="{{ snippet($article.message, 250, {'stripBbCode': true}) }}" />
</xf:if>
<xf:macro template="metadata_macros" name="metadata"
arg-description="{$descSnippet}"
arg-type="article"
arg-shareUrl="{{ link('canonical:ams', $article) }}"
arg-canonicalUrl="{{ link('canonical:ams', $article, {'page': $page > 1 ? $page : null}) }}"
arg-imageUrl="{{ $article.CoverImage ? link('canonical:ams/cover-image', $article) : ($article.Category.content_image ? base_url('styles/default/xenaddons/ams/category_images/' . {$article.Category.content_image}, true) : '') }}"
arg-twitterCard="summary_large_image" />
<xf:page option="ldJsonHtml">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CreativeWorkSeries",
"@id": "{{ link('canonical:ams', $article)|escape('json') }}",
"name": "{$article.title|escape('json')}",
"headline": "{$article.title|escape('json')}",
"alternativeHeadline": "{$article.title|escape('json')}",
"description": "{$descSnippet|escape('json')}",
<xf:if is="$article.cover_image_id">
"thumbnailUrl": "{{ ams_article_thumbnail($article)|escape('json') }}",
<xf:elseif is="$article.Category.content_image" />
"thumbnailUrl": "{{ ams_category_icon($article)|escape('json') }}",
</xf:if>
"dateCreated": "{{ date($article.publish_date, 'c')|escape('json') }}",
"dateModified": "{{ date($article.last_update, 'c')|escape('json') }}",
<xf:if is="$article.rating_count">"aggregateRating": {
"@type": "AggregateRating",
"ratingCount": "{$article.rating_count|escape('json')}",
"ratingValue": "{$article.rating_avg|escape('json')}"
},</xf:if>
<xf:if is="$article.hasViewableDiscussion()">
"discussionUrl": "{{ link('canonical:threads', $article.Discussion)|escape('json') }}",
</xf:if>
<xf:if is="$article.User.Profile.xa_ams_author_name">
"author": {
"@type": "Person",
"name": "{$article.User.Profile.xa_ams_author_name|escape('json')}"
}
<xf:else />
"author": {
"@type": "Person",
"name": "{{ ($article.User ? $article.User.username : $article.username)|escape('json') }}"
}
</xf:if>
}
</script>
</xf:page>