-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html.php
More file actions
140 lines (127 loc) · 7.04 KB
/
main.html.php
File metadata and controls
140 lines (127 loc) · 7.04 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
<?php if (isset($is_front)):?>
<article class="first-entry home-info">
<header class="entry-header">
<h1><?php echo blog_title();?></h1>
</header>
<div class="entry-content">
<?php echo blog_description();?>
</div>
<footer class="entry-footer">
<div class="social-icons">
<?php echo social();?>
</div>
</footer>
</article>
<?php endif;?>
<?php if (isset($is_category)):?>
<header class="page-header">
<div class="breadcrumbs"><?php echo $breadcrumb;?></div>
<h1><?php echo $category->title;?> <a href="<?php echo $category->url;?>/feed"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg></a></h1>
<div class="entry-content">
<div><?php echo $category->body;?></div>
</div>
</header>
<?php endif;?>
<?php if (isset($is_tag)):?>
<header class="page-header">
<div class="breadcrumbs"><?php echo $breadcrumb;?></div>
<h1><?php echo $tag->title;?> <a href="<?php echo $tag->url;?>/feed"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg></a></h1>
</header>
<?php endif;?>
<?php if (isset($is_archive)):?>
<header class="page-header">
<div class="breadcrumbs"><?php echo $breadcrumb;?></div>
<h1><?php echo $archive->title;?> <a href="<?php echo $archive->url;?>/feed"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg></a></h1>
</header>
<?php endif;?>
<?php if (isset($is_search)):?>
<header class="page-header">
<div class="breadcrumbs"><?php echo $breadcrumb;?></div>
<h1><?php echo $search->title;?> <a href="<?php echo $search->url;?>/feed"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg></a></h1>
</header>
<?php endif;?>
<?php if (isset($is_type)):?>
<header class="page-header">
<div class="breadcrumbs"><?php echo $breadcrumb;?></div>
<h1><?php echo $type->title;?> <a href="<?php echo $type->url;?>/feed"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg></a></h1>
</header>
<?php endif;?>
<?php if (isset($is_blog)):?>
<header class="page-header">
<div class="breadcrumbs"><?php echo $breadcrumb;?></div>
<h1>Blog <a href="<?php echo site_url();?>feed/rss"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg></a></h1>
</header>
<?php endif;?>
<?php foreach ($posts as $post):?>
<?php $img = get_image($post->body);?>
<article class="post-entry">
<?php if (!empty($post->image)) {?>
<figure class="entry-cover"><a href="<?php echo $post->url;?>"><img title="<?php echo $post->title;?>" src="<?php echo $post->image;?>" width="100%"></a></figure>
<?php } elseif (!empty($img) && empty($post->quote) && empty($post->video) && empty($post->audio)) { ?>
<figure class="entry-cover"><a href="<?php echo $post->url;?>"><img title="<?php echo $post->title;?>" src="<?php echo $img;?>" width="100%"></a></figure>
<?php } ?>
<?php if(!empty($post->video)):?>
<iframe width="100%" height="315px" class="embed-responsive-item media-wrapper" src="https://www.youtube.com/embed/<?php echo get_video_id($post->video); ?>" frameborder="0" allowfullscreen></iframe>
<?php endif;?>
<?php if(!empty($post->audio)):?>
<iframe width="100%" height="200px" class="embed-responsive-item media-wrapper" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $post->audio;?>&auto_play=false&visual=true"></iframe>
<?php endif;?>
<?php if(!empty($post->quote)):?>
<div class="post-content">
<blockquote class="quote" style="margin-top:0;"><?php echo $post->quote ?></blockquote>
</div>
<?php endif;?>
<header class="entry-header">
<?php if(!empty($post->link)) { ?>
<h2 class="entry-hint-parent"><a target="_blank" href="<?php echo $post->link;?>"><?php echo $post->title;?></a> <svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" width="20"><path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path><path d="M15 3h6v6"></path><path d="M10 14L21 3"></path></svg>
</h2>
<?php } else {?>
<h2 class="entry-hint-parent"><a href="<?php echo $post->url;?>"><?php echo $post->title;?></a></h2>
<?php } ?>
</header>
<div class="entry-content">
<p><?php echo $post->description;?> [...]</p>
</div>
<footer class="entry-footer"><span><?php echo format_date($post->date);?></span> · <?php echo $post->readTime;?> min · <a href="<?php echo $post->authorUrl;?>"><?php echo $post->authorName;?></a><?php if (disqus_count()):?> · <a href="<?php echo $post->url ?>#disqus_thread"> <?php echo i18n('Comments');?></a><?php endif;?><?php if (facebook()):?><a href="<?php echo $post->url ?>#comments"><span><fb:comments-count href=<?php echo $post->url ?>></fb:comments-count> <?php echo i18n('Comments');?></span></a><?php endif;?><?php if(authorized($post)):?></a> · <a href="<?php echo $post->url;?>/edit?destination=post"><?php echo i18n('edit');?></a><?php endif;?></footer>
</article>
<?php endforeach;?>
<footer class="page-footer">
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
<nav class="pagination">
<?php if (!empty($pagination['prev'])): ?>
<a href="?page=<?php echo $page - 1 ?>" class="prev"s rel="prev">« <?php echo i18n('Newer'); ?></a>
<?php endif; ?>
<?php if (!empty($pagination['next'])): ?>
<a href="?page=<?php echo $page + 1 ?>" class="next" rel="next"><?php echo i18n('Older'); ?> »</a>
<?php endif; ?>
</nav>
<?php endif;?>
</footer>
<?php if (disqus_count()): ?>
<?php echo disqus_count() ?>
<?php endif; ?>