Skip to content

Commit b6636a7

Browse files
committed
Initial commit
0 parents  commit b6636a7

File tree

195 files changed

+11185
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+11185
-0
lines changed

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{js,json,yml}]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# build output
2+
dist/
3+
4+
# dependencies
5+
node_modules/
6+
7+
# logs
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
pnpm-debug.log*
12+
13+
# yarn
14+
.pnp.*
15+
.yarn/*
16+
!.yarn/patches
17+
!.yarn/plugins
18+
!.yarn/releases
19+
!.yarn/sdks
20+
!.yarn/versions
21+
22+
# environment variables
23+
.env
24+
.env.production
25+
26+
# macOS-specific files
27+
.DS_Store
28+
/test-results/
29+
/playwright-report/
30+
/playwright/.cache/

.vscode/extensions.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"cSpell.words": [
3+
"Abbreviations",
4+
"Blockquotes",
5+
"cheatsheet"
6+
]
7+
}

.yarn/releases/yarn-3.2.4.cjs

+801
Large diffs are not rendered by default.

.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
yarnPath: .yarn/releases/yarn-3.2.4.cjs
2+
nodeLinker: node-modules
3+
checksumBehavior: "update"

README.md

+21

astro.config.mjs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from 'astro/config';
2+
import sitemap from "@astrojs/sitemap";
3+
4+
export default defineConfig({
5+
markdown: {
6+
shikiConfig: {
7+
theme: 'dracula',
8+
langs: [],
9+
wrap: false,
10+
},
11+
},
12+
site: "https://bootstrappretty.dev",
13+
integrations: [sitemap()]
14+
});

bootstrap-pretty-icon.ico

4.19 KB
Binary file not shown.

package.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "bootstrap-pretty-docs",
3+
"packageManager": "[email protected]",
4+
"type": "module",
5+
"version": "0.1.0",
6+
"license": "Apache-2.0",
7+
"description": "Pretty and flexible themes for Bootstrap 5.",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/bootstrap-pretty/bootstrap-pretty-docs.git"
11+
},
12+
"author": "Bootstrap Pretty (https://bootstrappretty.dev)",
13+
"bugs": {
14+
"url": "https://github.com/bootstrap-pretty/bootstrap-pretty-docs/issues"
15+
},
16+
"homepage": "https://github.com/bootstrap-pretty/bootstrap-pretty-docs#readme",
17+
"scripts": {
18+
"dev": "astro dev",
19+
"start": "astro dev",
20+
"build": "astro build",
21+
"preview": "astro preview",
22+
"astro": "astro"
23+
},
24+
"dependencies": {
25+
"@astrojs/sitemap": "^1.0.0",
26+
"@popperjs/core": "^2.11.6",
27+
"anchor-js": "^5.0.0",
28+
"astro": "^1.6.0",
29+
"astro-icon": "^0.8.0",
30+
"bootstrap-pretty": "0.2.0",
31+
"clipboard": "^2.0.11",
32+
"sass": "^1.55.0"
33+
},
34+
"devDependencies": {
35+
"@playwright/test": "^1.28.1"
36+
}
37+
}

playwright.config.ts

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import type { PlaywrightTestConfig } from '@playwright/test';
2+
import { devices } from '@playwright/test';
3+
4+
/**
5+
* Read environment variables from file.
6+
* https://github.com/motdotla/dotenv
7+
*/
8+
// require('dotenv').config();
9+
10+
/**
11+
* See https://playwright.dev/docs/test-configuration.
12+
*/
13+
const config: PlaywrightTestConfig = {
14+
testDir: '././src/tests',
15+
/* Maximum time one test can run for. */
16+
timeout: 30 * 1000,
17+
expect: {
18+
/**
19+
* Maximum time expect() should wait for the condition to be met.
20+
* For example in `await expect(locator).toHaveText();`
21+
*/
22+
timeout: 5000
23+
},
24+
/* Run tests in files in parallel */
25+
fullyParallel: true,
26+
/* Fail the build on CI if you accidentally left test.only in the source code. */
27+
forbidOnly: !!process.env.CI,
28+
/* Retry on CI only */
29+
retries: process.env.CI ? 2 : 0,
30+
/* Opt out of parallel tests on CI. */
31+
workers: process.env.CI ? 1 : undefined,
32+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
33+
reporter: 'html',
34+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
35+
use: {
36+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
37+
actionTimeout: 0,
38+
/* Base URL to use in actions like `await page.goto('/')`. */
39+
baseURL: 'http://localhost:3000',
40+
41+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
42+
trace: 'on-first-retry',
43+
},
44+
45+
/* Configure projects for major browsers */
46+
projects: [
47+
{
48+
name: 'chromium',
49+
use: {
50+
...devices['Desktop Chrome']
51+
},
52+
},
53+
54+
/*{
55+
name: 'firefox',
56+
use: {
57+
...devices['Desktop Firefox']
58+
},
59+
},
60+
61+
{
62+
name: 'webkit',
63+
use: {
64+
...devices['Desktop Safari']
65+
},
66+
},*/
67+
68+
/* Test against mobile viewports. */
69+
// {
70+
// name: 'Mobile Chrome',
71+
// use: {
72+
// ...devices['Pixel 5'],
73+
// },
74+
// },
75+
// {
76+
// name: 'Mobile Safari',
77+
// use: {
78+
// ...devices['iPhone 12'],
79+
// },
80+
// },
81+
82+
/* Test against branded browsers. */
83+
// {
84+
// name: 'Microsoft Edge',
85+
// use: {
86+
// channel: 'msedge',
87+
// },
88+
// },
89+
// {
90+
// name: 'Google Chrome',
91+
// use: {
92+
// channel: 'chrome',
93+
// },
94+
// },
95+
],
96+
97+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
98+
// outputDir: 'test-results/',
99+
100+
/* Run your local dev server before starting the tests */
101+
// webServer: {
102+
// command: 'npm run start',
103+
// port: 3000,
104+
// },
105+
};
106+
107+
export default config;

