Skip to content

Commit 2a59f11

Browse files
committed
Improve and expand SEO guide
1 parent c4823de commit 2a59f11

1 file changed

Lines changed: 58 additions & 29 deletions

File tree

user_guide/20-seo.qmd

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,32 @@ versions: ">=0.2"
88

99
# SEO Optimization
1010

11-
Great Docs includes comprehensive search engine optimization (SEO) features to help your
12-
documentation rank well in search results. These features are enabled by default and work
13-
automatically when you build your site.
11+
Documentation is only useful if people can find it. When someone searches for how to install your
12+
package or call a specific function, your docs should appear near the top of the results. Good SEO
13+
ensures that search engines can crawl, index, and accurately represent your pages.
14+
15+
Great Docs includes comprehensive SEO features that are enabled by default and work automatically
16+
when you build your site. Sitemaps, canonical URLs, meta descriptions, structured data, and robots
17+
directives are all generated without any configuration.
1418

1519
## What's Included
1620

1721
Great Docs generates and injects SEO-related files and metadata automatically:
1822

19-
- `sitemap.xml`: helps search engines discover all your pages
20-
- `robots.txt`: guides crawler behavior and references your sitemap
21-
- Canonical URLs**: prevents duplicate content issues
22-
- Meta descriptions**: provides search result snippets
23-
- JSON-LD structured data: enables rich search results
24-
- page title templates: consistent `Page Title | Site Name` format
23+
- **`sitemap.xml`**: helps search engines discover all your pages
24+
- **`robots.txt`**: guides crawler behavior and references your sitemap
25+
- **Canonical URLs**: prevents duplicate content issues
26+
- **Meta descriptions**: provides search result snippets
27+
- **JSON-LD structured data**: enables rich search results
28+
- **Page title templates**: consistent `Page Title | Site Name` format
29+
30+
All of these are generated at build time. You can customize any of them or disable features you
31+
don't need.
2532

2633
## Auditing SEO Health
2734

28-
After building your site, run the SEO audit command to check for issues:
35+
After building your site, you can audit the generated output to verify that all SEO features are in
36+
place. Run the SEO audit command to check for issues:
2937

3038
```{.bash filename="Terminal"}
3139
great-docs seo
@@ -51,6 +59,8 @@ This produces a report like this:
5159
✅ All SEO checks passed!
5260
```
5361

62+
The audit checks every HTML page in the built site and reports missing or malformed SEO elements.
63+
5464
### Fixing Issues
5565

5666
Use `--fix` to automatically generate missing SEO files:
@@ -59,7 +69,8 @@ Use `--fix` to automatically generate missing SEO files:
5969
great-docs seo --fix
6070
```
6171

62-
This will create `sitemap.xml` and `robots.txt` if they're missing.
72+
This creates `sitemap.xml` and `robots.txt` if they're missing and patches any fixable issues in the
73+
built output.
6374

6475
### CI Integration
6576

@@ -80,7 +91,8 @@ great-docs seo --json
8091
```
8192

8293
The command exits with code `1` if critical issues are found, making it easy to fail CI builds on
83-
SEO problems.
94+
SEO problems. Pair this with `great-docs lint` and `great-docs links` for a comprehensive
95+
pre-deployment check.
8496

8597
## Configuration
8698

@@ -126,17 +138,18 @@ seo:
126138
default_description: null # Falls back to package description
127139
```
128140

129-
Most users won't need to change these defaults as they're optimized for typical Python documentation
130-
sites.
141+
Most users won't need to change these defaults. They are optimized for typical Python documentation
142+
sites, and every feature can be toggled independently.
131143

132144
## Sitemap Configuration
133145

134146
The sitemap tells search engines about all your pages and how often they change. Great Docs
135-
generates different priorities and change frequencies based on page type.
147+
generates different priorities and change frequencies based on page type, so your most important
148+
content gets crawled first.
136149

137150
### Page Types
138151

139-
Pages are automatically categorized:
152+
Pages are automatically categorized based on their path in the built site:
140153

141154
| Type | Example Paths | Default Priority | Default Changefreq |
142155
|------|---------------|------------------|-------------------|
@@ -146,6 +159,9 @@ Pages are automatically categorized:
146159
| `changelog` | `changelog.html` | 0.6 | weekly |
147160
| `default` | Everything else | 0.5 | monthly |
148161

162+
These defaults work well for most projects. The subsections below show how to override them if your
163+
site has different needs.
164+
149165
### Customizing Priorities
150166

151167
Adjust priorities based on what's most important for your site:
@@ -174,7 +190,8 @@ seo:
174190
## Robots.txt Configuration
175191

176192
The `robots.txt` file tells search engine crawlers which pages to index and where to find your
177-
sitemap.
193+
sitemap. Great Docs generates one automatically, but you can customize it for more control over
194+
crawler behavior.
178195

179196
### Default Behavior
180197

@@ -227,8 +244,9 @@ seo:
227244

228245
## Canonical URLs
229246

230-
Canonical URLs tell search engines which version of a page is the "official" one, preventing
231-
duplicate content issues when your site is accessible via multiple URLs.
247+
Canonical URLs tell search engines which version of a page is the "official" one. This prevents
248+
duplicate content issues when your site is accessible via multiple URLs (for example, with and
249+
without a trailing slash, or through both a custom domain and `github.io`).
232250

233251
### Auto-Detection
234252

@@ -249,7 +267,8 @@ seo:
249267
base_url: https://docs.myproject.com/
250268
```
251269

