-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (50 loc) · 1.66 KB
/
index.html
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
55
56
---
layout: default
---
<div x-data="{ stories: [] }"
x-effect="stories = await getItems(current, page)">
<template x-for="story, index in stories">
<div class="item my-1">
<div>
<p class="item-no" x-text="page == 1 ? index + 1 : ((page - 1) * stories.length) + (index + 1)"></p>
</div>
<div>
<template x-if="story.hasOwnProperty('domain')">
<a :href="story.url" target="_blank" rel="noopener noreferrer">
<p>
<span x-text="story.title" class="text-bold"></span>
<span x-text="`(${story.domain})`"></span>
</p>
</a>
</template>
<template x-if="!story.hasOwnProperty('domain')">
<a :href="getItemLink(story.id)">
<p>
<span x-text="story.title" class="text-bold"></span>
</p>
</a>
</template>
<p>
<span x-text="story.points"></span>
<span> points by </span>
<a :href="getUserLink(story.user)">
<span x-text="story.user" class="text-underline"></span>
</a>
<span> | </span>
<span x-text="story.time_ago"></span>
<span> | </span>
<a :href="getItemLink(story.id)" class="text-underline">
<span x-text="story.comments_count"></span>
<span> comments</span>
</a>
</p>
</div>
</div>
</template>
<div class="text-center my-2">
<h3><a :href="`/?section=${current}&page=${Number(page) + 1}`" class="text-bold">More »</a></h3>
</div>
<div class="text-center">
<a href="/about" class="text-underline">About</a>
</div>
</div>