SEO
SEO Setup
Nowadays, SEO is very important.
BOB has the most important SEO features built-in and ready to use.
You can set up everything in seconds. Each layout uses the generateDefaultMetadata
function to fill in metadata for every page.
You can always override it, but by default, all data is taken from .env
variables.
Meta Tags
Example .env
setup:
These values will be used as default meta tags for every page. You can override them on any page (see Override Meta Tags).
Icons
There are also icons that appear in browser tabs and on Apple devices. You can replace these files with your custom icons:
/public/branding/favicon.ico
/public/branding/branding/favicon.ico
/public/branding/apple-touch-icon.png
Make sure the images have the correct dimensions to avoid display issues.
Social Media Open Graph (OG)
You can set default Open Graph (OG) and Twitter meta tags using environment variables:
This will set default metadata for social media previews across the whole app.
Open Graph / Twitter Images
By default, og:images and twitter images for link previews are here:
/public/branding/opengraph-image.jpg
/public/branding/twitter-image.jpg
💡 Recommended image settings for social media:
- Minimum size: 1200px by 675px
- File size: Max 5MB
- Ratio: 1.91:1
You can easily generate OG images here: https://ogimagemaker.com/
Override Meta Tags
Each page or layout can override default meta tags.
You can pass custom props to generateDefaultMetadata
to set specific tags per page.
Example for a documentation page:
robots.txt
You can easily modify robots.txt
by editing the app/robots.tsx
file:
This will allow search engines to index public pages while blocking private ones.
Sitemap
A sitemap helps search engines find all your website pages. This is crucial for SEO, especially if you have a blog or documentation.
Example of sitemap generation:
This generates a sitemap.xml
file available at /sitemap.xml
.
Example output:
All Fumadocs pages are automatically added to the sitemap.