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
21 changes: 20 additions & 1 deletion scripts/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async function checkSitemap(): Promise<string[]> {
const locs = [...r.body.matchAll(/<loc>([^<]+)<\/loc>/g)].flatMap((m) =>
m[1] ? [m[1]] : []
);
const required = ["/", "/blog"];
const required = ["/", "/blog", "/faq"];
const paths = locs.map((l) => l.replace(/^https?:\/\/[^/]+/, "") || "/");
const missing = required.filter((p) => !paths.includes(p));
if (missing.length > 0) {
Expand Down Expand Up @@ -326,6 +326,25 @@ async function checkRoute(
}
}

// FAQPage schema on /faq, with one Question per heading
if (path === "/faq") {
const ld = jsonLd(r.body);
const faq = ld.ok
? ld.blocks.find((b) => b["@type"] === "FAQPage")
: undefined;
const questions = Array.isArray(faq?.mainEntity)
? faq.mainEntity.length
: 0;
const headings = (r.body.match(/<h2\b/g) ?? []).length;
if (!faq || questions === 0 || questions !== headings) {
fail(
`json-ld ${path}`,
`FAQPage with ${questions} questions for ${headings} headings`
);
allOk = false;
}
}

if (allOk) pass(`page ${path}`, "og ✓ canonical ✓");
return { html: r.body, routeOk: allOk };
}
Expand Down
16 changes: 16 additions & 0 deletions src/app/(site)/faq/opengraph-image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { siteName } from "@/lib/constants";
import { OG_CONTENT_TYPE, OG_SIZE, renderOgCard } from "@/lib/og";

export const alt = "Vortex FAQ";
export const size = OG_SIZE;
export const contentType = OG_CONTENT_TYPE;

export default function OgImage() {
return renderOgCard({
seed: "faq",
eyebrow: siteName,
title: ["FAQ"],
face: "display",
foot: "Common questions about Vortex, the open-source columnar file format."
});
}
107 changes: 107 additions & 0 deletions src/app/(site)/faq/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import type { Metadata } from "next";
import { Fragment } from "react";
import { LOGOS } from "@/components/logo-banner/logos";
import { getBenchSummary, summaryForPage } from "@/lib/bench-summary";
import { baseUrl } from "@/lib/constants";
import { faqJsonLd, faqs } from "@/lib/faq";
import { jsonLdScript } from "@/lib/json-ld";
import { getSparkVersion } from "@/lib/maven";

const TITLE = "FAQ | Vortex";
const DESCRIPTION =
"Answers about Vortex, the open-source columnar file format: how it compares to Apache Parquet, why it is fast, who uses it, and how to install it.";

export const metadata: Metadata = {
title: TITLE,
description: DESCRIPTION,
openGraph: {
title: TITLE,
description: DESCRIPTION,
siteName: "Vortex",
url: `${baseUrl}/faq`,
type: "website",
locale: "en_US"
},
alternates: {
canonical: `${baseUrl}/faq`
}
};

// The comparison with Parquet carries the homepage's figures, so the page is
// static and rebuilt at most once a day, like the homepage.
export const dynamic = "force-static";
export const revalidate = 86400;

/**
* The design system's Article card, as a blog post draws it: the title and
* the dek, then each question as a heading in the prose column. The page
* carries the same questions and answers as FAQPage structured data.
*/
export default async function FaqPage() {
const [sparkVersion, summary] = await Promise.all([
getSparkVersion(),
getBenchSummary()
]);
const list = faqs({
bench: summaryForPage(summary),
sparkVersion,
ecosystem: LOGOS
});

return (
<div className="blog-page">
<script
type="application/ld+json"
// biome-ignore lint/security/noDangerouslySetInnerHtml: JSON-LD from our own data; jsonLdScript escapes every <.
dangerouslySetInnerHTML={{ __html: jsonLdScript(faqJsonLd(list)) }}
/>
<article className="vx-article vx-reading">
<header className="vx-article-head">
<h1 className="vx-display-mono vx-article-title">FAQ</h1>
<p className="vx-article-dek">
Common questions about Vortex, the open-source columnar file format.
</p>
</header>
<div className="vx-prose">
{list.map((faq) => (
<Fragment key={faq.id}>
<h2 id={faq.id}>{faq.question}</h2>
{faq.answer.map((p) => (
<p key={p}>{p}</p>
))}
{faq.list && (
<ul>
{faq.list.map((item) => (
<li key={item.label}>
{item.text === undefined ? (
item.label
) : (
<>
{`${item.label}: `}
{item.code ? <code>{item.text}</code> : item.text}
</>
)}
</li>
))}
</ul>
)}
{faq.after?.map((p) => (
<p key={p}>{p}</p>
))}
{faq.links && (
<p>
{faq.links.map((link, i) => (
<Fragment key={link.href}>
{i > 0 && " · "}
<a href={link.href}>{link.label}</a>
</Fragment>
))}
</p>
)}
</Fragment>
))}
</div>
</article>
</div>
);
}
5 changes: 4 additions & 1 deletion src/app/(site)/llms-full.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { LOGOS } from "@/components/logo-banner/logos";
import { externalPosts } from "@/content/links";
import { getBenchSummary, summaryForPage } from "@/lib/bench-summary";
import { getAllPosts } from "@/lib/blog";
import { faqs } from "@/lib/faq";
import { siteLlmsFullText } from "@/lib/llms";
import { getSparkVersion } from "@/lib/maven";

Expand All @@ -15,10 +16,12 @@ export async function GET() {
getSparkVersion(),
getBenchSummary()
]);
const bench = summaryForPage(summary);
return new Response(
siteLlmsFullText({
bench: summaryForPage(summary),
bench,
sparkVersion,
faq: faqs({ bench, sparkVersion, ecosystem: LOGOS }),
posts: getAllPosts(),
ecosystem: LOGOS,
elsewhere: externalPosts
Expand Down
15 changes: 11 additions & 4 deletions src/app/(site)/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { getAllPosts } from "@/lib/blog";
import { baseUrl } from "@/lib/constants";

export default function sitemap(): MetadataRoute.Sitemap {
// The homepage's figures change daily, so it is as new as the build. The
// blog index changes only when a post joins it, the site's own or one
// elsewhere, so it is as new as its newest post: a date that moves on
// every build would teach crawlers to ignore lastmod.
// The homepage's figures change daily, so it is as new as the build, and
// so is /faq, which carries them. The blog index changes only when a post
// joins it, the site's own or one elsewhere, so it is as new as its newest
// post: a date that moves on every build would teach crawlers to ignore
// lastmod.
const now = new Date();
const posts = getAllPosts();
const newestPost = new Date(
Expand All @@ -26,6 +27,12 @@ export default function sitemap(): MetadataRoute.Sitemap {
lastModified: newestPost,
changeFrequency: "weekly",
priority: 0.9
},
{
url: `${baseUrl}/faq`,
lastModified: now,
changeFrequency: "weekly",
priority: 0.8
}
];

Expand Down
4 changes: 3 additions & 1 deletion src/components/layout/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { REPO_URL } from "@/lib/github";

// No project code of conduct exists, so the LF Projects one applies
// (charter section 6.b). The charter is a route (src/app/(site)/charter.pdf), so it
// takes a plain link like the rest.
// takes a plain link like the rest. The FAQ is the site's too, so on bench it
// links to vortex.dev.
const links = (origin: string) => [
{ href: `${origin}/faq`, label: "FAQ" },
{ href: `${origin}/charter.pdf`, label: "Charter" },
{
href: "https://lfprojects.org/policies/code-of-conduct/",
Expand Down
Loading
Loading