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
13 changes: 13 additions & 0 deletions packages/webdocs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import tailwindcss from '@tailwindcss/vite';
import cloudflare from '@astrojs/cloudflare';

export default defineConfig({
site: 'https://t-req.io',
output: 'server',
adapter: cloudflare(),
redirects: {
Expand All @@ -12,11 +13,23 @@ export default defineConfig({
integrations: [
starlight({
title: 't-req',
description:
't-req is a utility-first HTTP client with .http files that integrate with Vitest, Jest, and Bun.',
logo: {
src: './src/assets/logo.jpg',
replacesTitle: true
},
favicon: '/favicon.png',
head: [
{
tag: 'meta',
attrs: { property: 'og:image', content: 'https://t-req.io/logo.jpg' }
},
{
tag: 'meta',
attrs: { name: 'twitter:image', content: 'https://t-req.io/logo.jpg' }
}
],
customCss: ['./src/styles/starlight.css'],
sidebar: [
{ label: 'Getting Started', slug: 'docs/getting-started' },
Expand Down
4 changes: 4 additions & 0 deletions packages/webdocs/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://t-req.io/sitemap-index.xml
44 changes: 40 additions & 4 deletions packages/webdocs/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,20 +1,56 @@
---
import '@t-req/ui/fonts';
import '../styles/global.css';
import "@t-req/ui/fonts";
import "../styles/global.css";

interface Props {
title?: string;
description?: string;
ogDescription?: string;
twitterDescription?: string;
ogImage?: string;
canonicalUrl?: string;
}

const { title = 't-req' } = Astro.props;
const {
title = "t-req",
description = "t-req is a utility-first API client with .http files that integrate with Vitest, Jest, and Bun.",
ogDescription,
twitterDescription,
ogImage = "/logo.jpg",
canonicalUrl,
} = Astro.props;

const canonicalHref =
canonicalUrl ??
(Astro.site ? new URL(Astro.url.pathname, Astro.site).href : undefined);
const socialDescription = ogDescription ?? description;
const twitterSocialDescription = twitterDescription ?? socialDescription;

const ogImageUrl = (() => {
if (!ogImage) return undefined;
if (ogImage.startsWith("http://") || ogImage.startsWith("https://"))
return ogImage;
return Astro.site ? new URL(ogImage, Astro.site).href : ogImage;
})();
---

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="HTTP request parsing, execution, and testing" />
<meta name="description" content={description} />
{canonicalHref && <link rel="canonical" href={canonicalHref} />}
<meta property="og:title" content={title} />
<meta property="og:description" content={socialDescription} />
<meta property="og:type" content="website" />
{canonicalHref && <meta property="og:url" content={canonicalHref} />}
{ogImageUrl && <meta property="og:image" content={ogImageUrl} />}
<meta property="og:site_name" content="t-req" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={twitterSocialDescription} />
{ogImageUrl && <meta name="twitter:image" content={ogImageUrl} />}
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" href="/favicon.png" />
<title>{title}</title>
Expand Down
40 changes: 33 additions & 7 deletions packages/webdocs/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
---
import Layout from "../layouts/Layout.astro";
import CodeTabs from "../components/CodeTabs.astro";

export const prerender = true;

const title = "t-req | Programmable API Engine -- Open Source API Client";
const description =
"An open-source, local-first programmable API engine built on standard .http files. Scriptable, programmable, and runnable from the CLI, IDE, or your own code.";
const ogDescription =
"Make .http files programmable. Run API requests from the terminal, your editor, or your own code. Open source, local-first.";
---

<Layout>
<Layout
title={title}
description={description}
ogDescription={ogDescription}
ogImage="/logo.jpg"
>
<!-- Header -->
<header
class="max-w-5xl mx-auto px-6 py-4 flex items-center justify-between border-b border-treq-border-light"
Expand Down Expand Up @@ -51,7 +64,7 @@ import CodeTabs from "../components/CodeTabs.astro";
height="400"
/>
</div>
<div class="hero-content">
<div class="landing-hero-content">
<span class="beta-badge">Beta</span>
<h1 class="hero-title">
Test APIs programmatically<br />without ever leaving your code.
Expand Down Expand Up @@ -315,7 +328,13 @@ treq open</code></pre>
<footer
class="max-w-5xl mx-auto px-6 py-12 text-center text-sm text-treq-text-muted"
>
&copy; {new Date().getFullYear()} <a href="https://www.tensorixlabs.com/" target="_blank" rel="noopener noreferrer" class="hover:text-treq-text-strong transition-colors">tensorix-labs</a>
&copy; {new Date().getFullYear()}
<a
href="https://www.tensorixlabs.com/"
target="_blank"
rel="noopener noreferrer"
class="hover:text-treq-text-strong transition-colors">tensorix-labs</a
>
</footer>
</main>

Expand All @@ -340,13 +359,18 @@ treq open</code></pre>
}
}

.hero-content {
flex: 1;
.landing-hero-content {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}

@media (min-width: 768px) {
.hero-content {
.landing-hero-content {
align-items: flex-start;
text-align: left;
order: 1;
}
Expand Down Expand Up @@ -376,8 +400,9 @@ treq open</code></pre>
letter-spacing: -0.04em;
line-height: 1.1;
color: #0f172a;
text-wrap: balance;
max-width: 20ch;
margin-bottom: 1.5rem;
width: 100%;
}

@media (min-width: 640px) {
Expand All @@ -398,6 +423,7 @@ treq open</code></pre>
color: #334155;
max-width: 42rem;
margin: 0 0 2rem;
width: 100%;
}

@media (max-width: 767px) {
Expand Down