@brimsites/create-brim 0.0.0-stage → 1.0.2
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.
- package/LICENSE +110 -0
- package/README.md +7 -2
- package/index.js +190 -0
- package/package.json +25 -3
- package/template/AGENTS.md +116 -0
- package/template/README.md +69 -0
- package/template/_gitignore +9 -0
- package/template/astro.config.mjs +12 -0
- package/template/package.json +19 -0
- package/template/public/favicon.svg +1 -0
- package/template/public/images/hero.svg +1 -0
- package/template/src/components/CallToAction.astro +33 -0
- package/template/src/components/Features.astro +62 -0
- package/template/src/components/Hero.astro +53 -0
- package/template/src/components/SiteFooter.astro +88 -0
- package/template/src/components/SiteHeader.astro +116 -0
- package/template/src/components/navigation.ts +12 -0
- package/template/src/content-types/ArticlePage.astro +80 -0
- package/template/src/content-types/article.ts +31 -0
- package/template/src/content-types/index.ts +4 -0
- package/template/src/layouts/Site.astro +30 -0
- package/template/src/page-templates/LandingPage.astro +40 -0
- package/template/src/page-templates/index.ts +16 -0
- package/template/src/pages/about.astro +55 -0
- package/template/src/pages/blog/index.astro +20 -0
- package/template/src/pages/components.astro +234 -0
- package/template/src/pages/contact.astro +35 -0
- package/template/src/pages/index.astro +49 -0
- package/template/src/site-settings.ts +14 -0
- package/template/src/styles/global.css +94 -0
- package/template/tsconfig.json +1 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { iconNames } from "@brimsites/brimjs";
|
|
3
|
+
import {
|
|
4
|
+
Accordion,
|
|
5
|
+
Button,
|
|
6
|
+
Carousel,
|
|
7
|
+
Divider,
|
|
8
|
+
Form,
|
|
9
|
+
Icon,
|
|
10
|
+
Image,
|
|
11
|
+
ImageGallery,
|
|
12
|
+
Link,
|
|
13
|
+
Listing,
|
|
14
|
+
Map,
|
|
15
|
+
Newsletter,
|
|
16
|
+
RichText,
|
|
17
|
+
SocialMedia,
|
|
18
|
+
Text,
|
|
19
|
+
Video,
|
|
20
|
+
} from "@brimsites/brimjs/components";
|
|
21
|
+
import Site from "../layouts/Site.astro";
|
|
22
|
+
|
|
23
|
+
// Every primitive and block Brim ships, each with a few of its settings.
|
|
24
|
+
// Click any of them at /admin/edit to see all of its options in the sidebar. Delete this page when you no longer need it.
|
|
25
|
+
|
|
26
|
+
const photos = [
|
|
27
|
+
{ url: "/images/hero.svg", alt: "Colorful abstract shapes", title: "First" },
|
|
28
|
+
{ url: "/images/hero.svg", alt: "Colorful abstract shapes", title: "Second" },
|
|
29
|
+
{ url: "/images/hero.svg", alt: "Colorful abstract shapes", title: "Third" },
|
|
30
|
+
{ url: "/images/hero.svg", alt: "Colorful abstract shapes", title: "Fourth" },
|
|
31
|
+
];
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<Site title="Components" description="Every Brim primitive and block on one page.">
|
|
35
|
+
<section class="section">
|
|
36
|
+
<div class="container">
|
|
37
|
+
<p class="eyebrow">Reference</p>
|
|
38
|
+
<h1>Components</h1>
|
|
39
|
+
<p class="lead">
|
|
40
|
+
Every primitive and block Brim ships. Open this page at /admin/edit and click one to change it.
|
|
41
|
+
</p>
|
|
42
|
+
<nav class="toc" aria-label="On this page">
|
|
43
|
+
<a href="#text">Text</a>
|
|
44
|
+
<a href="#buttons">Buttons and links</a>
|
|
45
|
+
<a href="#media">Images and video</a>
|
|
46
|
+
<a href="#icons">Icons</a>
|
|
47
|
+
<a href="#layout">Accordion and divider</a>
|
|
48
|
+
<a href="#content">Listing</a>
|
|
49
|
+
<a href="#forms">Forms</a>
|
|
50
|
+
<a href="#places">Map and social</a>
|
|
51
|
+
</nav>
|
|
52
|
+
</div>
|
|
53
|
+
</section>
|
|
54
|
+
|
|
55
|
+
<section class="section section--tinted" id="text">
|
|
56
|
+
<div class="container stack">
|
|
57
|
+
<h2>Text</h2>
|
|
58
|
+
<Text nodeId="demo-heading" as="h3">
|
|
59
|
+
A heading made with Text
|
|
60
|
+
</Text>
|
|
61
|
+
<Text nodeId="demo-paragraph">
|
|
62
|
+
A paragraph. Select it in the editor to make words bold, italic or a link, change its color or alignment.
|
|
63
|
+
</Text>
|
|
64
|
+
<RichText nodeId="demo-richtext">
|
|
65
|
+
<p>RichText holds several paragraphs, headings and lists that the owner writes freely.</p>
|
|
66
|
+
<ul>
|
|
67
|
+
<li>Lists</li>
|
|
68
|
+
<li>
|
|
69
|
+
<strong>Formatting</strong> and <a href="/about">links</a>
|
|
70
|
+
</li>
|
|
71
|
+
</ul>
|
|
72
|
+
</RichText>
|
|
73
|
+
</div>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<section class="section" id="buttons">
|
|
77
|
+
<div class="container stack">
|
|
78
|
+
<h2>Buttons and links</h2>
|
|
79
|
+
<div class="row">
|
|
80
|
+
<Button nodeId="demo-button-accent" text="Accent" url="/contact" variant="accent" />
|
|
81
|
+
<Button nodeId="demo-button-block" text="Block" url="/contact" variant="block" />
|
|
82
|
+
<Button nodeId="demo-button-light" text="Light" url="/contact" variant="light-2" />
|
|
83
|
+
<Button nodeId="demo-button-ghost" text="Outline" url="/contact" variant="ghost" />
|
|
84
|
+
<Button
|
|
85
|
+
nodeId="demo-button-icon"
|
|
86
|
+
text="With an icon"
|
|
87
|
+
url="/contact"
|
|
88
|
+
variant="dark-1"
|
|
89
|
+
showIcon
|
|
90
|
+
icon="arrow-right"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="row">
|
|
94
|
+
<Button nodeId="demo-button-sm" text="Small" url="/contact" size="sm" />
|
|
95
|
+
<Button nodeId="demo-button-md" text="Medium" url="/contact" size="md" />
|
|
96
|
+
<Button nodeId="demo-button-lg" text="Large" url="/contact" size="lg" />
|
|
97
|
+
</div>
|
|
98
|
+
<Link nodeId="demo-link" href="/about">
|
|
99
|
+
A plain link whose text and address the owner can change
|
|
100
|
+
</Link>
|
|
101
|
+
</div>
|
|
102
|
+
</section>
|
|
103
|
+
|
|
104
|
+
<section class="section section--tinted" id="media">
|
|
105
|
+
<div class="container stack">
|
|
106
|
+
<h2>Images and video</h2>
|
|
107
|
+
<Image
|
|
108
|
+
nodeId="demo-image"
|
|
109
|
+
src="/images/hero.svg"
|
|
110
|
+
alt="Colorful abstract shapes"
|
|
111
|
+
width="640"
|
|
112
|
+
height="480"
|
|
113
|
+
showCaption
|
|
114
|
+
caption="An image with a caption"
|
|
115
|
+
/>
|
|
116
|
+
<ImageGallery nodeId="demo-gallery" images={photos} columns={4} />
|
|
117
|
+
<Carousel
|
|
118
|
+
nodeId="demo-carousel"
|
|
119
|
+
images={photos.map((photo) => ({ url: photo.url, alt: photo.alt, caption: photo.title }))}
|
|
120
|
+
slidesPerView={2}
|
|
121
|
+
gap={16}
|
|
122
|
+
showDots
|
|
123
|
+
/>
|
|
124
|
+
<Video nodeId="demo-video" url="https://www.youtube.com/watch?v=aqz-KE-bpKQ" />
|
|
125
|
+
</div>
|
|
126
|
+
</section>
|
|
127
|
+
|
|
128
|
+
<section class="section" id="icons">
|
|
129
|
+
<div class="container">
|
|
130
|
+
<h2>Icons</h2>
|
|
131
|
+
<p class="lead">The built-in set. Icon and Button accept any of these names.</p>
|
|
132
|
+
<ul class="icons">
|
|
133
|
+
{iconNames.map((name) => (
|
|
134
|
+
<li>
|
|
135
|
+
<Icon nodeId={`demo-icon-${name}`} icon={name} />
|
|
136
|
+
<code>{name}</code>
|
|
137
|
+
</li>
|
|
138
|
+
))}
|
|
139
|
+
</ul>
|
|
140
|
+
</div>
|
|
141
|
+
</section>
|
|
142
|
+
|
|
143
|
+
<section class="section section--tinted" id="layout">
|
|
144
|
+
<div class="container stack">
|
|
145
|
+
<h2>Accordion and divider</h2>
|
|
146
|
+
<Accordion
|
|
147
|
+
nodeId="demo-accordion"
|
|
148
|
+
items={[
|
|
149
|
+
{ title: "First question", content: "Answers open and close without JavaScript." },
|
|
150
|
+
{ title: "Second question", content: "The owner adds, removes and reorders the items." },
|
|
151
|
+
]}
|
|
152
|
+
/>
|
|
153
|
+
<Divider nodeId="demo-divider-solid" />
|
|
154
|
+
</div>
|
|
155
|
+
</section>
|
|
156
|
+
|
|
157
|
+
<section class="section" id="content">
|
|
158
|
+
<div class="container">
|
|
159
|
+
<h2>Listing</h2>
|
|
160
|
+
<p class="lead">Items of a content type declared in src/content-types. Add articles in the editor to fill it.</p>
|
|
161
|
+
<Listing nodeId="demo-listing" type="article" columns={3} />
|
|
162
|
+
</div>
|
|
163
|
+
</section>
|
|
164
|
+
|
|
165
|
+
<section class="section section--tinted" id="forms">
|
|
166
|
+
<div class="container forms">
|
|
167
|
+
<div class="stack">
|
|
168
|
+
<h2>Form</h2>
|
|
169
|
+
<Form nodeId="demo-form" formName="Demo form" />
|
|
170
|
+
</div>
|
|
171
|
+
<div class="stack">
|
|
172
|
+
<h2>Newsletter</h2>
|
|
173
|
+
<Newsletter nodeId="demo-newsletter" />
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</section>
|
|
177
|
+
|
|
178
|
+
<section class="section" id="places">
|
|
179
|
+
<div class="container stack">
|
|
180
|
+
<h2>Map and social</h2>
|
|
181
|
+
<Map nodeId="demo-map" points={[{ lat: 46.7712, lng: 23.6236, title: "Studio", address: "Cluj-Napoca" }]} />
|
|
182
|
+
<SocialMedia nodeId="demo-share" scope="page" mode="share" shareText="Look at this page" />
|
|
183
|
+
</div>
|
|
184
|
+
</section>
|
|
185
|
+
</Site>
|
|
186
|
+
|
|
187
|
+
<style>
|
|
188
|
+
.toc {
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-wrap: wrap;
|
|
191
|
+
gap: 0.5rem 1.25rem;
|
|
192
|
+
margin-top: 1.5rem;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.toc a {
|
|
196
|
+
color: var(--brim-theme-accent);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.row {
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-wrap: wrap;
|
|
202
|
+
align-items: center;
|
|
203
|
+
gap: 0.75rem;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.icons {
|
|
207
|
+
display: grid;
|
|
208
|
+
grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
|
|
209
|
+
gap: 1rem;
|
|
210
|
+
margin: 2rem 0;
|
|
211
|
+
padding: 0;
|
|
212
|
+
list-style: none;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.icons li {
|
|
216
|
+
display: grid;
|
|
217
|
+
justify-items: center;
|
|
218
|
+
gap: 0.5rem;
|
|
219
|
+
padding: 1rem 0.5rem;
|
|
220
|
+
border: 1px solid var(--brim-theme-light2);
|
|
221
|
+
border-radius: var(--site-radius);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.icons code {
|
|
225
|
+
font-size: 0.75rem;
|
|
226
|
+
color: var(--brim-theme-dark1);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.forms {
|
|
230
|
+
display: grid;
|
|
231
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
|
|
232
|
+
gap: clamp(2rem, 5vw, 4rem);
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Form, Map, Text } from "@brimsites/brimjs/components";
|
|
3
|
+
import Site from "../layouts/Site.astro";
|
|
4
|
+
|
|
5
|
+
// Messages are checked against abuse and saved; the owner reads them under "Form responses" in the editor.
|
|
6
|
+
// On a host that only serves static files, forms need the Brim server part to receive messages.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<Site title="Contact" description="Write to us or visit the studio.">
|
|
10
|
+
<section class="section">
|
|
11
|
+
<div class="container contact">
|
|
12
|
+
<div class="stack">
|
|
13
|
+
<Text nodeId="contact-title" as="h1">
|
|
14
|
+
Get in touch
|
|
15
|
+
</Text>
|
|
16
|
+
<Text nodeId="contact-lead" class="lead">
|
|
17
|
+
Tell us what you need. We answer every message.
|
|
18
|
+
</Text>
|
|
19
|
+
<Form nodeId="contact-form" formName="Contact" />
|
|
20
|
+
</div>
|
|
21
|
+
<Map
|
|
22
|
+
nodeId="contact-map"
|
|
23
|
+
points={[{ lat: 46.7712, lng: 23.6236, title: "Studio", address: "Piața Unirii, Cluj-Napoca" }]}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
</Site>
|
|
28
|
+
|
|
29
|
+
<style>
|
|
30
|
+
.contact {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
|
|
33
|
+
gap: clamp(2rem, 5vw, 4rem);
|
|
34
|
+
}
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Listing, Text } from "@brimsites/brimjs/components";
|
|
3
|
+
import CallToAction from "../components/CallToAction.astro";
|
|
4
|
+
import Features from "../components/Features.astro";
|
|
5
|
+
import Hero from "../components/Hero.astro";
|
|
6
|
+
import Site from "../layouts/Site.astro";
|
|
7
|
+
import { SITE_NAME } from "../components/navigation.ts";
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<Site title={SITE_NAME} description="A site written in Astro and edited in the browser.">
|
|
11
|
+
<Hero
|
|
12
|
+
id="home-hero"
|
|
13
|
+
eyebrow="Welcome"
|
|
14
|
+
title="A website you can change yourself"
|
|
15
|
+
lead="Every text, image and link on this page can be edited at /admin/edit. The layout stays in code."
|
|
16
|
+
cta={{ text: "See the components", url: "/components" }}
|
|
17
|
+
image={{ src: "/images/hero.svg", alt: "Colorful abstract shapes" }}
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<Features
|
|
21
|
+
id="home-features"
|
|
22
|
+
title="What this starter includes"
|
|
23
|
+
features={[
|
|
24
|
+
{ icon: "home", title: "Pages in Astro", text: "Write pages and sections as Astro components in src." },
|
|
25
|
+
{ icon: "settings", title: "Edited in place", text: "Owners change texts, images and settings on the page." },
|
|
26
|
+
{
|
|
27
|
+
icon: "star",
|
|
28
|
+
title: "Static output",
|
|
29
|
+
text: "The build is plain HTML and CSS, with JavaScript only where needed.",
|
|
30
|
+
},
|
|
31
|
+
]}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<section class="section">
|
|
35
|
+
<div class="container">
|
|
36
|
+
<Text nodeId="home-articles-title" as="h2">
|
|
37
|
+
Latest articles
|
|
38
|
+
</Text>
|
|
39
|
+
<Listing nodeId="home-articles" type="article" columns={3} maxItems={3} />
|
|
40
|
+
</div>
|
|
41
|
+
</section>
|
|
42
|
+
|
|
43
|
+
<CallToAction
|
|
44
|
+
id="home-cta"
|
|
45
|
+
title="Have a project in mind?"
|
|
46
|
+
text="Tell us about it and we will get back to you within two working days."
|
|
47
|
+
cta={{ text: "Get in touch", url: "/contact" }}
|
|
48
|
+
/>
|
|
49
|
+
</Site>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineSiteSettings } from "@brimsites/brimjs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The site's own settings: facts about the whole site its owner changes in Site Settings (or an agent through the
|
|
5
|
+
* MCP), read by every page with `getSiteSettings()` or shown with `<Setting name="…" />`. Add what the site needs:
|
|
6
|
+
* WhatsApp, an address, opening hours, links to legal pages… Never write these into pages or constants.
|
|
7
|
+
*/
|
|
8
|
+
export const siteSettings = defineSiteSettings({
|
|
9
|
+
fields: [
|
|
10
|
+
{ name: "email", label: "Email", type: "email", group: "Contact", default: "hello@example.com" },
|
|
11
|
+
{ name: "phone", label: "Phone", type: "text", group: "Contact", help: "As visitors should read it, e.g. +1 555 0100." },
|
|
12
|
+
{ name: "address", label: "Address", type: "textarea", group: "Contact" },
|
|
13
|
+
],
|
|
14
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The site's colors. Brim blocks read the --brim-theme-* names, and the editor offers them
|
|
3
|
+
* in every color setting, so change them here and the whole site follows.
|
|
4
|
+
*/
|
|
5
|
+
:root {
|
|
6
|
+
--brim-theme-background: #ffffff;
|
|
7
|
+
--brim-theme-light1: #f6f5f2;
|
|
8
|
+
--brim-theme-light2: #e7e5df;
|
|
9
|
+
--brim-theme-accent: #2f5d50;
|
|
10
|
+
--brim-theme-accent-contrast: #ffffff;
|
|
11
|
+
--brim-theme-primary: #1d1d1b;
|
|
12
|
+
--brim-theme-dark1: #4a4a45;
|
|
13
|
+
--brim-theme-dark2: #111110;
|
|
14
|
+
|
|
15
|
+
--site-width: 72rem;
|
|
16
|
+
--site-gutter: clamp(1rem, 4vw, 2.5rem);
|
|
17
|
+
--site-space: clamp(3rem, 8vw, 6rem);
|
|
18
|
+
--site-radius: 0.75rem;
|
|
19
|
+
--site-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
*,
|
|
23
|
+
*::before,
|
|
24
|
+
*::after {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
margin: 0;
|
|
30
|
+
background: var(--brim-theme-background);
|
|
31
|
+
color: var(--brim-theme-primary);
|
|
32
|
+
font-family: var(--site-font);
|
|
33
|
+
line-height: 1.6;
|
|
34
|
+
-webkit-font-smoothing: antialiased;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
img {
|
|
38
|
+
max-width: 100%;
|
|
39
|
+
height: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
a {
|
|
43
|
+
color: inherit;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
h1,
|
|
47
|
+
h2,
|
|
48
|
+
h3 {
|
|
49
|
+
line-height: 1.15;
|
|
50
|
+
letter-spacing: -0.02em;
|
|
51
|
+
margin: 0 0 0.5em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
h1 {
|
|
55
|
+
font-size: clamp(2.25rem, 5vw, 3.75rem);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
h2 {
|
|
59
|
+
font-size: clamp(1.75rem, 3.5vw, 2.5rem);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* A centered column for page content. */
|
|
63
|
+
.container {
|
|
64
|
+
width: min(100% - 2 * var(--site-gutter), var(--site-width));
|
|
65
|
+
margin-inline: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* A band of the page with room above and below. */
|
|
69
|
+
.section {
|
|
70
|
+
padding-block: var(--site-space);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.section--tinted {
|
|
74
|
+
background: var(--brim-theme-light1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.eyebrow {
|
|
78
|
+
color: var(--brim-theme-accent);
|
|
79
|
+
font-size: 0.8125rem;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
letter-spacing: 0.08em;
|
|
82
|
+
text-transform: uppercase;
|
|
83
|
+
margin: 0 0 0.75rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.lead {
|
|
87
|
+
color: var(--brim-theme-dark1);
|
|
88
|
+
font-size: 1.125rem;
|
|
89
|
+
max-width: 40rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.stack > * + * {
|
|
93
|
+
margin-top: 1.5rem;
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "extends": "astro/tsconfigs/strict", "include": [".astro/types.d.ts", "src"] }
|