public/android-chrome-192x192.png

6.76 KB

public/android-chrome-512x512.png

23.5 KB

public/apple-touch-icon.png

6.12 KB

public/favicon-16x16.png

370 Bytes

public/favicon-32x32.png

841 Bytes

public/favicon.ico

15 KB
Binary file not shown.

src/components/Breadcrumb.astro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
const paths = Astro.url.pathname.split('/').filter(x => x);
3+
let parts = [
4+
{
5+
text: 'Home',
6+
href: '/'
7+
}
8+
];
9+
// Capitalize first route (posts && tags)
10+
paths[0] === paths[0] && paths.splice(0, 1, paths[0].charAt(0).toUpperCase() + paths[0].slice(1));
11+
paths.forEach((text, i) => {
12+
const href = `/${paths.slice(0, i + 1).join('/')}`;
13+
parts.push({ text: text, href})
14+
})
15+
---
16+
17+
<nav aria-label="breadcrumb">
18+
<ol class="breadcrumb">
19+
{parts.map(({ text, href }, index) =>
20+
<li class={`breadcrumb-item ${index + 1 === parts.length ? "active" : ""}`} role="listitem" aria-current={index + 1 === parts.length ? "page" : false}>
21+
{index + 1 !== parts.length ? <a href={href.toLowerCase()}>{text}</a> : decodeURIComponent(text)}
22+
</li>
23+
)}
24+
</ol>
25+
</nav>

src/components/Footer.astro

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
import NavigationLinks from '@components/NavigationLinks.astro';
3+
import { SITE } from '@config';
4+
---
5+
6+
<footer class="flex-shrink-0 text-center rounded-4 mb-n2 border text-bg-tertiary-bg">
7+
<div class="container-xxl">
8+
<p class="my-3">Copyright &copy; {new Date().getFullYear()} - {SITE.title}</p>
9+
<!-- <nav class="navbar navbar-expand">
10+
<ul class="navbar-nav mx-auto mx-md-end">
11+
<NavigationLinks />
12+
</ul>
13+
</nav> -->
14+
</div>
15+
</footer>

