Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/astro-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
},
"devDependencies": {
"@types/react": "~19.2.2",
"astro": "^5.5.6"
"astro": "^5.16.4"
},
"peerDependencies": {
"astro": "^5.5.6"
"astro": "^5.16.4"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/starlight": "^0.36.1",
"@astrojs/starlight": "^0.37.0",
"@expressive-code/core": "^0.41.2",
"@typespec/playground": "workspace:^",
"astro-expressive-code": "^0.41.2",
Expand Down
105 changes: 69 additions & 36 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ export default defineConfig({
},
},
],
social: [
{
label: "GitHub",
icon: "github",
href: "https://github.com/microsoft/typespec",
},
{
label: "Discord",
icon: "discord",
href: "https://aka.ms/typespec/discord",
},
],
plugins: [],
}),
react(),
Expand Down
10 changes: 5 additions & 5 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/react": "^4.2.1",
"@astrojs/starlight": "^0.36.1",
"@docsearch/css": "^4.1.0",
"@docsearch/js": "^4.1.0",
"@astrojs/react": "^4.4.2",
"@astrojs/starlight": "^0.37.0",
"@docsearch/css": "^4.3.2",
"@docsearch/js": "^4.3.2",
"@expressive-code/core": "^0.41.2",
"@fluentui/react-components": "~9.72.3",
"@fluentui/react-icons": "^2.0.292",
"@typespec/compiler": "workspace:^",
"@typespec/playground": "workspace:^",
"astro": "^5.5.6",
"astro": "^5.16.4",
"astro-rehype-relative-markdown-links": "^0.18.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
Expand Down
5 changes: 3 additions & 2 deletions website/src/components/asset-img.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import type { HTMLAttributes } from "astro/types";

export interface AssetImgProps extends HTMLAttributes<"img"> {
src: string;
class?: string;
}

const { src, alt, ...rest } = Astro.props;
const { src, alt, class: className, ...rest } = Astro.props;
---

<img class="img" src={baseUrl(`/img/${src}`)} alt={alt ?? ""} {...rest} />
<img class:list={["img", className]} src={baseUrl(`/img/${src}`)} alt={alt ?? ""} {...rest} />

