SEO
Learn how SEO works in shipit
Meta tags
According to your settings in the app_settings.ts
file, shipit will generate the important meta tags for your app.
You can check how this works by going to src/app/layout.tsx
. You will find this code:
This will adapt and work with every page in your app without further configuration.
Only the page of a blog post, have a different configuration, since we want to show meta information about the post.
If you go to src/app/blog/[slug].tsx
, you will find this code:
This will generate the neccesary meta tags for a each blog post.
OG Image
If you look closely to the Metadata object in the layout.tsx
file, you will see this code:
If you don’t specify a SEO_IMAGE url in your app_settings.ts
file, shipit will generate a default image for you.
This image is generated by the api/og
endpoint, which is a serverless function that uses next/og
package to generate the image.
If you wish you can customize this image by going to the src/api/og/route.tsx
file.
You will find the following code:
You can use tailwind to style the image as you wish.
Sitemap
shipit generates a sitemap for you, so you don’t have to worry about it.
But if you are curious about how it works, you can go to the src/app/sitemap.ts
file.
You will find this code:
The first group of routes are the ones that are defined in the app_settings.ts
file.
That are the routes of your application. It will filter by the ones that are visible to all users,
ince it doesn’t make sense to include in the sitemap the routes that are only visible to authenticated or suscribed users.
The second group of routes will add all your blog posts routes to the sitemap.