Skip to content

Commit 58de997

Browse files
authored
Add community meeting page and redesign the navigation (#157)
1 parent c575618 commit 58de997

11 files changed

Lines changed: 348 additions & 25 deletions

File tree

‎.claude/launch.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.0.1",
3+
"configurations": [
4+
{
5+
"name": "robostack-site",
6+
"runtimeExecutable": "env",
7+
"runtimeArgs": ["ASTRO_DEV_BACKGROUND=1", "pixi", "run", "serve"],
8+
"port": 4321
9+
}
10+
]
11+
}

‎astro.config.mjs‎

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { defineConfig } from "astro/config";
33
import starlight from "@astrojs/starlight";
44
import svelte from "@astrojs/svelte";
5-
import { newestRelease } from "./src/data/distros.ts";
65

76
export default defineConfig({
87
site: "https://robostack.github.io",
@@ -33,25 +32,43 @@ export default defineConfig({
3332
customCss: ["./src/styles/custom.css"],
3433
routeMiddleware: "./src/routeData.ts",
3534
components: {
35+
Header: "./src/components/Header.astro",
36+
Sidebar: "./src/components/Sidebar.astro",
3637
SiteTitle: "./src/components/SiteTitle.astro",
3738
PageTitle: "./src/components/PageTitle.astro",
3839
},
3940
sidebar: [
40-
// Slugs are set explicitly in each page's frontmatter to keep the
41-
// published mixed-case URLs (`GettingStarted.html`, `FAQ.html`, ...).
42-
{ label: "Getting Started", slug: "GettingStarted" },
41+
// One top-level group per header tab (src/components/Header.astro);
42+
// the Sidebar override shows only the current page's group, so these
43+
// group labels never render. Slugs are set explicitly in each page's
44+
// frontmatter to keep the published mixed-case URLs
45+
// (`GettingStarted.html`, `FAQ.html`, ...).
4346
{
44-
label: "Alternative to Pixi",
47+
label: "Docs",
4548
items: [
46-
{ label: "Micromamba", slug: "micromamba" },
47-
{ label: "Conda", slug: "conda" },
49+
{ label: "Getting Started", slug: "GettingStarted" },
50+
{
51+
label: "Alternative to Pixi",
52+
items: [
53+
{ label: "Micromamba", slug: "micromamba" },
54+
{ label: "Conda", slug: "conda" },
55+
],
56+
},
57+
{ label: "JupyterRos", slug: "JupyterRos" },
58+
{ label: "FAQ", slug: "FAQ" },
59+
// Cross-listed; its primary section is Community (the last
60+
// group containing a page wins in the Sidebar override).
61+
{ label: "Contributing", slug: "Contributing" },
62+
],
63+
},
64+
{
65+
label: "Community",
66+
items: [
67+
{ label: "Community Meeting", slug: "CommunityMeeting" },
68+
{ label: "Support", slug: "support" },
69+
{ label: "Contributing", slug: "Contributing" },
4870
],
4971
},
50-
{ label: "Packages", link: `/${newestRelease().name}.html` },
51-
{ label: "JupyterRos", slug: "JupyterRos" },
52-
{ label: "Support", slug: "support" },
53-
{ label: "Contributing", slug: "Contributing" },
54-
{ label: "FAQ", slug: "FAQ" },
5572
],
5673
}),
5774
svelte(),

‎src/components/Header.astro‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
import config from "virtual:starlight/user-config";
3+
4+
import LanguageSelect from "virtual:starlight/components/LanguageSelect";
5+
import Search from "virtual:starlight/components/Search";
6+
import SiteTitle from "virtual:starlight/components/SiteTitle";
7+
import SocialIcons from "virtual:starlight/components/SocialIcons";
8+
import ThemeSelect from "virtual:starlight/components/ThemeSelect";
9+
10+
import { NAV_TABS as tabs } from "../data/nav";
11+
12+
/**
13+
* Override of Starlight's Header: the original row plus a tab row underneath
14+
* (the zensical.org pattern), so the main sections stay reachable from every
15+
* page - the splash homepage has no sidebar. The row's extra height comes
16+
* from `--sl-nav-height`, raised in custom.css; the first row keeps the
17+
* original height via `--rs-nav-row`. The tabs live in src/data/nav.ts,
18+
* shared with the Sidebar override.
19+
*/
20+
21+
const shouldRenderSearch =
22+
config.pagefind ||
23+
config.components.Search !== "@astrojs/starlight/components/Search.astro";
24+
25+
const pathname = Astro.url.pathname;
26+
---
27+
28+
<div class="stacked">
29+
<div class="header">
30+
<div class="title-wrapper sl-flex">
31+
<SiteTitle />
32+
</div>
33+
<div class="search-wrapper sl-flex print:hidden">
34+
{shouldRenderSearch && <Search />}
35+
</div>
36+
<div class="sl-hidden md:sl-flex print:hidden right-group">
37+
<div class="sl-flex social-icons">
38+
<SocialIcons />
39+
</div>
40+
<ThemeSelect />
41+
<LanguageSelect />
42+
</div>
43+
</div>
44+
<nav class="top-nav print:hidden" aria-label="Main">
45+
{
46+
tabs.map((tab) => (
47+
<a
48+
href={tab.href}
49+
aria-current={tab.match.test(pathname) ? "page" : undefined}
50+
>
51+
{tab.label}
52+
</a>
53+
))
54+
}
55+
</nav>
56+
</div>
57+
58+
<script>
59+
// On narrow screens the tab row scrolls; keep the active tab in view.
60+
document
61+
.querySelector('.top-nav a[aria-current="page"]')
62+
?.scrollIntoView({ inline: "center", block: "nearest" });
63+
</script>
64+
65+
{
66+
/* The first-row styles are copied from Starlight's Header.astro so the
67+
original layout survives the override; only `.stacked` and `.top-nav`
68+
are new. */
69+
}
70+
<style>
71+
.stacked {
72+
display: flex;
73+
flex-direction: column;
74+
justify-content: space-between;
75+
height: 100%;
76+
}
77+
78+
.header {
79+
display: flex;
80+
gap: var(--sl-nav-gap);
81+
justify-content: space-between;
82+
align-items: center;
83+
height: calc(var(--rs-nav-row) - 2 * var(--sl-nav-pad-y));
84+
}
85+
86+
.title-wrapper {
87+
/* Prevent long titles overflowing and covering the search and menu buttons on narrow viewports. */
88+
overflow: clip;
89+
/* Avoid clipping focus ring around link inside title wrapper. */
90+
padding: 0.25rem;
91+
margin: -0.25rem;
92+
min-width: 0;
93+
}
94+
95+
.right-group,
96+
.social-icons {
97+
gap: 1rem;
98+
align-items: center;
99+
}
100+
.social-icons::after {
101+
content: "";
102+
height: 2rem;
103+
border-inline-end: 1px solid var(--sl-color-gray-5);
104+
}
105+
106+
.top-nav {
107+
display: flex;
108+
gap: 1.5rem;
109+
overflow-x: auto;
110+
scrollbar-width: none;
111+
font-size: var(--sl-text-sm);
112+
/* Sit on the header's bottom border, zensical-style: the active tab's
113+
underline touches the border, and the space freed up moves between
114+
the logo row and the tabs. */
115+
margin-block-end: calc(-1 * var(--sl-nav-pad-y));
116+
}
117+
.top-nav a {
118+
color: var(--sl-color-gray-2);
119+
text-decoration: none;
120+
white-space: nowrap;
121+
padding-block: 0.25rem 0.4rem;
122+
border-bottom: 2px solid transparent;
123+
}
124+
.top-nav a:hover {
125+
color: var(--sl-color-white);
126+
}
127+
.top-nav a[aria-current="page"] {
128+
color: var(--sl-color-white);
129+
border-bottom-color: var(--sl-color-accent);
130+
}
131+
132+
@media (min-width: 50rem) {
133+
.header {
134+
display: grid;
135+
/* Starlight's own grid sizes the first column off the sidebar and TOC
136+
widths, so the search box shifts from page to page. Anchoring the
137+
search to the right edge, next to the other controls, keeps it in
138+
the same place everywhere. */
139+
grid-template-columns: auto 1fr auto;
140+
align-content: center;
141+
}
142+
.search-wrapper {
143+
justify-content: flex-end;
144+
}
145+
}
146+
</style>

‎src/components/Sidebar.astro‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
import MobileMenuFooter from "virtual:starlight/components/MobileMenuFooter";
3+
import SidebarPersister from "@astrojs/starlight/components/SidebarPersister.astro";
4+
import SidebarSublist from "@astrojs/starlight/components/SidebarSublist.astro";
5+
6+
import { NAV_TABS } from "../data/nav";
7+
8+
/**
9+
* Override of Starlight's Sidebar: the header tabs are the top level of the
10+
* navigation, so the sidebar only shows the pages of the current section.
11+
* The section comes from the shared nav.ts patterns - the same ones that
12+
* pick the active header tab - and names the matching top-level group in
13+
* `astro.config.mjs`. Pages outside any section fall back to the full
14+
* sidebar. The distro table pages opt out of the sidebar entirely; their
15+
* in-page distro tabs are the sub-navigation.
16+
*/
17+
18+
const { sidebar } = Astro.locals.starlightRoute;
19+
const pathname = Astro.url.pathname;
20+
21+
const tab = NAV_TABS.find((t) => t.match.test(pathname));
22+
const section = sidebar.find(
23+
(entry) => entry.type === "group" && entry.label === tab?.label,
24+
);
25+
26+
const entries = section && section.type === "group" ? section.entries : sidebar;
27+
---
28+
29+
<SidebarPersister>
30+
<SidebarSublist sublist={entries} />
31+
</SidebarPersister>
32+
33+
<div class="md:sl-hidden">
34+
<MobileMenuFooter />
35+
</div>

‎src/components/SiteTitle.astro‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const { siteTitle, siteTitleHref } = Astro.locals.starlightRoute;
2424
min-width: 0;
2525
}
2626
.site-title :global(svg) {
27-
height: calc(var(--sl-nav-height) - 2.4 * var(--sl-nav-pad-y));
27+
/* Sized against the header's first row, not the full two-row header. */
28+
height: calc(
29+
var(--rs-nav-row, var(--sl-nav-height)) - 2.4 * var(--sl-nav-pad-y)
30+
);
2831
width: auto;
2932
}
3033
</style>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Community Meeting
3+
slug: CommunityMeeting
4+
---
5+
6+
import { LinkButton } from "@astrojs/starlight/components";
7+
8+
RoboStack has multiple stakeholders, so once a month we host an online meeting to discuss changes and potential user questions.
9+
Join in to understand or influence the project.
10+
11+
:::note[Everyone is welcome]
12+
You don't have to be a maintainer or contributor.
13+
Using RoboStack, or just curious about it, is reason enough to join.
14+
:::
15+
16+
## When
17+
18+
- **Every third Thursday of the month, 16:00 Amsterdam time (CET/CEST)**
19+
- That is 14:00 UTC, 10:00 in New York and 7:00 in San Francisco during summer time.
20+
21+
## How to join
22+
23+
Add the recurring event to your calendar, the Google Meet link is attached to it:
24+
25+
<LinkButton
26+
href="https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MDU1bHFrbzdlN3EzdHBjbWtxZ2poMTF1aHNfMjAyNjA4MjBUMTQwMDAwWiBydWJlbkBwcmVmaXguZGV2&tmsrc=ruben%40prefix.dev&scp=ALL"
27+
icon="external"
28+
>
29+
Add the meeting to your calendar
30+
</LinkButton>
31+
32+
## Agenda and notes
33+
34+
The agenda and notes live in [one shared document](https://docs.google.com/document/d/11zfgoNtyu1I55EHNk42vEWgFMPT_QGaI5XehcdU_ttc/edit), one running doc with the newest meeting on top.
35+
36+
Want something discussed?
37+
Add a comment to the doc with your topic, or bring it up at the start of the call.
38+
Notes from past meetings stay in the same doc, so that is also the place to catch up on what you missed.
39+
40+
## What we talk about
41+
42+
- The state of the distros we package and the potential coming packages.
43+
- New features in [Pixi](https://pixi.sh) and [Vinca](https://github.com/RoboStack/vinca) that make using RoboStack easier or more feature-full.
44+
- Ongoing work, like migrations, CI and new platforms.
45+
- Your questions, issues and use cases.
46+
- Anything you bring to the agenda.
47+
48+
## Between meetings
49+
50+
For quicker async feedback or support, contact the team in the [robotics channel on the prefix.dev Discord](https://discord.gg/kKV8ZxyzY4).
51+
52+
See you there!

‎src/content/docs/support.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ How to help improve our documentation:
99

1010
- For typos, grammar, or other errors, we'd appreciate your support! Simply [fork](https://github.com/RoboStack/robostack.github.io/fork) our repo, make the necessary changes, and submit a pull request.
1111
- If you have questions or need help, feel free to create an [issue](https://github.com/RoboStack/robostack.github.io/issues) or join the community in the [robotics channel on the prefix.dev Discord](https://discord.gg/kKV8ZxyzY4).
12+
- Prefer talking to us live? Join the monthly [community meeting](/CommunityMeeting.html).
1213

1314
We're always eager to improve, and your input is valuable to us. Thank you for being part of the RoboStack community!
1415

‎src/data/nav.ts‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { DISTROS, newestRelease } from "./distros";
2+
3+
/**
4+
* The site's top-level sections: one header tab each (Header.astro), and -
5+
* for tabs whose label matches a top-level sidebar group in astro.config.mjs
6+
* - the sidebar shows that group's pages (Sidebar.astro). `match` decides
7+
* both the active tab and which section a page belongs to, so cross-listed
8+
* pages (Contributing sits in Docs and Community) resolve consistently.
9+
*/
10+
export interface NavTab {
11+
label: string;
12+
href: string;
13+
match: RegExp;
14+
}
15+
16+
export const NAV_TABS: NavTab[] = [
17+
{ label: "Home", href: "/index.html", match: /^\/(index(\.html)?)?$/ },
18+
{
19+
label: "Docs",
20+
href: "/GettingStarted.html",
21+
match: /^\/(GettingStarted|micromamba|conda|JupyterRos|FAQ)/,
22+
},
23+
{
24+
label: "Packages",
25+
href: `/${newestRelease().name}.html`,
26+
// Active on every distro table page (/noetic.html, /lyrical.html, ...).
27+
match: new RegExp(`^/(${DISTROS.map((d) => d.name).join("|")})(\\.html)?$`),
28+
},
29+
{
30+
label: "Community",
31+
href: "/CommunityMeeting.html",
32+
match: /^\/(CommunityMeeting|support|Contributing)/,
33+
},
34+
];

‎src/pages/[distro].astro‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const install = [
2929
title: `ROS ${distro.ros} ${title(distro)}`,
3030
tableOfContents: false,
3131
}}
32+
hasSidebar={false}
3233
>
3334
{
3435
/* Phrased about upstream, not about our rebuilds. Noetic is end of life

‎src/pages/index.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ const packagesHref = `/${newestRelease().name}.html`;
149149

150150
{/* Page backdrop and measure: the cream paper tone, wider than the docs. */}
151151
<style is:global>
152-
/* Outranks Starlight's own `html:not([data-has-sidebar])` width. */
153-
:root:not([data-has-sidebar]) {
152+
:root {
154153
--sl-content-width: 76rem;
155154
}
155+
156156
.main-pane,
157157
main {
158158
background: var(--bg-page);

0 commit comments

Comments
 (0)