-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.php
More file actions
52 lines (42 loc) · 960 Bytes
/
index.php
File metadata and controls
52 lines (42 loc) · 960 Bytes
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
<?
/**
* Krunk.cn KBlog - 极简博客
*
* Project Link: https://kblog.krunk.cn
* GitHub: https://github.com/KrunkZhou/KBlog
*
* @author Krunk Zhou
* @copyright 2019 Krunk Zhou (https://krunk.cn)
*/
include('function.php');
echo $html_start;
$site_title_before='Home';
include($theme_folder.'/header.php');
echo nav_active("index");
echo $post_start;
$id=$index_file;
if ($id){
$html = @file_get_contents($blog_folder.'/'.$id.'.md');
// get title $title
$html_arr = explode("\n", $html, 2);
$title = $html_arr[0];
$html = strstr($html, "\n");
$html = ltrim($html, "\n");
//get time stamp $time
$html_arr = explode("\n", $html, 2);
$time = $html_arr[0];
$html = strstr($html, "\n");
$html = ltrim($html, "\n");
if ($html){
$Parsedown = new Parsedown();
echo $Parsedown->text($html);
}else{
echo notfoundfile();
}
}else{
echo notfoundfile();
}
echo $post_end;
include($theme_folder.'/footer.php');
echo $html_end;
?>