Skip to content

Commit

Permalink
added preview feature for articles and authors
Browse files Browse the repository at this point in the history
  • Loading branch information
samithaf committed Dec 11, 2023
1 parent dd2799a commit a85c055
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/site/keystatic.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export default config({
authors: collection({
label: 'Authors',
path: 'src/content/authors/*',
previewUrl: `/preview/start?branch={branch}&to=/authors/{slug}`,
slugField: 'name',
schema: {
name: fields.slug({
Expand All @@ -241,6 +242,7 @@ export default config({
articles: collection({
label: 'Articles',
path: 'src/content/articles/*',
previewUrl: `/preview/start?branch={branch}&to=/articles/{slug}`,
slugField: 'name',
schema: {
name: fields.slug({
Expand Down
1 change: 1 addition & 0 deletions apps/site/src/app/preview/start/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export async function GET(req: Request) {
const toUrl = new URL(to, url.origin);
toUrl.protocol = url.protocol;
toUrl.host = url.host;
toUrl.searchParams.set('brand', 'wbc');
redirect(toUrl.toString());
}

1 comment on commit a85c055

@vercel
Copy link

@vercel vercel bot commented on a85c055 Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gel-next-site – ./apps/site

gel-next-site-git-main-westpacgel.vercel.app
gel-next-site.vercel.app
gel-next-site-westpacgel.vercel.app

Please sign in to comment.