/
header.php
87 lines (76 loc) · 2.23 KB
/
header.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
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
<?php
/*
Snippets are a great way to store code snippets for reuse
or to keep your templates clean.
This header snippet is reused in all templates.
It fetches information from the `site.txt` content file
and contains the site navigation.
More about snippets:
https://getkirby.com/docs/guide/templates/snippets
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<?php
/*
In the title tag we show the title of our
site and the title of the current page
*/
?>
<title><?= $site->title()->esc() ?> | <?= $page->title()->esc() ?></title>
<?php
/*
Stylesheets can be included using the `css()` helper.
Kirby also provides the `js()` helper to include script file.
More Kirby helpers: https://getkirby.com/docs/reference/templates/helpers
*/
?>
<?= css([
'assets/css/prism.css',
'assets/css/lightbox.css',
'assets/css/index.css',
'@auto'
]) ?>
<?php
/*
The `url()` helper is a great way to create reliable
absolute URLs in Kirby that always start with the
base URL of your site.
*/
?>
<link rel="shortcut icon" type="image/x-icon" href="<?= url('favicon.ico') ?>">
</head>
<body>
<header class="header">
<?php
/*
We use `$site->url()` to create a link back to the homepage
for the logo and `$site->title()` as a temporary logo. You
probably want to replace this with an SVG.
*/
?>
<a class="logo" href="<?= $site->url() ?>">
<?= $site->title()->esc() ?>
</a>
<nav class="menu">
<?php
/*
In the menu, we only fetch listed pages,
i.e. the pages that have a prepended number
in their foldername.
We do not want to display links to unlisted
`error`, `home`, or `sandbox` pages.
More about page status:
https://getkirby.com/docs/reference/panel/blueprints/page#statuses
*/
?>
<?php foreach ($site->children()->listed() as $item): ?>
<a <?php e($item->isOpen(), 'aria-current="page"') ?> href="<?= $item->url() ?>"><?= $item->title()->esc() ?></a>
<?php endforeach ?>
<?php snippet('social') ?>
</nav>
</header>
<main class="main">