Merge branch '3.0'
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / ampArticle.tpl
1 {capture assign='pageTitle'}{$articleContent->title}{/capture}
2
3 {capture assign='headContent'}
4 <script type="application/ld+json">
5 {
6 "@context": "http://schema.org",
7 "@type": "NewsArticle",
8 "mainEntityOfPage": "{$regularCanonicalURL}",
9 "headline": "{$articleContent->title}",
10 "datePublished": "{@$article->time|date:'c'}",
11 "dateModified": "{@$article->time|date:'c'}",
12 "description": "{@$articleContent->getFormattedTeaser()}",
13 "author": {
14 "@type": "Person",
15 "name": "{$article->username}"
16 },
17 "publisher": {
18 "@type": "Organization",
19 "name": "{PAGE_TITLE|language}",
20 "logo": {
21 "@type": "ImageObject",
22 "url": "{$__wcf->getStyleHandler()->getStyle()->getPageLogo()}",
23 "width": {@$__wcf->getStyleHandler()->getStyle()->getVariable('pageLogoWidth')},
24 "height": {@$__wcf->getStyleHandler()->getStyle()->getVariable('pageLogoHeight')}
25 }
26 }
27 {if $articleContent->getImage()}
28 ,"image": {
29 "@type": "ImageObject",
30 "url": "{$articleContent->getImage()->getThumbnailLink('large')}",
31 "width": {@$articleContent->getImage()->getThumbnailWidth('large')},
32 "height": {@$articleContent->getImage()->getThumbnailHeight('large')}
33 }
34 {/if}
35 }
36 </script>
37 {/capture}
38
39 {include file='ampHeader'}
40
41 <article class="article">
42 <header class="articleHeader">
43 <h1 class="articleTitle">{$articleContent->title}</h1>
44 <h2 class="articleAuthor">{$article->username}</h2>
45 <time class="articleDate" datetime="{@$article->time|date:'c'}">{@$article->time|plainTime}</time>
46 </header>
47
48 {if $articleContent->getImage()}
49 <figure class="articleImage">
50 <amp-img src="{$articleContent->getImage()->getThumbnailLink('large')}" alt="{$articleContent->getImage()->altText}" height="{@$articleContent->getImage()->getThumbnailHeight('large')}" width="{@$articleContent->getImage()->getThumbnailWidth('large')}" layout="responsive"></amp-img>
51 {if $articleContent->getImage()->caption}
52 <figcaption>{$articleContent->getImage()->caption}</figcaption>
53 {/if}
54 </figure>
55 {/if}
56
57 {if $articleContent->teaser}
58 <div class="articleTeaser">
59 <p>{@$articleContent->getFormattedTeaser()}</p>
60 </div>
61 {/if}
62
63 <div class="articleContent">
64 {@$articleContent->getAmpFormattedContent()}
65 </div>
66 </article>
67
68 {hascontent}
69 <section class="section">
70 <h2 class="sectionTitle">{lang}wcf.article.moreArticles{/lang}</h2>
71
72 <amp-carousel width="400" height="300" layout="responsive" type="slides" autoplay delay="5000">
73 {content}
74 {foreach from=$additionalArticles item='additionalArticle'}
75 {if $additionalArticle->getTeaserImage()}
76 <a href="{link controller='ArticleAmp' object=$additionalArticle->getArticleContent()}{/link}">
77 <figure>
78 <amp-img src="{$additionalArticle->getTeaserImage()->getThumbnailLink('large')}" layout="fill"></amp-img>
79 <figcaption>{$additionalArticle->getTitle()}</figcaption>
80 </figure>
81 </a>
82 {/if}
83 {/foreach}
84 {/content}
85 </amp-carousel>
86 </section>
87 {/hascontent}
88
89 {if $relatedArticles !== null && $relatedArticles|count}
90 {hascontent}
91 <section class="section">
92 <h2 class="sectionTitle">{lang}wcf.article.relatedArticles{/lang}</h2>
93
94 <amp-carousel width="400" height="300" layout="responsive" type="slides" autoplay delay="5000">
95 {content}
96 {foreach from=$relatedArticles item='relatedArticle'}
97 {if $relatedArticle->getTeaserImage()}
98 <a href="{link controller='ArticleAmp' object=$relatedArticle->getArticleContent()}{/link}">
99 <figure>
100 <amp-img src="{$relatedArticle->getTeaserImage()->getThumbnailLink('large')}" layout="fill"></amp-img>
101 <figcaption>{$relatedArticle->getTitle()}</figcaption>
102 </figure>
103 </a>
104 {/if}
105 {/foreach}
106 {/content}
107 </amp-carousel>
108 </section>
109 {/hascontent}
110 {/if}
111
112 {include file='ampFooter'}