forked from bootc-dev/bootc-dev.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.html
More file actions
115 lines (103 loc) · 4.1 KB
/
base.html
File metadata and controls
115 lines (103 loc) · 4.1 KB
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
{% import "_macros.html" as macros %}
<!DOCTYPE html>
<html lang="{{ lang }}">
<head>
<meta charset="UTF-8">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% block favicon %}
<link rel="icon" type="image/png" href="{{ get_url(path=config.extra.favicon) }}">
{% endblock favicon %}
{% include "_variables.html" %}
{% block fonts %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Red+Hat+Display:ital,wght@0,300..900;1,300..900&family=Red+Hat+Mono:ital,wght@0,300..700;1,300..700&family=Red+Hat+Text:ital,wght@0,300..700;1,300..700&display=swap" rel="stylesheet">
{% endblock fonts %}
<link rel="stylesheet" href="/normalize.css">
<link rel="stylesheet" href="{{ get_url(path="juice.css") }}">
{% block head %}
{% endblock head %}
</head>
<body>
{% block header %}
<header class="pos-absolute" style="background-color: transparent">
{{ macros::render_header() }}
</header>
<div class="hero">
{% block hero %}
{% endblock hero %}
</div>
{% endblock header %}
<main>
{% block toc %}
{% if section.toc %}
{% set toc = section.toc %}
{% elif page.toc %}
{% set toc = page.toc %}
{% endif %}
{% if toc %}
<div class="toc">
<div class="toc-sticky">
{% for h in toc %}
<div class="toc-item">
<a class="subtext" href="{{h.permalink | safe}}">{{ h.title }}</a>
</div>
{% if h.children %}
{% for h2 in h.children %}
<div class="toc-item-child">
<a class="subtext" href="{{h2.permalink | safe}}"><small>- {{ h2.title }}</small></a>
</div>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endblock toc %}
<div class="content text">
{% block content %}
<div id="features" class="heading-text">Overview</div>
{{ section.content | safe }}
{% endblock content %}
</div>
{% block sidebar %}
<div class="sidebar">
</div>
{% endblock sidebar %}
</main>
{% block footer %}
<footer>
<p class="subtext">We are a Cloud Native Computing Foundation sandbox project.</p>
<p><a href="https://cncf.io"><img src="{{ get_url(path='img/cncf-color-bg.svg') }}" height="75px" alt="CNCF logo"></a></p>
<p class="subtext">
bootc, originally created by Red Hat and donated to open source with ❤<br/>
Copyright © bootc, a Series of LF Projects, LLC<br/>
For website terms of use, trademark policy and other project policies please see <a href="https://lfprojects.org/policies/">lfprojects.org/policies/</a>.
</p>
</footer>
{% endblock footer %}
</body>
<script>
const scrollHandler = entries => {
// Find the first entry which intersecting and ratio > 0.9 to highlight.
let entry = entries.find(entry => {
return entry.isIntersecting && entry.intersectionRatio > 0.9;
});
if (!entry) return;
document.querySelectorAll(".toc a").forEach((item) => {
item.classList.remove("active");
});
// let url = new URL(`#${entry.target.id}`);
let link = document.querySelector(`.toc a[href$="${decodeURIComponent(`#${entry.target.id}`)}"]`)
if (link) {
link.classList.add("active");
link.scrollIntoView({ behavior: "auto", block: "nearest" });
}
};
// Set -100px root margin to improve highlight experience.
const observer = new IntersectionObserver(scrollHandler, { threshold: 1 });
let items = document.querySelectorAll('h1,h2,h3,h4,h5,h6');
items.forEach(item => observer.observe(item));
</script>
</html>