-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblog.php
More file actions
68 lines (64 loc) · 3.22 KB
/
blog.php
File metadata and controls
68 lines (64 loc) · 3.22 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
<?php defined( 'App' ) or die( 'BoidCMS' ); global $App ?>
<!DOCTYPE html>
<html lang="<?= noir_site_config( 'lang' ) ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<?= noir_site_config( 'descr' ) ?>">
<meta name="keywords" content="<?= noir_site_config( 'keywords' ) ?>">
<meta name="author" content="<?= $App->esc( noir_config( 'author', false )[ 'name' ] ) ?>">
<meta name="theme-color" content="#000000">
<meta name="generator" content="BoidCMS">
<title><?= noir_blog_title() ?></title>
<?php include ( __DIR__ . '/parts/head.php' ) ?>
<?= $App->get_action( 'site_head' ) ?>
</head>
<body>
<?= $App->get_action( 'site_top' ) ?>
<!-- Header -->
<?php include ( __DIR__ . '/parts/header.php' ) ?>
<!-- /Header -->
<!-- Content -->
<main id="content" class="ss-m-5 ss-mx-auto">
<div class="ss-container">
<?= $App->get_action( 'home_top' ) ?>
<h1 class="ss-hide"><?= noir_site_config( 'title' ) ?></h1>
<hr class="ss-hr ss-mobile ss-w-8 ss-auto">
<h2 class="ss-center"><?= $App->get_filter( 'Recent Posts', 'noir', 'recent-posts' ) ?></h2>
<hr class="ss-hr ss-mobile ss-w-8 ss-auto">
<?php $recent_posts = noir_recent_posts() ?>
<?php if ( empty( $recent_posts ) ): ?>
<p class="ss-xlarge ss-center">
<?= $App->get_filter( 'No recent posts!', 'noir', 'no-recent-posts' ) ?>
</p>
<?php endif ?>
<?php foreach ( $recent_posts as $slug => $post ): ?>
<article class="article ss-container ss-large">
<?= $App->get_action( 'post_list_top', $slug ) ?>
<h3 class="ss-h2 ss-center ss-bold"><a href="<?= $App->url( $slug ) ?>" class="ss-hvr-no-underline"><?= $App->esc( $post[ 'title' ] ) ?></a></h3>
<p class="ss-center ss-medium"><?= $App->get_filter( 'By', 'noir', 'by' ) ?> <a href="<?= $App->esc( noir_config( 'author', false )[ 'link' ] ) ?>" class="ss-hvr-no-underline ss-bold"><?= $App->esc( noir_config( 'author', false )[ 'name' ] ) ?></a> • <time datetime="<?= $post[ 'date' ] ?>"><?= date( 'F j, Y', strtotime( $post[ 'date' ] ) ) ?></time></p>
<p><?= noir_post_excerpt( $slug ) ?></p>
<p class="ss-center ss-medium"><b><a href="<?= $App->url( $slug ) ?>"><?= $App->get_filter( 'Read more →', 'noir', 'read-more' ) ?></a></b></p>
<?= $App->get_action( 'post_list_end', $slug ) ?>
</article>
<hr>
<?php endforeach ?>
<div class="ss-my-5">
<p class="ss-h3 ss-center ss-wide">
<?php $page = noir_pagination_page() ?>
<?php $total = noir_pagination_total() ?>
<?php for ( $i = 1; $i <= $total; $i++ ): ?>
<a href="?page=<?= $i ?>"<?= $page === $i ? '' : ' rel="' . ( $page < $i ? 'next' : 'prev' ) . '" class="ss-no-underline"' ?>><?= $i ?></a>
<?php endfor ?>
</p>
</div>
<?= $App->get_action( 'home_end' ) ?>
</div>
</main>
<!-- /Content -->
<!-- Footer -->
<?php include ( __DIR__ . '/parts/footer.php' ) ?>
<!-- /Footer -->
<?= $App->get_action( 'site_end' ) ?>
</body>
</html>