A modern website built with Astro for Cloud Summit 2026.
npm install
npm run devVisit http://localhost:4321 to see your site.
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ ├── CitySelector.astro
│ │ ├── Hero.astro
│ │ └── Navigation.astro
│ ├── lib/
│ │ ├── cityContent.ts # City-specific content data
│ │ ├── cityStore.ts # State management for city selection
│ │ └── useCity.ts # Helper hook for city state
│ └── pages/
│ └── index.astro
├── astro.config.mjs
├── package.json
└── tsconfig.json
This site supports two cities: Vancouver and Toronto. The city selection is managed through:
- URL Parameters: Use
?city=vancouveror?city=torontoin the URL - City Selector: Dropdown in the navigation bar
- State Management: Centralized store that syncs URL params with component state
- URL Parameter: The city is read from the URL parameter on page load
- State Store: A singleton store manages the current city state
- Reactive Updates: Components subscribe to city changes and update automatically
- Browser Navigation: Back/forward buttons work correctly with city state
Edit src/lib/cityContent.ts to add or modify city-specific content:
export const cityContent: Record<City, CityContent> = {
vancouver: {
name: 'vancouver',
displayName: 'Vancouver',
title: 'Cloud Summit 2026 - Vancouver',
// ... more content
},
toronto: {
// ... toronto content
},
};import { getCityStore } from '../lib/cityStore';
import { cityContent } from '../lib/cityContent';
const cityStore = getCityStore();
cityStore.init();
// Get current city
const currentCity = cityStore.getCity();
// Subscribe to changes
cityStore.subscribe((city) => {
const content = cityContent[city];
// Update your component
});| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add, astro check |