Added mircodata
authorMarcel Werk <burntime@woltlab.com>
Sun, 10 Jul 2016 22:12:05 +0000 (00:12 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 10 Jul 2016 22:12:39 +0000 (00:12 +0200)
com.woltlab.wcf/templates/article.tpl

index 3082c864db5e0db4bfc0b2a25bca76d950523cd2..b46be86c81a25dc11046978ee963d516234243b8 100644 (file)
                {/foreach}
        {/if}
        <link rel="amphtml" href="{link controller='ArticleAmp' object=$articleContent}{/link}">
+       
+       <script type="application/ld+json">
+               {
+                       "@context": "http://schema.org",
+                       "@type": "NewsArticle",
+                       "@id": "{$canonicalURL}",
+                       "headline": "{$articleContent->title}",
+                       "datePublished": "{@$article->time|plainTime}",
+                       "dateModified": "{@$article->time|plainTime}",
+                       "description": "{@$articleContent->getFormattedTeaser()}",
+                       "author": {
+                               "@type": "Person",
+                               "name": "{$article->username}"
+                       },
+                       "publisher": {
+                               "@type": "Organization",
+                               "name": "{PAGE_TITLE|language}",
+                               "logo": {
+                                       "@type": "ImageObject",
+                                       "url": "{@$__wcf->getPath()}images/default-logo.png",{* @TODO *}
+                                       "width": 288,
+                                       "height": 40
+                               }
+                       }
+                       {if $articleContent->getImage()}
+                       ,"image": {
+                               "@type": "ImageObject",
+                               "url": "{$articleContent->getImage()->getThumbnailLink('large')}",
+                               "width": {@$articleContent->getImage()->getThumbnailWidth('large')},
+                               "height": {@$articleContent->getImage()->getThumbnailHeight('large')}
+                       }
+                       {/if}
+               }
+       </script>
 {/capture}
 
 {include file='header'}
                                <div class="articleAboutAuthorText">{$article->getUserProfile()->aboutMe}</div>
                                
                                <div class="articleAboutAuthorUsername">
-                                       <a href="{link controller='User' object=$article->getUserProfile()->getDecoratedObject()}{/link}" class="username userLink" data-user-id="{@$article->getUserProfile()->userID}" rel="author">{if MESSAGE_SIDEBAR_ENABLE_USER_ONLINE_MARKING}{@$article->getUserProfile()->getFormattedUsername()}{else}{$article->getUserProfile()->username}{/if}</a>
+                                       <a href="{link controller='User' object=$article->getUserProfile()->getDecoratedObject()}{/link}" class="username userLink" data-user-id="{@$article->getUserProfile()->userID}">{if MESSAGE_SIDEBAR_ENABLE_USER_ONLINE_MARKING}{@$article->getUserProfile()->getFormattedUsername()}{else}{$article->getUserProfile()->username}{/if}</a>
                                        
                                        {if MODULE_USER_RANK}
                                                {if $article->getUserProfile()->getUserTitle()}