-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
executable file
·42 lines (40 loc) · 1.08 KB
/
index.php
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
<?php
include 'common.php';
foreach (glob('post/*.md') as $file) {
$v = file2info($file);
$data[$v['id']] = ['title' => $v['title'], 'date' => $v['date']];
}
krsort($data);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>lxlxw - 个人博客</title>
<link href="rsc/css/style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="container">
<div id="sidebar">
<div id="logo">lxlxw - 个人博客</div>
<div id="aboutus">
blog: <a href="http://www.lxlxw.me" target="_blank" >www.lxlxw.me</a>
</br></br>
email: 19168066@qq.com
</div>
</div>
<div id="main">
<div id="list">
<ul>
<?php
foreach ($data as $id => $v) {
$tpl = '<li><a href="post.php?id=%d">%s<span class="date">[ %s ]</span></a></li>';
echo sprintf($tpl, $id, $v['title'], $v['date']);
}
?>
</ul>
</div>
</div>
</div>
</body>
</html>