Skip to content

Commit ba38008

Browse files
committed
added missing test folder
1 parent 2c8f8cd commit ba38008

File tree

5 files changed

+388
-0
lines changed

5 files changed

+388
-0
lines changed

test/data/css/bootstrap.min.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/data/index.html

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
<!doctype html>
2+
<html lang="en" data-bs-theme="auto">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<meta name="description" content="">
8+
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
9+
<meta name="generator" content="Hugo 0.145.0">
10+
<title>Starter Template · Bootstrap v5.3</title>
11+
12+
<link rel="canonical" href="https://getbootstrap.com/docs/5.3/examples/starter-template/">
13+
14+
<script src="/js/color-modes.js"></script>
15+
16+
<link href="/css/bootstrap.min.css" rel="stylesheet">
17+
18+
<link rel="apple-touch-icon" href="../assets/img/favicons/apple-touch-icon.png" sizes="180x180">
19+
<link rel="icon" href="../assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
20+
<link rel="icon" href="../assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
21+
<link rel="manifest" href="../assets/img/favicons/manifest.json">
22+
<link rel="mask-icon" href="../assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
23+
<link rel="icon" href="../assets/img/favicons/favicon.ico">
24+
<meta name="theme-color" content="#712cf9">
25+
26+
27+
<style>
28+
.bd-placeholder-img {
29+
font-size: 1.125rem;
30+
text-anchor: middle;
31+
-webkit-user-select: none;
32+
-moz-user-select: none;
33+
user-select: none;
34+
}
35+
36+
@media (min-width: 768px) {
37+
.bd-placeholder-img-lg {
38+
font-size: 3.5rem;
39+
}
40+
}
41+
42+
.b-example-divider {
43+
width: 100%;
44+
height: 3rem;
45+
background-color: rgba(0, 0, 0, .1);
46+
border: solid rgba(0, 0, 0, .15);
47+
border-width: 1px 0;
48+
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
49+
}
50+
51+
.b-example-vr {
52+
flex-shrink: 0;
53+
width: 1.5rem;
54+
height: 100vh;
55+
}
56+
57+
.bi {
58+
vertical-align: -.125em;
59+
fill: currentColor;
60+
}
61+
62+
.nav-scroller {
63+
position: relative;
64+
z-index: 2;
65+
height: 2.75rem;
66+
overflow-y: hidden;
67+
}
68+
69+
.nav-scroller .nav {
70+
display: flex;
71+
flex-wrap: nowrap;
72+
padding-bottom: 1rem;
73+
margin-top: -1px;
74+
overflow-x: auto;
75+
text-align: center;
76+
white-space: nowrap;
77+
-webkit-overflow-scrolling: touch;
78+
}
79+
80+
.btn-bd-primary {
81+
--bd-violet-bg: #712cf9;
82+
--bd-violet-rgb: 112.520718, 44.062154, 249.437846;
83+
84+
--bs-btn-font-weight: 600;
85+
--bs-btn-color: var(--bs-white);
86+
--bs-btn-bg: var(--bd-violet-bg);
87+
--bs-btn-border-color: var(--bd-violet-bg);
88+
--bs-btn-hover-color: var(--bs-white);
89+
--bs-btn-hover-bg: #6528e0;
90+
--bs-btn-hover-border-color: #6528e0;
91+
--bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
92+
--bs-btn-active-color: var(--bs-btn-hover-color);
93+
--bs-btn-active-bg: #5a23c8;
94+
--bs-btn-active-border-color: #5a23c8;
95+
}
96+
97+
.bd-mode-toggle {
98+
z-index: 1500;
99+
}
100+
101+
.bd-mode-toggle .bi {
102+
width: 1em;
103+
height: 1em;
104+
}
105+
106+
.bd-mode-toggle .dropdown-menu .active .bi {
107+
display: block !important;
108+
}
109+
</style>
110+
111+
112+
</head>
113+
114+
<body>
115+
<svg xmlns="http://www.w3.org/2000/svg" class="d-none">
116+
<symbol id="check2" viewBox="0 0 16 16">
117+
<path
118+
d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" />
119+
</symbol>
120+
<symbol id="circle-half" viewBox="0 0 16 16">
121+
<path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z" />
122+
</symbol>
123+
<symbol id="moon-stars-fill" viewBox="0 0 16 16">
124+
<path
125+
d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" />
126+
<path
127+
d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z" />
128+
</symbol>
129+
<symbol id="sun-fill" viewBox="0 0 16 16">
130+
<path
131+
d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" />
132+
</symbol>
133+
</svg>
134+
135+
136+
<div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
137+
<button class="btn btn-bd-primary py-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button"
138+
aria-expanded="false" data-bs-toggle="dropdown" aria-label="Toggle theme (auto)">
139+
<svg class="bi my-1 theme-icon-active" aria-hidden="true">
140+
<use href="#circle-half"></use>
141+
</svg>
142+
<span class="visually-hidden" id="bd-theme-text">Toggle theme</span>
143+
</button>
144+
<ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="bd-theme-text">
145+
<li>
146+
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light"
147+
aria-pressed="false">
148+
<svg class="bi me-2 opacity-50" aria-hidden="true">
149+
<use href="#sun-fill"></use>
150+
</svg>
151+
Light
152+
<svg class="bi ms-auto d-none" aria-hidden="true">
153+
<use href="#check2"></use>
154+
</svg>
155+
</button>
156+
</li>
157+
<li>
158+
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark"
159+
aria-pressed="false">
160+
<svg class="bi me-2 opacity-50" aria-hidden="true">
161+
<use href="#moon-stars-fill"></use>
162+
</svg>
163+
Dark
164+
<svg class="bi ms-auto d-none" aria-hidden="true">
165+
<use href="#check2"></use>
166+
</svg>
167+
</button>
168+
</li>
169+
<li>
170+
<button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="auto"
171+
aria-pressed="true">
172+
<svg class="bi me-2 opacity-50" aria-hidden="true">
173+
<use href="#circle-half"></use>
174+
</svg>
175+
Auto
176+
<svg class="bi ms-auto d-none" aria-hidden="true">
177+
<use href="#check2"></use>
178+
</svg>
179+
</button>
180+
</li>
181+
</ul>
182+
183+
</div>
184+
185+
186+
<svg xmlns="http://www.w3.org/2000/svg" class="d-none">
187+
<symbol id="arrow-right-circle" viewBox="0 0 16 16">
188+
<path
189+
d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z" />
190+
</symbol>
191+
<symbol id="bootstrap" viewBox="0 0 118 94">
192+
<title>Bootstrap</title>
193+
<path fill-rule="evenodd" clip-rule="evenodd"
194+
d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z">
195+
</path>
196+
</symbol>
197+
</svg>
198+
199+
<div class="col-lg-8 mx-auto p-4 py-md-5">
200+
<header class="d-flex align-items-center pb-3 mb-5 border-bottom">
201+
<a href="/" class="d-flex align-items-center text-body-emphasis text-decoration-none">
202+
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap">
203+
<use xlink:href="#bootstrap" />
204+
</svg>
205+
<span class="fs-4">Starter template</span>
206+
</a>
207+
</header>
208+
209+
<main>
210+
<h1 class="text-body-emphasis">Get started with Bootstrap</h1>
211+
<p class="fs-5 col-md-8">Quickly and easily get started with Bootstrap's compiled, production-ready files with
212+
this barebones example featuring some basic HTML and helpful links. Download all our examples to get started.
213+
</p>
214+
215+
<div class="mb-5">
216+
<a href="../examples/" class="btn btn-primary btn-lg px-4">Download examples</a>
217+
</div>
218+
219+
<hr class="col-3 col-md-2 mb-5">
220+
221+
<div class="row g-5">
222+
<div class="col-md-6">
223+
<h2 class="text-body-emphasis">Starter projects</h2>
224+
<p>Ready to go beyond the starter template? Check out these open source projects that you can quickly
225+
duplicate to a new GitHub repository.</p>
226+
<ul class="list-unstyled ps-0">
227+
<li>
228+
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/icons-font" rel="noopener"
229+
target="_blank">
230+
<svg class="bi" width="16" height="16" aria-hidden="true">
231+
<use xlink:href="#arrow-right-circle" />
232+
</svg>
233+
Bootstrap npm starter
234+
</a>
235+
</li>
236+
<li>
237+
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/parcel" rel="noopener"
238+
target="_blank">
239+
<svg class="bi" width="16" height="16" aria-hidden="true">
240+
<use xlink:href="#arrow-right-circle" />
241+
</svg>
242+
Bootstrap Parcel starter
243+
</a>
244+
</li>
245+
<li>
246+
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/vite" rel="noopener"
247+
target="_blank">
248+
<svg class="bi" width="16" height="16" aria-hidden="true">
249+
<use xlink:href="#arrow-right-circle" />
250+
</svg>
251+
Bootstrap Vite starter
252+
</a>
253+
</li>
254+
<li>
255+
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/webpack" rel="noopener"
256+
target="_blank">
257+
<svg class="bi" width="16" height="16" aria-hidden="true">
258+
<use xlink:href="#arrow-right-circle" />
259+
</svg>
260+
Bootstrap Webpack starter
261+
</a>
262+
</li>
263+
</ul>
264+
</div>
265+
266+
<div class="col-md-6">
267+
<h2 class="text-body-emphasis">Guides</h2>
268+
<p>Read more detailed instructions and documentation on using or contributing to Bootstrap.</p>
269+
</div>
270+
</div>
271+
</main>
272+
<footer class="pt-5 my-5 text-body-secondary border-top">
273+
Created by the Bootstrap team &middot; &copy; 2025
274+
</footer>
275+
</div>
276+
<script defer src="/js/bootstrap.bundle.min.js"
277+
integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"></script>
278+
279+
</body>
280+
281+
</html>