252-
The trailing slash is important (Great Docs will add it if missing).
270+
The trailing slash is important (Great Docs will add it if missing). Every page in the built site
271+
receives a `<link rel="canonical">` tag pointing to its full URL.
253272

254273
## Page Titles
255274

@@ -282,12 +301,13 @@ seo:
282301

283302
## Structured Data (JSON-LD)
284303

285-
Great Docs injects [JSON-LD](https://json-ld.org/) structured data into your pages, enabling rich
286-
search results with additional context about your software.
304+
Structured data helps search engines understand what your site is about beyond plain text. Great
305+
Docs injects [JSON-LD](https://json-ld.org/) structured data into your pages, enabling rich search
306+
results with additional context about your software.
287307

288308
### What Gets Injected
289309

290-
On the homepage and reference pages, Great Docs adds:
310+
On the homepage and reference pages, Great Docs adds a schema block like this:
291311

292312
```json
293313
{
@@ -325,8 +345,9 @@ seo:
325345

326346
## Meta Descriptions
327347

328-
Meta descriptions appear in search result snippets. Great Docs automatically generates them from
329-
your page content.
348+
Meta descriptions are the short summaries that appear below page titles in search results. A good
349+
description improves click-through rates because it tells searchers exactly what they'll find on the
350+
page. Great Docs generates these automatically from your content.
330351

331352
### Auto-Generation
332353

@@ -344,7 +365,7 @@ seo:
344365
default_description: "Documentation for My Package, a Python library for..."
345366
```
346367

347-
If not set, the package description from `pyproject.toml` is used.
368+
If not set, the package description from `pyproject.toml` is used as a fallback.
348369

349370
### Page-Level Descriptions
350371

@@ -359,7 +380,8 @@ description: "How to install My Package using pip, conda, or from source."
359380

360381
## Noindex for Internal Pages
361382

362-
Some pages shouldn't appear in search results. Great Docs automatically adds `noindex` directives to
383+
Not every page belongs in search results. Internal pages, drafts, or experimental features can
384+
clutter search results and confuse users. Great Docs automatically adds `noindex` directives to
363385
internal pages like the Skills page.
364386

365387
### Manual Noindex
@@ -375,6 +397,9 @@ robots: "noindex, nofollow"
375397

376398
## Disabling SEO Features
377399

400+
If you handle SEO through other means (for example, a hosting platform that generates sitemaps for
401+
you), you can disable individual features or all of them at once.
402+
378403
To completely disable SEO generation:
379404

380405
```{.yaml filename="great-docs.yml"}
@@ -398,6 +423,9 @@ seo:
398423

399424
## Best Practices
400425

426+
The automatic features cover the technical foundations. These recommendations help you get the most
427+
out of them.
428+
401429
### For Maximum SEO Effectiveness
402430

403431
1. set a base URL either through a GitHub repo or explicit configuration
@@ -430,9 +458,10 @@ And ensure your DNS is configured correctly (see
430458
## Next Steps
431459

432460
Good SEO makes your documentation discoverable. Great Docs handles the technical foundations
433-
(sitemaps, canonical URLs, meta tags) automatically, so you can focus on writing clear titles and
434-
descriptions.
461+
(sitemaps, canonical URLs, meta tags, structured data) automatically, so you can focus on writing
462+
clear titles and descriptions that represent your content well.
435463

436464
- [Social Cards](social-cards.qmd) controls how links appear when shared on social platforms
437465
- [Deployment](deployment.qmd) covers publishing to GitHub Pages with SEO settings applied
466+
- [Linting](linting.qmd) catches documentation quality issues that can also affect search relevance
438467
- [Configuration](configuration.qmd) covers all `great-docs.yml` options including SEO settings

0 commit comments

Comments
 (0)