Skip to content

Commit c0f074d

Browse files
committed
Styling tweaks, privacy policy
1 parent 5efa362 commit c0f074d

19 files changed

+1049
-838
lines changed

astro/package-lock.json

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

astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@wasmer/wasi": "^1.2.2",
2121
"algoliasearch": "^4.23.3",
2222
"assert": "^2.1.0",
23-
"astro": "^4.13.3",
23+
"astro": "^4.16.13",
2424
"buffer": "^6.0.3",
2525
"constants-browserify": "^1.0.0",
2626
"events": "^3.3.0",

astro/scripts/generateContributors.js

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,11 @@ import fs from "node:fs";
44
async function generateContributors() {
55
const octokit = new Octokit({ auth: process.env.GITHUB_ACCESS_TOKEN });
66

7-
const PAGE_SIZE = 25;
8-
let results = [];
9-
let batch = [];
10-
let pageNumber = 1;
11-
do {
12-
const res = await octokit.rest.repos.listContributors({
13-
owner: "grain-lang",
14-
repo: "grain",
15-
page: pageNumber,
16-
per_page: PAGE_SIZE,
17-
});
18-
19-
if (res.status !== 200) {
20-
console.error("Failed to get contributors");
21-
return;
22-
}
23-
24-
batch = res.data;
25-
results.push(...batch);
26-
pageNumber++;
27-
} while (batch.length === PAGE_SIZE);
7+
const results = await octokit.paginate(octokit.rest.repos.listContributors, {
8+
owner: "grain-lang",
9+
repo: "grain",
10+
per_page: 25,
11+
});
2812

2913
fs.writeFileSync("../contributors.json", JSON.stringify(results, undefined, 4));
3014
}

astro/src/components/BlogEntry.astro

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ interface Props {
2323
}
2424
2525
const { entry } = Astro.props;
26-
27-
const images = import.meta.glob<{ default: ImageMetadata }>("/src/images/cover/*.jpg");
28-
if (!images[entry.data.cover]) {
29-
throw new Error(`Image ${entry.data.cover} not found for blog`);
30-
}
3126
---
3227