<style>
.img {
Expand Down
5 changes: 3 additions & 2 deletions website/src/components/feature-list.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface FeatureListItem {
description?: string;
image?: FluentImageName;
link?: string;
learnMoreText?: string;
}

export interface Props {
Expand Down Expand Up @@ -46,15 +47,15 @@ const { items } = Astro.props;

<div class="items-list">
{
items?.map(({ image, description, link, title }) => (
items?.map(({ image, description, link, title, learnMoreText }) => (
<div class="item">
{image && <FluentImg class="item-image" name={image} />}
<div class="item-content">
<NeutralText size={"large"}>{title}</NeutralText>
<DescriptionText>{description}</DescriptionText>
{link && (
<Link href={link}>
<Text>Learn more →</Text>
<Text>{learnMoreText ?? "Learn more"} →</Text>
</Link>
)}
</div>
Expand Down
68 changes: 48 additions & 20 deletions website/src/components/header/header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Icon } from "@astrojs/starlight/components";
import Search from "./search.astro";
import ReleaseNotification from "../release-notification.astro";
export interface Props {
noDrawer?: boolean;
noLinks?: boolean;
}

const { noDrawer } = Astro.props;
const { noLinks } = Astro.props;
---

<style>
Expand Down Expand Up @@ -183,23 +183,49 @@ const { noDrawer } = Astro.props;
<span class="brand-item"><Link href="/" class="brand"><b>TypeSpec</b></Link></span>

<div id="header-nav-content" class="nav-content">
<div class="items">
<details id="use-cases-menu" class="group">
<summary class="item"
><span>Use cases</span> <Icon class="icon" name="down-caret" /></summary
>
<ul class="group-content">
<li><Link class="item link" href="/openapi">OpenAPI</Link></li>
<li><Link class="item link" href="/data-validation">Data Validation</Link></li>
<li><Link class="item link" href="/tooling">Tooling support</Link></li>
</ul>
</details>
<Link class="item link" href="/docs">Docs</Link>
<Link class="item link" href="/videos">Videos</Link>
<Link class="item link" href="/playground">Playground</Link>
<Link class="item link" href="/blog">Blog</Link>
<Link class="item link" href="/community">Community</Link>
</div>
{
!noLinks && (
<div class="items">
<details id="use-cases-menu" class="group">
<summary class="item">
<span>Use cases</span> <Icon class="icon" name="down-caret" />
</summary>
<ul class="group-content">
<li>
<Link class="item link" href="/openapi">
OpenAPI
</Link>
</li>
<li>
<Link class="item link" href="/data-validation">
Data Validation
</Link>
</li>
<li>
<Link class="item link" href="/tooling">
Tooling support
</Link>
</li>
</ul>
</details>
<Link class="item link" href="/docs">
Docs
</Link>
<Link class="item link" href="/videos">
Videos
</Link>
<Link class="item link" href="/playground">
Playground
</Link>
<Link class="item link" href="/blog">
Blog
</Link>
<Link class="item link" href="/community">
Community
</Link>
</div>
)
}
<div class="items right">
<ReleaseNotification />
<Link
Expand All @@ -221,7 +247,7 @@ const { noDrawer } = Astro.props;
</div>
<Search />
{
!noDrawer && (
!noLinks && (
<button id="header-drawer-button" type="button" class="lg:hidden icon" title="Show Menu">
<Icon name="bars" />
</button>
Expand All @@ -235,8 +261,10 @@ const { noDrawer } = Astro.props;
button.addEventListener("click", () => {
if (navcontent.dataset.open === "true") {
navcontent.dataset.open = "false";
button.focus();
} else {
navcontent.dataset.open = "true";
navcontent.focus();
}
});

Expand Down
4 changes: 4 additions & 0 deletions website/src/components/header/search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import "@docsearch/css";
sl-doc-search {
--docsearch-muted-color: #6c727e;
}

:global(.DocSearch-Button:focus) {
outline: 1px solid var(--colorBrandBackgroundHover);
}
</style>

<sl-doc-search>
Expand Down
10 changes: 8 additions & 2 deletions website/src/components/homepage/overview-illustration.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { OverviewIllustrationTerminalContent } from "./overview-illustration-ter

<style>
.card {
width: 723px;
height: 542px;
width: 723px;
position: relative;
}

Expand All @@ -20,11 +20,17 @@ import { OverviewIllustrationTerminalContent } from "./overview-illustration-ter
width: 420px;
height: 320px;
}

.ide {
position: absolute;
top: 226px;
left: 183px;
width: 420px;
}

@media only screen and (max-width: 600px) {
.card {
display: none;
}
}
</style>
<IllustrationCard blend class="card">
Expand Down
22 changes: 16 additions & 6 deletions website/src/components/learn-more-card.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import FluentImg from "./fluent-img.astro";
import Link from "@typespec/astro-utils/components/link.astro";
import { NeutralText, DescriptionText, Text } from "./text/text";
import { NeutralText, DescriptionText } from "./text/text";
import type { FluentImageName } from "./types";

export interface Props {
Expand All @@ -24,6 +24,7 @@ const { image, title, description, link } = Astro.props;
display: flex;
gap: 12px;
border: 2px solid transparent;
display: flex;
}

.item:hover {
Expand All @@ -44,16 +45,25 @@ const { image, title, description, link } = Astro.props;

.item-content {
display: flex;
flex: 1;
flex-direction: column;
gap: 12px;
}

.title {
font-size: 20px;
font-weight: 600;
}
.arrow {
font-size: 24px;
color: var(--colorNeutralForeground3);
}
</style>

<Link href={link} class="item">
{image && <FluentImg class="item-image" name={image} />}
<div class={"item-content"}>
<NeutralText>{title}</NeutralText>
<DescriptionText>{description}</DescriptionText>
<Text>Learn more →</Text>
<div class="item-content">
<NeutralText className="title">{title}</NeutralText>
<DescriptionText>{description ?? "Learn more about supported features"}</DescriptionText>
</div>
<div class="arrow">→</div>
</Link>
4 changes: 2 additions & 2 deletions website/src/components/light-dark-img.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ const { src } = Astro.props;
}
</style>
<div>
<AssetImg className={"dark"} src={`${src}.dark.png`} />
<AssetImg className={"light"} src={`${src}.light.png`} />
<AssetImg class="dark" src={`${src}.dark.png`} />
<AssetImg class="light" src={`${src}.light.png`} />
</div>
2 changes: 1 addition & 1 deletion website/src/components/starlight-overrides/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
import BaseHeader from "@site/src/components/header/header.astro";
---

<BaseHeader noDrawer />
<BaseHeader noLinks />
5 changes: 5 additions & 0 deletions website/src/css/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ a {
text-decoration: none;
transition: color var(--ifm-transition-fast) var(--ifm-transition-timing-default);
}

/* In markdown tables starlight doesn't underline text. This ensures that only links with multiple siblings get underlined but not the whole cell being a link */
.sl-markdown-content td a:not(:only-child) {
text-decoration: underline;
}
3 changes: 3 additions & 0 deletions website/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,22 @@ import Button from "../components/button.astro";
"Inspired by TypeScript, TypeSpec is a minimal language that helps developers describe API shapes in a familiar way.",
image: "book-pencil",
link: Links.gettingStartedOpenAPI,
learnMoreText: "Learn about TypeSpec for REST APIs",
},
{
title: "Easy integration with your toolchain",
description:
"Write TypeSpec, emit to various formats and integrate with their ecosystems.",
image: "document-add",
learnMoreText: "Learn about TypeSpec emitters",
},
{
title: "Multi-protocol support",
description:
"TypeSpec's standard library includes support for OpenAPI 3.0, JSON Schema 2020-12 and Protobuf.",
image: "tasks",
link: "/multi-protocol",
learnMoreText: "Check out multi-protocol examples",
},
]}
/>
Expand Down
Loading