forked from zutrinken/attila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.hbs
111 lines (91 loc) · 3.63 KB
/
default.hbs
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="{{@site.locale}}">
<head>
{{!-- Document Settings --}}
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
{{!-- Base Meta --}}
<title>{{meta_title}}</title>
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{!-- Styles'n'Scripts --}}
<link rel="stylesheet" type="text/css" href="{{asset "css/style.css"}}" />
<script>
var siteUrl = '{{@site.url}}';
</script>
<script>
var localTheme = localStorage.getItem('attila_theme');
switch (localTheme) {
case 'dark':
document.documentElement.classList.add('theme-dark');
break;
case 'light':
document.documentElement.classList.add('theme-light');
break;
default:
break;
}
</script>
{{#match @custom.color_scheme "Dark"}}
<script>localStorage.setItem('attila_theme', 'dark');</script>
<style>.js-theme {display:none!important;}</style>
{{/match}}
{{#match @custom.color_scheme "Light"}}
<script>localStorage.setItem('attila_theme', 'light');</script>
<style>.js-theme {display:none!important;}</style>
{{/match}}
{{#match @custom.color_scheme "!=" "Light"}}
{{#if @custom.darkmode_accent_color}}
<style>
.theme-dark:root {
--ghost-accent-color: {{@custom.darkmode_accent_color}};
}
@media (prefers-color-scheme: dark) {
html:not(.theme-light):root {
--ghost-accent-color: {{@custom.darkmode_accent_color}};
}
}
</style>
{{/if}}
{{/match}}
{{ghost_head}}
</head>
<body class="{{body_class}}">
<div class="nav-header">
<nav class="nav-wrapper" aria-label="{{t "Main"}}">
{{#if @site.logo}}
<span class="logo">
<a href="{{@site.url}}" title="{{t "Home"}}"><img src="{{@site.logo}}" alt="{{t "Logo"}}" /></a>
</span>
{{/if}}
{{navigation}}
{{> "navigation-meta"}}
</nav>
<div class="nav-wrapper-control">
<div class="inner">
<a class="nav-menu" role="button"><i class="icon icon-menu" aria-hidden="true"></i>{{t "Menu"}}</a>
<a class="nav-search" title="{{t "Search"}}" role="button" data-ghost-search><i class="icon icon-search" aria-hidden="true"></i></a>
</div>
</div>
</div>
<div class="nav-close" role="button" aria-label="{{t "Close"}}"></div>
<section class="page-wrapper">
{{{body}}}
<div class="nav-footer">
<nav class="nav-wrapper" aria-label="{{t "Footer"}}">
<span class="nav-copy">{{@site.title}} © {{date format='YYYY'}} <a class="nav-rss" title="RSS" href="{{@site.url}}/rss/" target="_blank"><i class="icon icon-rss" aria-hidden="true"></i></a></span>
{{#if @site.secondary_navigation}}
{{navigation type="secondary"}}
{{/if}}
<span class="nav-credits">{{t "Published with"}} <a href="https://ghost.org">Ghost</a> • {{t "Theme" }} <a href="https://github.com/zutrinken/attila">Attila</a> • <a class="menu-item js-theme" href="#" data-system="System theme" data-dark="Dark theme" data-light="Light theme"><span class="theme-icon"></span><span class="theme-text">System theme</span> </a> </span>
</nav>
</div>
</section>
{{!-- Load basic scripts --}}
<script type="text/javascript" src="{{asset "js/script.js"}}"></script>
{{!-- The #block helper will pull in data from the #contentFor other template files. In this case, there's some JavaScript which we only want to use in post.hbs, but it needs to be included down here, after jQuery has already loaded. --}}
{{{block "scripts"}}}
{{!-- Ghost outputs important scripts and data with this tag - it should always be the very last thing before the closing body tag --}}
{{ghost_foot}}
</body>
</html>