test/data/js/bootstrap.bundle.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/data/js/color-modes.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*!
2+
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
3+
* Copyright 2011-2025 The Bootstrap Authors
4+
* Licensed under the Creative Commons Attribution 3.0 Unported License.
5+
*/
6+
7+
(() => {
8+
'use strict'
9+
10+
const getStoredTheme = () => localStorage.getItem('theme')
11+
const setStoredTheme = theme => localStorage.setItem('theme', theme)
12+
13+
const getPreferredTheme = () => {
14+
const storedTheme = getStoredTheme()
15+
if (storedTheme) {
16+
return storedTheme
17+
}
18+
19+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
20+
}
21+
22+
const setTheme = theme => {
23+
if (theme === 'auto') {
24+
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
25+
} else {
26+
document.documentElement.setAttribute('data-bs-theme', theme)
27+
}
28+
}
29+
30+
setTheme(getPreferredTheme())
31+
32+
const showActiveTheme = (theme, focus = false) => {
33+
const themeSwitcher = document.querySelector('#bd-theme')
34+
35+
if (!themeSwitcher) {
36+
return
37+
}
38+
39+
const themeSwitcherText = document.querySelector('#bd-theme-text')
40+
const activeThemeIcon = document.querySelector('.theme-icon-active use')
41+
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
42+
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')
43+
44+
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
45+
element.classList.remove('active')
46+
element.setAttribute('aria-pressed', 'false')
47+
})
48+
49+
btnToActive.classList.add('active')
50+
btnToActive.setAttribute('aria-pressed', 'true')
51+
activeThemeIcon.setAttribute('href', svgOfActiveBtn)
52+
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`
53+
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel)
54+
55+
if (focus) {
56+
themeSwitcher.focus()
57+
}
58+
}
59+
60+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
61+
const storedTheme = getStoredTheme()
62+
if (storedTheme !== 'light' && storedTheme !== 'dark') {
63+
setTheme(getPreferredTheme())
64+
}
65+
})
66+
67+
window.addEventListener('DOMContentLoaded', () => {
68+
showActiveTheme(getPreferredTheme())
69+
70+
document.querySelectorAll('[data-bs-theme-value]')
71+
.forEach(toggle => {
72+
toggle.addEventListener('click', () => {
73+
const theme = toggle.getAttribute('data-bs-theme-value')
74+
setStoredTheme(theme)
75+
setTheme(theme)
76+
showActiveTheme(theme, true)
77+
})
78+
})
79+
})
80+
})()

test/util/httpserver.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import handler from 'serve-handler';
2+
import { createServer } from 'node:http';
3+
4+
let server;
5+
const port = 3000;
6+
7+
export async function startServer() {
8+
server = createServer((request, response) => {
9+
return handler(request, response, { public: './test/data/' });
10+
});
11+
12+
return server.listen(port, () => {});
13+
}
14+
export async function stopServer() {
15+
return server.close();
16+
}

0 commit comments

Comments
 (0)