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