forked from letsblockit/letsblockit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_layout.hbs
101 lines (97 loc) · 4.81 KB
/
_layout.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
<!doctype html>
<html lang="en" data-bs-theme="{{#if (is_color_mode @root "dark")}}dark{{else}}light{{/if}}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/svg+xml" href="{{ asset "images/logo-small.svg" }}">
<link rel="stylesheet" href="{{ asset "dist/main.css" }}">
<script defer src="{{ asset "dist/main.js" }}"></script>
{{#with PlausibleScript}}
<script defer data-domain="letsblock.it" src="{{.}}"></script>
{{/with}}
<title>{{ Title }} :: letsblock.it</title>
<meta property="og:title" content="{{ Title }}"/>
<meta property="og:description"
content="Remove low-quality content and useless nags, focus on what matters. A community-maintained uBlock Origin filter set."/>
<meta property="og:image" content="{{http_root @root}}/assets/images/logo-288.png"/>
<meta property="og:image:type" content="image/png"/>
<meta property="og:image:width" content="288"/>
<meta property="og:image:height" content="288"/>
<meta property="og:site_name" content="Let's Block It"/>
<meta name="twitter:card" content="summary"/>
<link rel="alternate" type="application/atom+xml" title="Release notes" href="{{href "news-atom" ""}}"/>
</head>
{{#if (is_color_mode @root "auto") }}
<script>
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
}
</script>
{{/if}}
<body hx-boost="true"{{#if HotReload}} data-hot-reload{{/if}}>
<nav class="navbar navbar-expand-md navbar-dark bg-primary" aria-label="Main navigation">
<div class="container-lg">
<a class="navbar-brand" href="/" aria-label="Return to homepage">
<img src="{{ asset "images/logo.svg" }}" alt="Project logo" {{#if GreyLogo}}
style="filter: grayscale(100%);"{{/if}}>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse navbar-nav align-items-stretch mt-3 mt-md-0" id="navbarSupportedContent">
<div class="navbar-nav me-md-auto">
{{#each NavigationLinks}}
<a class="nav-link{{#equal target @root.CurrentSection}} active"
aria-current="page{{/equal}}" href="/{{target}}">{{name}}</a>
{{/each}}
</div>
<a class="nav-link{{#if @root.HasNews}} active{{/if}}{{#equal "news" @root.CurrentSection}} active"
aria-current="page{{/equal}}" href="{{href "news" ""}}">
{{#if @root.HasNews}}{{>icon name="bell-ringing" class="me-1"}}{{/if}}
News
{{#if @root.HasNews}}{{>icon name="bell-ringing" class="ms-1"}}{{/if}}
</a>
{{#if UserLoggedIn}}
<a class="nav-link{{#equal "user" @root.CurrentSection}} active"
aria-current="page{{/equal}}" href="{{href "user-account" ""}}">My account</a>
{{else}}
<form method="POST" class="me-2" hx-boost="false" action="{{href "user-action" "loginOrRegistration"}}">
{{{csrf @root}}}
<button class="btn btn-outline-light {{#equal "user" @root.CurrentSection}} active{{/equal}}"
type="submit">Login
</button>
</form>
{{/if}}
<a class="nav-link pt-0 pb-0" href="https://opencollective.com/letsblockit/">
{{>icon name="custom-open-collective" size=2.25 alt="Sponsor the project on Open Collective"}}</a>
<a class="nav-link pt-0 pb-0" href="https://github.com/letsblockit/letsblockit">
{{>icon name="brand-github" size=2.25 alt="Visit the project on GitHub"}}</a>
</div>
</div>
</nav>
<main id="main" class="container pb-4 pt-4 pt-md-5" {{#if NoBoost}}hx-boost="false"{{/if}}>
<div id="htmx-alert" hidden class="alert alert-warning"></div>
{{#if Sidebar}}
<div class="row">
<div class="col-12 col-lg-3 order-last pt-5 pt-lg-0">
<hr class="d-lg-none"/>
{{#if Sidebar.partial}}
{{#with Data}}{{>(Sidebar.partial)}}{{else}}{{>(Sidebar.partial)}}{{/with}}
{{else}}
{{{Sidebar.contents}}}
{{/if}}
</div>
<div class="col col-lg-9">
{{/if}}
{{#if Page.partial}}
{{#with Data}}{{>(Page.partial)}}{{else}}{{>(Page.partial)}}{{/with}}
{{else}}
{{{Page.contents}}}
{{/if}}
{{#if Sidebar}}
</div></div>
{{/if}}
</main>
</body>
</html>