-
-
Notifications
You must be signed in to change notification settings - Fork 576
/
default.hbs
123 lines (101 loc) · 4.46 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
112
113
114
115
116
117
118
119
120
121
122
123
<!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 "System"}}
<script>localStorage.setItem('attila_theme', 'system');</script>
{{/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="viewport">
<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}}
<a class="nav-search" title="{{t "Search"}}" aria-label="{{t "Search"}}" data-ghost-search><i class="icon icon-search" aria-hidden="true">{{> "icons/icon-search"}}</i></a>
</nav>
<div class="nav-wrapper-control">
<div class="inner">
<a class="nav-menu" role="button"><i class="icon icon-menu" aria-hidden="true">{{> "icons/icon-menu"}}</i> {{t "Menu"}}</a>
<a class="nav-search" title="{{t "Search"}}" aria-label="{{t "Search"}}" role="button" data-ghost-search><i class="icon icon-search" aria-hidden="true">{{> "icons/icon-search"}}</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">
<span class="nav-title">{{@site.title}} © {{date format='YYYY'}}</span>
<a aria-label="RSS" href="{{@site.url}}/rss/" title="RSS"><i class="icon icon-rss" aria-hidden="true">{{> "icons/icon-rss"}}</i></a>
{{#if @site.twitter}}<a aria-label="Twitter" href="{{twitter_url}}" title="{{@site.twitter}}"><i class="icon icon-twitter" aria-hidden="true">{{> "icons/icon-twitter"}}</i></a>{{/if}}
{{#if @site.facebook}}<a aria-label="Facebook" href="{{facebook_url}}" title="{{@site.facebook}}"><i class="icon icon-facebook" aria-hidden="true">{{> "icons/icon-facebook"}}</i></a>{{/if}}
</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>
</div>
{{!-- 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>