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

Add more context to SEO documentation page #374

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
},
{
"group": "Advanced",
"pages": [{
"pages": [
{
"icon": "code",
"group": "Custom Scripts",
"pages": [
Expand Down Expand Up @@ -196,7 +197,10 @@
},
{
"group": "SDKs",
"pages": ["integrations/sdks/speakeasy", "integrations/sdks/stainless"]
"pages": [
"integrations/sdks/speakeasy",
"integrations/sdks/stainless"
]
},
{
"group": "Support",
Expand All @@ -208,7 +212,10 @@
},
{
"group": "Privacy",
"pages": ["integrations/privacy/overview", "integrations/privacy/osano"]
"pages": [
"integrations/privacy/overview",
"integrations/privacy/osano"
]
},
{
"group": "Components",
Expand Down Expand Up @@ -240,7 +247,9 @@
},
{
"group": "Changelog",
"pages": ["changelog/overview"]
"pages": [
"changelog/overview"
]
}
],
"footer": {
Expand Down Expand Up @@ -324,4 +333,4 @@
"publicApiKey": "pk_76a6caa274e800f3ceff0b2bc6b9b9d82ab8"
}
}
}
}
103 changes: 72 additions & 31 deletions settings/seo.mdx
Original file line number Diff line number Diff line change
@@ -1,72 +1,113 @@
---
title: 'Search Engine Optimization'
description: 'Mintlify automatically generates most meta tags. If you want to customize them, you can set default values in mint.json or change them per page.'
description: 'Customize meta tags and implement SEO best practices in your documentation'
icon: 'magnifying-glass'
---

## Understanding Meta Tags

Meta tags are pieces of code that help search engines understand your content. Mintlify automatically generates most meta tags, but you can customize them either globally in mint.json or on a per-page basis.

<Accordion title="Supported Meta Tags">

- og:site_name
- og:title
- og:description
- og:url
- og:image
- og:locale
- og:logo
- article:publisher
- twitter:title
- twitter:description
- twitter:url
- twitter:image
- twitter:site
- og:image:width
- og:image:height
- og:site_name - The name of your documentation site
- og:title - The title of the current page
- og:description - Brief description of the page content
- og:url - The URL of the current page
- og:image - Preview image for social media sharing
- og:locale - Language/locale of the content
- og:logo - Your site's logo
- article:publisher - Publisher information
- twitter:title - Title for Twitter cards
- twitter:description - Description for Twitter cards
- twitter:url - URL for Twitter cards
- twitter:image - Image for Twitter cards
- twitter:site - Twitter username associated with the site
- og:image:width - Width of the og:image
- og:image:height - Height of the og:image

</Accordion>

## Default meta tags
## Setting Default Meta Tags

You can set default meta tags by adding the `metadata` field to your `mint.json`.
You can set default meta tags that apply to all pages by adding the `metadata` field to your `mint.json`:

```json
"metadata": {
"og:image": "link to your default meta tag image"
"og:image": "https://yoursite.com/path/to/default-image.jpg",
"og:site_name": "Your Documentation",
"twitter:site": "@yourusername"
}
```

## Changing meta tags on one page
## Page-Specific Meta Tags

Add your meta tags to the page's metadata like so:
Override default meta tags or add new ones on individual pages by adding them to the page's frontmatter:

```md
---
title: 'Your Example Page Title'
'og:image': 'link to your meta tag image'
description: 'A detailed description of this page's content'
'og:image': 'https://yoursite.com/path/to/page-specific-image.jpg'
'twitter:title': 'Custom Twitter Title'
---
```

<Warning>
Meta tags with colons need to be typed with quotes around them in the page metadata.
</Warning>

Meta tags with colons need to be typed with quotes around them when you put them in the page metadata.
## Meta Tag Best Practices

</Warning>
### Descriptions
Write clear, concise descriptions between 150-160 characters that accurately summarize the page content. Good descriptions improve click-through rates from search results.

### Images
- Use high-quality images with minimum dimensions of 1200x630 pixels for social media previews
- Compress images to optimize loading speed
- Include descriptive filenames and alt text
- Consider providing different images for light/dark modes

### Previewing Meta Tags

Test how your meta tags appear on different platforms:
- [Twitter Card Validator](https://cards-dev.twitter.com/validator)
- [Facebook Sharing Debugger](https://developers.facebook.com/tools/debug/)
- [LinkedIn Post Inspector](https://www.linkedin.com/post-inspector/)

## Sitemaps
## Sitemaps and Indexing

Mintlify automatically generates a `sitemap.xml` file and a `robots.txt` file. Simply add `/sitemap.xml` to the end of your website URL to see your sitemap. We recommend submitting the sitemap to search engines for improved SEO.
### Sitemaps
Mintlify automatically generates a `sitemap.xml` file and a `robots.txt` file. Access your sitemap by adding `/sitemap.xml` to your website URL. Submit your sitemap to search engines like Google Search Console and Bing Webmaster Tools for better indexing.

Only pages included in your `mint.json` are included by default. To include hidden links, add `seo.indexHiddenPages` to your `mint.json`:
Only pages included in your `mint.json` navigation are included in the sitemap by default. To include hidden pages, add this to your `mint.json`:

```json
"seo": {
"indexHiddenPages": true
}
```

## Disabling indexing
If you want to stop a page from being indexed by search engines, you can include the following in the [frontmatter](/page) of your page:
```
### Controlling Indexing
Prevent specific pages from being indexed by adding `noindex: true` to the page's frontmatter:

```md
---
title: 'Internal Page'
noindex: true
---
```
```

## Search Engine Tips

1. Use descriptive URLs that include relevant keywords
2. Create a logical site structure with clear navigation
3. Ensure your content is mobile-friendly
4. Optimize page load speeds
5. Use proper heading hierarchy (H1, H2, H3)
6. Include internal links to related content
7. Keep content up to date and relevant

<Note>
Remember that the best SEO practice is to create high-quality, useful content that genuinely helps your users.
</Note>