-
Notifications
You must be signed in to change notification settings - Fork 1
Give /file its own OG card and page metadata #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+397
−6
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { ImageResponse } from 'next/og'; | ||
|
|
||
| import { loadBrandFonts, OG_SIZE, RelayfileVariant } from '../../../lib/og/template'; | ||
|
|
||
| export const runtime = 'nodejs'; | ||
| // Prerender at build time — the Relayfile card never changes between deploys. | ||
| export const dynamic = 'force-static'; | ||
|
|
||
| /** | ||
| * The Relayfile landing page's Open Graph card: the same composition as the | ||
| * homepage and Pear cards (left copy column, a panel bled into the bottom-right) | ||
| * with the page's own badge, headline, and subtitle beside the "relayfile | ||
| * workspace" tree from its hero. Served as a `.png` route handler so the URL | ||
| * ends in a real image extension. | ||
| */ | ||
| export async function GET() { | ||
| const { fonts, headingFamily, bodyFamily } = await loadBrandFonts(); | ||
|
|
||
| return new ImageResponse(<RelayfileVariant headingFamily={headingFamily} bodyFamily={bodyFamily} />, { | ||
| ...OG_SIZE, | ||
| ...(fonts.length > 0 ? { fonts } : {}), | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,34 @@ | ||
| import type { Metadata } from 'next'; | ||
|
|
||
| import { GitHubStarsBadge } from '../../components/GitHubStars'; | ||
| import { relayfileMetadata, RELAYFILE_PATH } from '../../lib/relayfile-meta'; | ||
| import { absoluteUrl } from '../../lib/site'; | ||
|
|
||
| import { RelayfileContent } from './RelayfileContent'; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: 'Relayfile | Integration filesystem for AI agents', | ||
| description: | ||
| 'Mount SaaS integrations as files so agents can read, write, watch, and coordinate through one realtime workspace.', | ||
| }; | ||
| export const metadata: Metadata = relayfileMetadata(RELAYFILE_PATH); | ||
|
|
||
| export default function FilePage() { | ||
| return <RelayfileContent navActions={<GitHubStarsBadge />} />; | ||
| const structuredData = { | ||
| '@context': 'https://schema.org', | ||
| '@type': 'SoftwareApplication', | ||
| name: 'Relayfile', | ||
| applicationCategory: 'DeveloperApplication', | ||
| description: | ||
| 'An integration filesystem for AI agents. Mount Linear, GitHub, Notion, Slack, and other SaaS systems as a realtime filesystem that agents read with bash and write back to by saving files.', | ||
| url: absoluteUrl(RELAYFILE_PATH), | ||
| operatingSystem: 'macOS, Linux', | ||
| provider: { | ||
| '@type': 'Organization', | ||
| name: 'Agent Relay', | ||
| url: absoluteUrl('/'), | ||
| }, | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(structuredData) }} /> | ||
| <RelayfileContent navActions={<GitHubStarsBadge />} /> | ||
| </> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The openGraph.title for /file won't carry the '| Agent Relay' brand suffix, while the browser <title> does (via the layout's '%s | Agent Relay' template, which doesn't apply to openGraph). Social/OG shares will show the un-branded title 'Relayfile — Integration filesystem for AI agents', diverging from the stated PR title and from /enterprise, whose openGraph.title includes the brand. Consider appending the brand to openGraph.title in relayfile-meta rather than relying on the template.
Prompt for AI agents