Skip to content
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

Adds sitemap. #982

Merged
merged 1 commit into from
Apr 23, 2023
Merged

Adds sitemap. #982

merged 1 commit into from
Apr 23, 2023

Conversation

manovotny
Copy link
Collaborator

@manovotny manovotny commented Apr 21, 2023

@vercel
Copy link

vercel bot commented Apr 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
commerce-shopify ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2023 8:51pm

import { MetadataRoute } from 'next';

const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can this be done dynamically like this or should we hardcode it to demo.vercel.store?

Copy link
Member

Choose a reason for hiding this comment

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

This should work, vs. hardcoding. There isn't a metabaseBase here similar to the built-in SEO support AFAIK, but could be wrong.

? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: 'http://localhost:3000';

export default async function sitemap(): Promise<Promise<Promise<MetadataRoute.Sitemap>>> {
Copy link
Member

Choose a reason for hiding this comment

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

Promise-ception

import { MetadataRoute } from 'next';

const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
Copy link
Member

Choose a reason for hiding this comment

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

This should work, vs. hardcoding. There isn't a metabaseBase here similar to the built-in SEO support AFAIK, but could be wrong.

@leerob leerob merged commit a53ee3e into main Apr 23, 2023
@leerob leerob deleted the sitemap branch April 23, 2023 18:55
loan-laux pushed a commit to TrellisCommerce/next-commerce-bigcommerce that referenced this pull request May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants