-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
45 lines (40 loc) · 1.25 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
43
44
<?php
require_once 'config.php';
require_once 'connect.php';
require_once 'vendor/autoload.php';
$parsedown = new Parsedown();
// Get home page content
$stmt = $pdo->prepare("SELECT content FROM homepage WHERE id = 1");
$stmt->execute();
$homepage = $stmt->fetch(PDO::FETCH_ASSOC);
$homepageContent = $homepage ? $parsedown->text($homepage['content']) : '';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo BLOG_TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="styles/styles/atom-one-dark.css">
<style>
main img {
max-width: 960px;
max-height: 400px;
width: auto; /* 保持图片的原始宽高比 */
height: auto; /* 保持图片的原始宽高比 */
}
</style>
</head>
<body>
<?php include 'menu.php'; ?>
<main>
<?php echo $homepageContent; ?>
</main>
<?php include 'footer.php'; ?>
<script src="styles/highlight.min.js"></script>
<script>console.log('highlight.js should be loaded');</script>
<script>hljs.highlightAll();</script>
</body>
</html>