forked from TryGhost/Ease
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.hbs
54 lines (48 loc) · 1.88 KB
/
index.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{{!< default}}
<div class="gh-outer">
<main class="site-main gh-inner">
{{#if @custom.show_featured_posts}}
{{> "featured-posts"}}
{{/if}}
{{#get "tags" limit="all"}}
<div class="topic-feed">
{{#foreach tags}}
<section class="topic" data-name="{{name}}">
<header class="topic-header">
<h2 class="topic-name">
<a href="{{url}}">{{name}}</a>
</h2>
</header>
{{#get "posts" order="published_at desc" filter="tag:{{slug}}" limit="5" as |featured|}}
<ul class="topic-article-feed">
{{#foreach featured}}
<li class="topic-article">
<h3 class="topic-article-title">
<a class="topic-article-link" href="{{url}}">
{{> "icons/chevron-right"}} {{title}}
</a>
<time style="font-style: italic; color: grey;" datetime="{{date format="YYYY-MM-DD"}}">({{date format="D MMM YYYY"}})</time>
</h3>
</li>
{{/foreach}}
</ul>
{{/get}}
<a class="topic-more" href="{{url}}">Show all →</a>
</section>
{{/foreach}}
</div>
{{/get}}
</main>
</div>
<script>
window.onload = function () {
$('.topic').each(function(){
if($(this).find('.topic-article').length < 5){
$(this).find('.topic-more').hide();
}
if(!['Paid media campaigning', 'Policy recommendations and submissions', 'Public opinion research', 'Regular campaign updates'].includes($(this).data('name'))){
$(this).find('time').hide();
}
});
};
</script>