3328
<div class="max-w-[48rem] mx-auto px-5 py-6 md:p-8">
@@ -64,7 +59,7 @@ if (!images[entry.data.cover]) {
6459
</div>
6560
<figure class="py-10">
6661
<Image
67-
src={images[entry.data.cover]()}
62+
src={entry.data.cover}
6863
alt={entry.data.coverAttribution}
6964
class="max-h-[26rem] w-full object-cover"
7065
/>

astro/src/components/BlogHero.astro

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ interface Props {
1212
}
1313
1414
const { entry } = Astro.props;
15-
16-
const images = import.meta.glob<{ default: ImageMetadata }>("/src/images/cover/*.jpg");
17-
if (!images[entry.data.cover]) {
18-
throw new Error(`Image ${entry.data.cover} not found for blog`);
19-
}
2015
---
2116

2217
<div class="mx-auto max-w-[70rem] pb-5 lg:pb-28 px-5">
@@ -46,7 +41,7 @@ if (!images[entry.data.cover]) {
4641
<a href="https://discord.com/invite/grain-lang" class="underline">Discord</a>
4742
</div>
4843
</div>
49-
<div class="flex items-stretch bg-color-background-bright dark:bg-gray-variant-80 rounded-lg p-5 lg:p-8 drop-shadow-xl">
44+
<div class="lg:flex lg:items-stretch bg-color-background-bright dark:bg-gray-variant-80 rounded-lg p-5 lg:p-8 drop-shadow-xl">
5045
<div class="p-0 lg:p-6 lg:w-5/12">
5146
<h1 class="text-2xl font-bold mb-5"><a href={`/blog/${entry.slug}`}>{entry.data.title}</a></h1>
5247
<BlogAuthor entry={entry} imgClass="w-12 h-12" nameClass="text-lg" />
@@ -59,7 +54,7 @@ if (!images[entry.data.cover]) {
5954
</div>
6055
<div class="w-0 lg:w-7/12 pl-6">
6156
<Image
62-
src={images[entry.data.cover]()}
57+
src={entry.data.cover}
6358
alt={entry.data.coverAttribution ?? `${entry.data.title} cover image`}
6459
class="w-full h-full object-cover rounded"
6560
/>

astro/src/components/BlogThumbnail.astro

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@ interface Props {
88
}
99
1010
const { entry } = Astro.props;
11-
12-
const images = import.meta.glob<{ default: ImageMetadata }>("/src/images/cover/*.jpg");
13-
if (!images[entry.data.cover]) {
14-
throw new Error(`Image ${entry.data.cover} not found for blog`);
15-
}
1611
---
1712

1813
<div class="flex flex-col drop-shadow-sm border rounded-lg border-gray-10 dark:border-color-background-bright dark:bg-color-dim-3 overflow-hidden">
1914
<a href={`/blog/${entry.slug}`} class="grow flex flex-col">
2015
<Image
21-
src={images[entry.data.cover]()}
16+
src={entry.data.cover}
2217
alt={entry.data.coverAttribution ?? `${entry.data.title} thumbnail`}
2318
class="w-full h-[10rem] md:h-[14rem] object-cover"
2419
/>

astro/src/components/Contributors.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ const special = [
3030
<img class="w-14 h-14 rounded-full p-0.5 shadow-md border border-color-dim-2 dark:shadow-purple-80" src={contributor.avatar_url} alt={`Image of ${contributor.login}`} />
3131
</a>
3232
{special.includes(contributor.login) && (
33-
<div class="absolute text-3xl bottom-0 right-0 text-yellow-500 [text-shadow:0_0_2px_#000]">★</div>
33+
<a href={contributor.html_url} class="absolute text-3xl bottom-0 right-0 text-yellow-500 [text-shadow:0_0_2px_#000]">★</a>
3434
)}
3535
</div>
3636
))}
3737

3838
<p class="mt-6">
39-
<span class="text-2xl text-yellow-500">★</span> = Noteworthy contributors who we feel have made signifant contributions to the project.
39+
<span class="text-2xl text-yellow-500">★</span> = Noteworthy contributors who have made signifant contributions to the project.
4040
</p>
4141
</div>

astro/src/components/CoreTeam.astro

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import oscarHeadshot from "../images/headshots/oscar-headshot-square.jpg";
44
import philipHeadshot from "../images/headshots/philip-headshot-square.jpg";
55
import blaineHeadshot from "../images/headshots/blaine-headshot-square.jpg";
66
import marcusHeadshot from "../images/headshots/marcus-headshot-square.jpg";
7-
import josiahHeadshot from "../images/headshots/josiah-headshot-square.jpg";
87
import jakeProfile from "../images/headshots/jake-profile-square.png";
98
import alexHeadshot from "../images/headshots/alex-headshot-square.jpg";
109
---
@@ -146,7 +145,24 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg";
146145
githubUsername="spotandjake"
147146
>
148147
<p>
149-
...
148+
Driven by a passion for programming languages and WebAssembly, Jake
149+
brings a fresh and dynamic perspective to the Grain core team. His
150+
contributions focus on enhancing the standard library, Jake has played
151+
a key role in building the JSON and Number libraries, refining
152+
documentation, and supporting language server development. On occasion,
153+
he also contributes to the compiler, further expanding his expertise.
154+
</p>
155+
156+
<p>
157+
Currently studying type checking and compiler development, Jake blends
158+
his curiosity for programming languages with hands-on contributions to
159+
Grain. Outside of tech, he enjoys exploring the outdoors and engineering.
160+
</p>
161+
162+
<p>
163+
Jake is constantly exploring ways to push the boundaries of what's
164+
possible with programming languages and is always eager to learn new
165+
things and contribute to the advancement of technology.
150166
</p>
151167
</CoreTeamMemberInfo>
152168

astro/src/components/NewsletterSignup.astro

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,29 @@
55
<p class="text-color-dim mb-2">Sign up for farm-to-inbox developer news</p>
66
<div>
77
<form
8+
class="flex"
9+
name="mailing-list-signup"
10+
method="POST"
11+
netlify-honeypot="bot-field"
12+
data-netlify="true"
13+
>
14+
<input type="email" name="email" placeholder="[email protected]" class="bg-color-background-bright text-black rounded box-content border border-color-dim-3 hover:border-color-dim-2 px-5 py-2 flex-1 w-full" />
15+
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
16+
<div class="hidden"><input name="bot-field" /></div>
17+
<input type="submit" value="Sign up" class="cursor-pointer ml-1 bg-color-dim-1 text-white px-6 py-2 rounded border border-color-dim-1 flex-0 hover:opacity-90" />
18+
</form>
19+
<!-- <form
820
class="flex"
921
action="https://grain-lang.us18.list-manage.com/subscribe/post?u=b33eb7484930855e59aae309f&amp;id=e8b0f20480"
1022
method="post"
1123
target="_blank"
1224
novalidate
1325
>
14-
<input type="email" name="EMAIL" placeholder="[email protected]" class="bg-color-background-bright text-black rounded box-content border border-color-dim-3 hover:border-color-dim-2 px-5 py-2 flex-1 w-full" />
26+
<input type="email" name="EMAIL" placeholder="[email protected]" class="bg-color-background-bright text-black rounded box-content border border-color-dim-3 hover:border-color-dim-2 px-5 py-2 flex-1 w-full" /> -->
1527
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
16-
<div style="position: absolute; left: -5000px;"><input type="text" name="b_b33eb7484930855e59aae309f_e8b0f20480" tabindex="-1" value=""></div>
28+
<!-- <div style="position: absolute; left: -5000px;"><input type="text" name="b_b33eb7484930855e59aae309f_e8b0f20480" tabindex="-1" value=""></div>
1729
<input type="submit" value="Sign up" name="subscribe" class="cursor-pointer ml-1 bg-color-dim-1 text-white px-6 py-2 rounded border border-color-dim-1 flex-0 hover:opacity-90" />
18-
</form>
30+
</form> -->
1931
</div>
20-
<!-- TODO privacy policy -->
21-
<p class="text-color-dim mt-2 text-sm">You can unsubscribe at any time. Read our <a>privacy policy</a>.</p>
32+
<p class="text-color-dim mt-2 text-sm">You can unsubscribe at any time. Read our <a href="/privacy">privacy policy</a>.</p>
2233
</div>

astro/src/components/Playground.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
9595
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
9696
themeChangeUnsub = store.$selectedTheme.subscribe(selectedTheme => {
97-
monaco.editor.setTheme(selectedTheme === "light" || !prefersDark ? "github-light" : "github-dark-modified");
97+
monaco.editor.setTheme(selectedTheme === "light" || (!selectedTheme && !prefersDark) ? "github-light" : "github-dark-modified");
9898
});
9999
100100
worker.addEventListener("message", ({ data }) => {
@@ -151,7 +151,7 @@
151151
</div>
152152
<div class="grid grid-cols-1 grid-rows-2 lg:grid-cols-2 lg:grid-rows-1 h-[calc(100vh-3.5rem-5rem)] max-h-[calc(100vh-3.5rem-5rem)]">
153153
<div id="editor"></div>
154-
<section class="dark:bg-[#2F254B] bg-[#EFEFEF] {state === 'compiledWithErrors' ? 'border-4 border-red-500 dark:border-[#C43550] dark:bg-[#4F2B38] bg-red-200' : ''}">
154+
<section class="dark:bg-[#2F254B] bg-[#EFEFEF] {state === 'compiledWithErrors' ? 'border-4 border-red-500 dark:border-[#C43550] dark:bg-[#3D222C] bg-red-200' : ''}">
155155
{#if loadingState}
156156
<div class="flex items-center justify-center w-full h-full">
157157
<div class="flex flex-col gap-2 items-center">

astro/src/components/Subscribe.astro

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)