src/components/Header.astro

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
import NavigationLinks from '@components/NavigationLinks.astro';
3+
import { SITE } from '@config';
4+
import { Icon } from 'astro-icon';
5+
import ThemeToggle from 'bootstrap-pretty/components/astro/ThemeToggle.astro';
6+
import PaletteSelector from '@components/PaletteSelector.astro';
7+
const iconComponent = Icon;
8+
const { showPaletteSelector } = Astro.props;
9+
---
10+
11+
<header class="py-3 rounded-4 mt-n2 border text-bg-tertiary-bg">
12+
<nav class="navbar navbar-expand justify-content-between container-xxl px-3">
13+
<div class="d-flex">
14+
<a class="navbar-brand" href="/">
15+
Bootstrap <span class="font-handwriting text-primary">Pretty</span>
16+
</a>
17+
<!-- <div>
18+
<ul class="navbar-nav">
19+
<NavigationLinks />
20+
</ul>
21+
</div> -->
22+
</div>
23+
<div class="d-flex align-items-center">
24+
<a href={SITE.gitHubUrl} target="_blank" rel="noreferrer" title="Visit Bootstrap Pretty on GitHub"><Icon class="w-25-px me-4" name="bi:github" /></a>
25+
{
26+
showPaletteSelector && (
27+
<PaletteSelector />
28+
)
29+
}
30+
<ThemeToggle iconComponent={iconComponent} />
31+
</div>
32+
</nav>
33+
</header>

src/components/NavigationLinks.astro

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
import { NAVIGATION_LINKS } from '@config';
3+
const url = new URL(Astro.request.url);
4+
---
5+
6+
{
7+
NAVIGATION_LINKS.filter(link => link.showInNav).map((link, index) => (
8+
<li class="nav-item">
9+
<a class={`nav-link ${index === 0 ? "ps-0" : ""} ${url.pathname.includes(link.slug) ? "active" : ""}`} href={`/${link.slug}`} aria-current={url.pathname.includes(link.slug) ? "page" : false}>{link.title}</a>
10+
</li>
11+
))
12+
}

src/components/PageHeader.astro

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
import Breadcrumb from "@components/Breadcrumb.astro";
3+
const { title, description } = Astro.props;
4+
---
5+
6+
<Breadcrumb />
7+
<h1 class="mb-0"><strong>{title}</strong></h1>
8+
<p class="mb-5">{description}</p>
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
const { palettes } = Astro.props;
3+
---
4+
5+
<div class="row">
6+
{palettes.map((palette: { slug: string; title: string; palette: string; description: string; tags: string[]; }) =>
7+
<div class="col-sm-6 col-lg-4 mb-3">
8+
<div class="card h-100">
9+
<a href={`/${palette.slug}`} title={palette.title}>
10+
<img class="card-img-top border-bottom" src={`/images/playwright/${palette.slug}/${palette.palette}.png`} alt={palette.title}>
11+
</a>
12+
<div class="card-body">
13+
<p class="card-title lead mx-1">{palette.title}</p>
14+
<p class="card-text mx-1">{palette.description}</p>
15+
<ul class="list-inline">
16+
{palette.tags.map((tag: string) => (
17+
<li class="list-inline-item m-1"><a class="btn btn-sm btn-primary" href={`/palettes/tags/${tag}`}>#{tag}</a></li>
18+
))}
19+
</ul>
20+
<a class="btn btn-link" href={`/${palette.slug}`}>View</a>
21+
</div>
22+
</div>
23+
</div>
24+
)}
25+
</div>

src/components/PaletteSelector.astro

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
import PALETTES from 'bootstrap-pretty/palettes.json';
3+
const featuredPalettes = PALETTES.filter(x => x.tags.includes("featured"));
4+
---
5+
6+
<select id="paletteSelector" class="form-select me-3" aria-label="Palette Selector">
7+
{featuredPalettes.map(palette =>
8+
<option value={palette.title}>{palette.title}</option>
9+
)}
10+
</select>
11+
12+
<script>
13+
import "../scripts/body-bootstrap-pretty-palette-selector";
14+
</script>

0 commit comments

Comments
 (0)