-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlayout.html.php
More file actions
257 lines (237 loc) · 10.6 KB
/
layout.html.php
File metadata and controls
257 lines (237 loc) · 10.6 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
<!DOCTYPE html>
<html lang="<?php echo blog_language();?>">
<head>
<?php echo head_contents();?>
<?php echo $metatags;?>
<link rel="stylesheet" type="text/css" href="<?php echo theme_path();?>css/style.css?v=1">
<?php if (theme_config('casper_dark')) :?>
<link rel="stylesheet" type="text/css" href="<?php echo theme_path();?>css/dark.css">
<?php endif;?>
</head>
<?php if (isset($is_front)) {?>
<body class="home-template">
<?php if (login()) { toolbar(); } ?>
<div class="site-wrapper">
<header class="site-home-header">
<?php if (empty(theme_config('casper_header'))):?>
<style type="text/css">.responsive-header-img {background-image: url(<?php echo theme_path();?>images/publication-cover.jpg);}</style>
<?php else: ?>
<style type="text/css">.responsive-header-img {background-image: url(<?php echo theme_config('casper_header')?>);}</style>
<?php endif; ?>
<div class="outer site-header-background responsive-header-img">
<?php } elseif (isset($is_post) || isset($is_page) || isset($is_subpage) || isset($is_404) || isset($is_404search)) {?>
<body class="post-template">
<?php if (login()) { toolbar(); } ?>
<div class="site-wrapper">
<header class="site-header">
<div class="outer site-nav-main" <?php if (login()):?>style="position:relative;"<?php endif;?>>
<?php } else {?>
<body class="tag-template">
<?php if (login()) { toolbar(); } ?>
<div class="site-wrapper">
<header class="site-archive-header">
<div class="outer site-nav-main" <?php if (login()):?>style="position:relative;"<?php endif;?>>
<?php } ?>
<div class="inner">
<nav class="site-nav">
<div class="site-nav-left-wrapper">
<div class="site-nav-left">
<a class="site-nav-logo" href="<?php echo site_url();?>"><img src="<?php echo theme_path();?>images/avatar.png" alt="<?php echo blog_title();?>"></a>
<div class="site-nav-content">
<?php echo menu();?>
</div>
</div>
</div>
<div class="site-nav-right">
<div class="social-links">
<?php echo social();?>
</div>
</div>
</nav>
<?php if (isset($is_front)):?>
<div class="site-header-content">
<h1 class="site-title"><?php echo blog_title();?></h1>
<h2 class="site-description"><?php echo blog_tagline();?></h2>
</div>
<?php endif;?>
</div>
</div>
<?php if (isset($is_profile)):?>
<div class="outer site-header-background no-image">
<div class="inner site-header-content author-header">
<img class="author-profile-image" src="<?php echo $author->avatar;?>" alt="<?php echo $author->name;?>">
<div class="author-header-content">
<h1 class="site-title"><?php echo $author->name;?></h1>
<style>.author-bio p {margin:0;}</style>
<div class="author-bio"><?php echo $author->about;?></div>
<div class="author-meta">
<span class="author-social-link"><a href="<?php echo site_url();?>" target="_blank" rel="noopener">Website</a></span>
<?php if(!empty(config('social.twitter'))):?><span class="author-social-link"><a href="<?php echo config('social.twitter');?>" target="_blank" rel="noopener">Twitter</a></span><?php endif;?>
<?php if(!empty(config('social.facebook'))):?><span class="author-social-link"><a href="<?php echo config('social.facebook');?>" target="_blank" rel="noopener">Facebook</a></span><?php endif;?>
</div>
</div>
</div>
</div>
<?php endif;?>
<?php if (isset($is_archive)):?>
<div class="outer site-header-background no-image">
<div class="inner site-header-content">
<h1 class="site-title"><?php echo $archive->title;?></h1>
</div>
</div>
<?php endif;?>
<?php if (isset($is_category)):?>
<div class="outer site-header-background no-image">
<div class="inner site-header-content">
<h1 class="site-title"><?php echo $category->title;?></h1>
<div class="site-description">
<?php echo $category->body; ?>
</div>
</div>
</div>
<?php endif;?>
<?php if (isset($is_tag)):?>
<div class="outer site-header-background no-image">
<div class="inner site-header-content">
<h1 class="site-title"><?php echo $tag->title;?></h1>
</div>
</div>
<?php endif;?>
<?php if (isset($is_search)):?>
<div class="outer site-header-background no-image">
<div class="inner site-header-content">
<h1 class="site-title"><?php echo $search->title;?></h1>
</div>
</div>
<?php endif;?>
<?php if (isset($is_type)):?>
<div class="outer site-header-background no-image">
<div class="inner site-header-content">
<h1 class="site-title"><?php echo $type->title;?></h1>
</div>
</div>
<?php endif;?>
</header>
<main id="site-main" class="site-main outer">
<div class="inner">
<?php echo content();?>
</div>
</main>
<?php if (isset($is_post)):?>
<aside class="read-next outer">
<div class="inner">
<div class="read-next-feed">
<?php $recent = recent_posts(true);?>
<article class="read-next-card">
<header class="read-next-card-header">
<h3><?php echo i18n('Recent_posts');?></h3>
</header>
<div class="read-next-card-content">
<ul>
<?php foreach ($recent as $r): ?>
<li style="padding-bottom:0;">
<h4><a href="<?php echo $r->url;?>"><?php echo $r->title;?></a></h4>
<div class="read-next-card-meta">
<p><time><?php echo format_date($r->date) ?></time></p>
</div>
</li>
<?php endforeach;?>
</ul>
</div>
<footer class="read-next-card-footer" style="margin-bottom:25px;">
<?php echo i18n('All_blog_posts');?>: <?php echo $p->category;?>
</footer>
</article>
<?php if (!empty($next)): ?>
<article class="post-card post" style="min-height:20px;padding:0 0 20px 0;margin:0px 25px 25px 25px;">
<div class="post-card-content">
<a class="post-card-content-link" href="<?php echo($next['url']); ?>">
<header class="post-card-header" style="margin:0;">
<div class="post-card-primary-tag"><?php echo i18n('Next_post');?></div>
<?php $img = get_image($next['body']);?>
<?php if (!empty($next['image'])) { ?>
<img class="post-card-image" alt="<?php echo $next['title'];?>" style="margin-bottom:15px;" src="<?php echo $next['image'];?>">
<?php } elseif (!empty($img) && empty($next['quote']) && empty($next['video']) && empty($next['audio'])) { ?>
<img class="post-card-image" alt="<?php echo $next['title'];?>" style="margin-bottom:15px;" src="<?php echo $img;?>">
<?php } ?>
<?php if (!empty($next['video'])) { ?>
<span class="post-card-image-link" style="margin-bottom:15px;">
<img src="//img.youtube.com/vi/<?php echo get_video_id($next['video']);?>/sddefault.jpg" width="100%">
</span>
<?php } ?>
<?php if (!empty($next['audio'])) { ?>
<span class="post-card-image-link" style="margin-bottom:15px;">
<img src="<?php echo theme_path();?>images/soundcloud.jpg" width="100%">
</span>
<?php } ?>
<?php if (!empty($next['quote'])) { ?>
<blockquote class="post-card-title"><p><?php echo $next['quote']; ?></p></blockquote>
<?php } ?>
<h2 class="post-card-title"><?php echo($next['title']); ?></h2>
</header>
<section class="post-card-excerpt">
<?php echo($next['description']); ?>
</section>
</a>
<footer class="post-card-meta">
<span class="post-card-byline-date"><time><?php echo format_date($next['date']) ?></time> <span class="bull">•</span><?php echo $next['category'];?></span>
</footer>
</div>
</article>
<?php endif;?>
<?php if (!empty($prev)): ?>
<article class="post-card post" style="min-height:20px;padding:0 0 20px 0;margin:0 25px 25px 25px;">
<div class="post-card-content">
<a class="post-card-content-link" href="<?php echo($prev['url']); ?>">
<header class="post-card-header" style="margin:0;">
<div class="post-card-primary-tag"><?php echo i18n('Prev_post');?></div>
<?php $img = get_image($prev['body']);?>
<?php if (!empty($prev['image'])) { ?>
<img class="post-card-image" alt="<?php echo $prev['title'];?>" style="margin-bottom:15px;" src="<?php echo $prev['image'];?>">
<?php } elseif (!empty($img) && empty($prev['quote']) && empty($prev['video']) && empty($prev['audio'])) { ?>
<img class="post-card-image" alt="<?php echo $prev['title'];?>" style="margin-bottom:15px;" src="<?php echo $img;?>">
<?php } ?>
<?php if (!empty($prev['video'])) { ?>
<span class="post-card-image-link" style="margin-bottom:15px;">
<img src="//img.youtube.com/vi/<?php echo get_video_id($prev['video']);?>/sddefault.jpg" width="100%">
</span>
<?php } ?>
<?php if (!empty($prev['audio'])) { ?>
<span class="post-card-image-link" style="margin-bottom:15px;">
<img src="<?php echo theme_path();?>images/soundcloud.jpg" width="100%">
</span>
<?php } ?>
<?php if (!empty($prev['quote'])) { ?>
<blockquote class="post-card-title"><p><?php echo $prev['quote']; ?></p></blockquote>
<?php } ?>
<h2 class="post-card-title"><?php echo($prev['title']); ?></h2>
</header>
<section class="post-card-excerpt">
<?php echo($prev['description']); ?>
</section>
</a>
<footer class="post-card-meta">
<span class="post-card-byline-date"><time><?php echo format_date($prev['date']) ?></time> <span class="bull">•</span><?php echo $prev['category'];?></span>
</footer>
</div>
</article>
<?php endif;?>
</div>
</div>
</aside>
<?php endif;?>
<footer class="site-footer outer">
<div class="site-footer-content inner">
<style>.copyright p {display:inline;margin-right:5px;} .site-footer-nav .nav {position:relative;margin:0;} .site-footer-nav .nav li a {padding:0;display:inline-block;}</style>
<section class="copyright"><?php echo copyright();?> </section>
<nav class="site-footer-nav">
<?php echo menu();?>
</nav>
</div>
</footer>
</div>
<?php if (facebook()) { echo facebook(); } ?>
<?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
</body>
</html>