bridgetown-stoa 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +37 -1
- data/bridgetown-stoa.gemspec +3 -2
- data/frontend/styles/bridgetown-stoa.css +34 -0
- data/layouts/bridgetown-stoa/layout.serb +33 -4
- data/lib/bridgetown-stoa/version.rb +1 -1
- data/package.json +26 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0511ef53344c59a9838fed10c80f00359b0a789d415b621e7607478040ffe7cb
|
|
4
|
+
data.tar.gz: 21f47c907b9100fa4f8d869bc72f703fc184dd21e317b3940aa405017df4605e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c2bccceca7a78df90d4fffd4846db7201fb28d1ab661582f71c352a83e9864535e93090d86fa79921cf0e093473306ae0f08e7f7f93c242a194a5416e664f8a
|
|
7
|
+
data.tar.gz: 83755738874401da2cf61b08d56f9943517942d84376c328018eaf47c338a6118a3e751c356971e8f6a46994e53d2d88d4c0c9940d10a1f981c0856ceefd3fc2
|
data/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
- ...
|
|
11
11
|
|
|
12
|
+
## [0.2.0] - 2026-05-22
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Tailwind v4 source partial at `frontend/styles/bridgetown-stoa.css`, shipped via a companion `bridgetown-stoa` npm package. Defines `--color-stoa-*` and `--font-stoa-*` design tokens (light + dark) in an `@theme` block, sets up class-strategy dark mode via `@custom-variant dark`, and applies a baseline `html` style. Host sites `@import "bridgetown-stoa"` and `@source` the layouts from their `frontend/styles/index.css`.
|
|
16
|
+
- `script/release` now also runs `npm publish` after the gem release, and pre-flights `npm whoami` so it bails before the gem push if credentials are missing.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- `bridgetown-stoa/layout` no longer prepends `"Index | "` to `<title>` on the home page when `src/index.md` has no explicit `title:` front-matter. (#8)
|
|
20
|
+
|
|
21
|
+
## [0.1.0] - 2026-05-22
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- `bridgetown-stoa/layout` is now a self-contained HTML document (doctype, `<head>` with title/meta/asset tags, and `<header>`/`<main>`/`<footer>` chrome). Consumers no longer need to provide their own `default` layout to use Stoa. The layout also prepends `resource.data.title` to `<title>` when set. (#5)
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
- The layout wires `asset_path :css` / `:js` for the host site's esbuild bundle. Bridgetown sites created with `bridgetown new` ship esbuild by default; sites without frontend bundling will see `MISSING_FRONTEND_BUNDLING_CONFIG` in the asset URLs until they configure one (or shadow the layout to drop the tags).
|
|
28
|
+
|
|
12
29
|
## [0.0.2] - 2026-05-22
|
|
13
30
|
|
|
14
31
|
### Fixed
|
data/README.md
CHANGED
|
@@ -22,6 +22,29 @@ Then `bundle install` and add to `config/initializers.rb`:
|
|
|
22
22
|
init :"bridgetown-stoa"
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
### Styles (Tailwind v4)
|
|
26
|
+
|
|
27
|
+
Stoa ships its styles as a Tailwind v4 source partial in a companion npm package (`bridgetown-stoa`), so they compose with your site's Tailwind pipeline (tree-shaken, token-overrideable).
|
|
28
|
+
|
|
29
|
+
```shell
|
|
30
|
+
npm install bridgetown-stoa
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then in `frontend/styles/index.css`, after `@import "tailwindcss";`, add two lines:
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
@import "tailwindcss";
|
|
37
|
+
@source "../../node_modules/bridgetown-stoa/layouts/**/*.serb";
|
|
38
|
+
@import "bridgetown-stoa";
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- `@source` tells Tailwind to scan Stoa's layouts for utility-class usage.
|
|
42
|
+
- `@import "bridgetown-stoa"` pulls in the `@theme` tokens (`--color-stoa-*`, `--font-stoa-*`) and a small `@layer base` that styles `html` with the theme colors.
|
|
43
|
+
|
|
44
|
+
Override any token by redeclaring it in your own `@theme` block after the import.
|
|
45
|
+
|
|
46
|
+
Stoa uses Tailwind's **class-strategy dark mode** (`html.dark`). Toggle the `dark` class on `<html>` to switch themes; a default JS toggle that follows `prefers-color-scheme` will ship in a later release.
|
|
47
|
+
|
|
25
48
|
## Usage
|
|
26
49
|
|
|
27
50
|
One layout is registered: `bridgetown-stoa/layout`. Apply it via front matter:
|
|
@@ -29,10 +52,23 @@ One layout is registered: `bridgetown-stoa/layout`. Apply it via front matter:
|
|
|
29
52
|
```yaml
|
|
30
53
|
---
|
|
31
54
|
layout: bridgetown-stoa/layout
|
|
55
|
+
title: My Page
|
|
32
56
|
---
|
|
33
57
|
```
|
|
34
58
|
|
|
35
|
-
The layout
|
|
59
|
+
The layout is self-contained: it renders a full HTML document (doctype, `<head>` with title and asset tags, semantic `<header>`/`<main>`/`<footer>` regions) and yields the page body into `<main>`. You do **not** need a `default` layout in your site to use Stoa.
|
|
60
|
+
|
|
61
|
+
The document title is `{page title} | {site metadata title}` when a page sets `title:` in front matter, and just the site title otherwise. The layout also injects `asset_path :css` / `:js` so your site's esbuild bundle loads automatically.
|
|
62
|
+
|
|
63
|
+
### Overriding the layout
|
|
64
|
+
|
|
65
|
+
To customize the chrome, shadow the layout in your own site:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
src/_layouts/bridgetown-stoa/layout.serb
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Bridgetown's layout resolution picks the host site's file over the gem's, so you can replace the entire layout or copy ours and edit it. (More granular override points — head, nav, footer partials — will land as the theme grows.)
|
|
36
72
|
|
|
37
73
|
## Development
|
|
38
74
|
|
data/bridgetown-stoa.gemspec
CHANGED
|
@@ -14,10 +14,11 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features)/!) }
|
|
15
15
|
spec.test_files = spec.files.grep(%r!^test/!)
|
|
16
16
|
spec.require_paths = ["lib"]
|
|
17
|
-
#
|
|
17
|
+
# TODO: enable the `npm_add` metadata below once the npm companion is
|
|
18
|
+
# published. While the package is unpublished, Bridgetown's init-time
|
|
19
|
+
# registry lookup 404s loudly during every test run.
|
|
18
20
|
# spec.metadata = {
|
|
19
21
|
# "npm_add" => "bridgetown-stoa@#{BridgetownStoa::VERSION}",
|
|
20
|
-
# "bridgetown_features" => "true"
|
|
21
22
|
# }
|
|
22
23
|
|
|
23
24
|
spec.required_ruby_version = ">= 3.2"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* bridgetown-stoa: Tailwind v4 source partial. Import after `@import "tailwindcss"`. */
|
|
2
|
+
|
|
3
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
4
|
+
|
|
5
|
+
@theme {
|
|
6
|
+
--color-stoa-bg: oklch(98% 0.002 264);
|
|
7
|
+
--color-stoa-surface: oklch(100% 0 0);
|
|
8
|
+
--color-stoa-fg: oklch(20% 0.012 264);
|
|
9
|
+
--color-stoa-muted: oklch(50% 0.012 264);
|
|
10
|
+
--color-stoa-border: oklch(92% 0.005 264);
|
|
11
|
+
--color-stoa-accent: oklch(55% 0.18 264);
|
|
12
|
+
--color-stoa-accent-fg: oklch(98% 0.002 264);
|
|
13
|
+
|
|
14
|
+
--font-stoa-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
15
|
+
--font-stoa-mono: ui-monospace, "SF Mono", Menlo, "Cascadia Code", monospace;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@layer base {
|
|
19
|
+
.dark {
|
|
20
|
+
--color-stoa-bg: oklch(17% 0.012 264);
|
|
21
|
+
--color-stoa-surface: oklch(22% 0.012 264);
|
|
22
|
+
--color-stoa-fg: oklch(94% 0.005 264);
|
|
23
|
+
--color-stoa-muted: oklch(65% 0.012 264);
|
|
24
|
+
--color-stoa-border: oklch(28% 0.012 264);
|
|
25
|
+
--color-stoa-accent: oklch(72% 0.16 264);
|
|
26
|
+
--color-stoa-accent-fg: oklch(15% 0.012 264);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
html {
|
|
30
|
+
background: var(--color-stoa-bg);
|
|
31
|
+
color: var(--color-stoa-fg);
|
|
32
|
+
font-family: var(--font-stoa-sans);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="{{ site.locale || 'en' }}">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>
|
|
7
|
+
{% if resource.data.title != "Index" %}
|
|
8
|
+
{{ resource.data.title }} |
|
|
9
|
+
{% end %}
|
|
10
|
+
{{ site.metadata.title }}
|
|
11
|
+
</title>
|
|
12
|
+
{% if resource.data.description %}
|
|
13
|
+
<meta name="description" content="{{ resource.data.description }}">
|
|
14
|
+
{% end %}
|
|
15
|
+
<link rel="stylesheet" href="{%= asset_path :css %}">
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<header class="stoa-header">
|
|
19
|
+
<a href="/" class="stoa-site-title">{{ site.metadata.title }}</a>
|
|
20
|
+
</header>
|
|
21
|
+
<main class="stoa-main">
|
|
22
|
+
{%= yield %}
|
|
23
|
+
</main>
|
|
24
|
+
<footer class="stoa-footer">
|
|
25
|
+
<small>
|
|
26
|
+
Built with <a href="https://www.bridgetownrb.com">Bridgetown</a>
|
|
27
|
+
<span>+</span>
|
|
28
|
+
<a href="https://github.com/Guided-Rails/bridgetown-stoa">Stoa</a>.
|
|
29
|
+
</small>
|
|
30
|
+
</footer>
|
|
31
|
+
<script src="{%= asset_path :js %}" defer></script>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
data/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bridgetown-stoa",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Tailwind v4 source partial and layouts for the Stoa Bridgetown documentation theme.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Guided-Rails/bridgetown-stoa.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/Guided-Rails/bridgetown-stoa",
|
|
11
|
+
"main": "frontend/styles/bridgetown-stoa.css",
|
|
12
|
+
"style": "frontend/styles/bridgetown-stoa.css",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./frontend/styles/bridgetown-stoa.css",
|
|
15
|
+
"./layouts/*": "./layouts/*"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"frontend/styles/",
|
|
19
|
+
"layouts/",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE.txt"
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"tailwindcss": "^4.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bridgetown-stoa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abdullah Hashim
|
|
@@ -80,9 +80,11 @@ files:
|
|
|
80
80
|
- README.md
|
|
81
81
|
- Rakefile
|
|
82
82
|
- bridgetown-stoa.gemspec
|
|
83
|
+
- frontend/styles/bridgetown-stoa.css
|
|
83
84
|
- layouts/bridgetown-stoa/layout.serb
|
|
84
85
|
- lib/bridgetown-stoa.rb
|
|
85
86
|
- lib/bridgetown-stoa/version.rb
|
|
87
|
+
- package.json
|
|
86
88
|
homepage: https://github.com/Guided-Rails/bridgetown-stoa
|
|
87
89
|
licenses:
|
|
88
90
|
- MIT
|