<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
	  xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
	  data-namespace-typo3-fluid="true">

<f:if condition="{newsItem.alternativeTitle}">
	<f:then><n:metaTag property="og:title" content="{newsItem.alternativeTitle}" /></f:then>
	<f:else><n:metaTag property="og:title" content="{newsItem.title}" /></f:else>
</f:if>
<n:metaTag property="og:type" content="{settings.opengraph.type}" />
<n:metaTag property="og:url" content="" useCurrentDomain="1" />
<n:metaTag property="og:site_name" content="{settings.opengraph.site_name}" />
<f:if condition="{newsItem.media.0}">
    <f:variable name="ogImagePath" value="{f:uri.image(src:'{newsItem.media.0.uid}', treatIdAsReference:1, maxWidth:'1200')}" />
	<n:metaTag
		property="og:image"
		content="{ogImagePath}"
		forceAbsoluteUrl="1" />
	<n:metaTag property="og:image:width" content="{n:imageSize(property:'width', image:'{ogImagePath}')}" />
	<n:metaTag property="og:image:height" content="{n:imageSize(property:'height', image:'{ogImagePath}')}" />
</f:if>

<f:if condition="{newsItem.description}">
	<f:then>
		<n:metaTag name="description" content="{newsItem.description}" />
		<n:metaTag property="og:description" content="{newsItem.description}" />
	</f:then>
	<f:else>
		<n:metaTag name="description" content="{newsItem.teaser -> f:format.stripTags()}" />
		<n:metaTag property="og:description" content="{newsItem.teaser -> f:format.stripTags()}" />
	</f:else>
</f:if>
<n:metaTag name="keywords" content="{newsItem.keywords}" />
<n:metaTag property="fb:admins" content="{settings.opengraph.admins}" />
<n:metaTag property="og:locale" content="{settings.opengraph.locale}" />
<f:if condition="{settings.opengraph.twitter.site}">
	<n:metaTag name="twitter:card" content="{settings.opengraph.twitter.card}" />
	<n:metaTag name="twitter:site" content="{settings.opengraph.twitter.site}" />
	<n:metaTag name="twitter:creator" content="{settings.opengraph.twitter.creator}" />
</f:if>
</html>
