-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: Relabel SEO guide as explanation (Diátaxis) #10004
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
Merged
benjaoming
merged 7 commits into
readthedocs:diataxis/main
from
benjaoming:diataxis/seo-guide
Feb 10, 2023
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b9e455
Transform the guide into an explanation with best practices, use Sphi…
benjaoming 8ca6498
Apply suggestions from @ericholscher's code review
benjaoming d211a9d
Re-add motivational text with a reference to the best practices.. but…
benjaoming 6d716ee
Finish the sentence
benjaoming d5cb3f6
General intro to unlinked pages
benjaoming 8e93993
Add TODO items
benjaoming 5470dc0
Apply suggestions from @ericholscher's code review
benjaoming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ While you optimize your docs to make them more friendly for search engine spider | |
it's important to keep in mind that your ultimate goal is to make your docs | ||
more :term:`discoverable <discoverability>` for your users. | ||
|
||
By following :ref:`best practices for SEO <guides/technical-docs-seo-guide:Best practices for documentation SEO>`, | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
you can ensure that when a user types a question into a search engine, | ||
they can get the answers from your documentation in the search results. | ||
|
||
.. seealso:: | ||
|
||
This guide isn't meant to be your only resource on SEO, | ||
|
@@ -81,18 +85,25 @@ which we'll discuss shortly, | |
the most important thing is making sure the spider can follow links on your site | ||
and get to all your pages. | ||
|
||
Avoid orphan pages ✅️ | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
Avoid unlinked pages ✅️ | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
When building your documentation, | ||
you should ensure that pages aren't *unlinked* or *orphaned*, | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
meaning that no other pages or navigation have a link to them. | ||
|
||
Sphinx calls pages that don't have links to them "orphans" | ||
and will throw a warning while building documentation that contains an orphan | ||
unless the warning is silenced with the :ref:`orphan directive <sphinx:metadata>`: | ||
Search engine crawlers will not discover pages that aren't referenced. | ||
benjaoming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. TODO: Create a "generic" tab? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
|
||
.. tabs:: | ||
|
||
.. tab:: Sphinx | ||
|
||
Sphinx will warn you when a page isn't referenced by the remaining documentation. | ||
Sphinx calls pages that don't have links to them "orphans" | ||
and will throw a warning while building documentation that contains an orphan | ||
unless the warning is silenced with the :ref:`orphan directive <sphinx:metadata>`. | ||
|
||
We recommend failing your builds whenever Sphinx warns you, | ||
using the ``fail_on_warnings`` option in :ref:`.readthedocs.yaml <config-file/v2:sphinx>`. | ||
|
||
|
@@ -110,10 +121,9 @@ unless the warning is silenced with the :ref:`orphan directive <sphinx:metadata> | |
.. tab:: MkDocs | ||
|
||
MkDocs automatically includes all ``.md`` files in the main navigation 💯️. | ||
So it does not need to report back about unreferenced files. | ||
You have to go out of your way and install a plugin, | ||
if you want to hide files from the navigation. | ||
If you do want to scan your documentation for unreferenced files and images, | ||
This makes sure that all files are discoverable by default, | ||
however there are configurations that allow for unlinked files in various ways. | ||
If you want to scan your documentation for unreferenced files and images, | ||
a plugin like `mkdocs-unused-files`_ does the job. | ||
|
||
|
||
|
@@ -132,6 +142,8 @@ make sure the rest of that page describes the content of the video. | |
|
||
When using images, make sure to set the image alt text or set a caption on figures. | ||
|
||
.. TODO: Create a "generic" tab? | ||
|
||
.. tabs:: | ||
|
||
.. tab:: Sphinx | ||
|
@@ -149,13 +161,13 @@ When using images, make sure to set the image alt text or set a caption on figur | |
|
||
.. tab:: MkDocs | ||
|
||
The Markdown syntax fundamentally prescribes an alt text for images: | ||
The Markdown syntax defines an alt text for images: | ||
|
||
.. code-block:: md | ||
|
||
{ width="300" } | ||
|
||
If you want to use figures and captions, | ||
Though HTML supports figures and captions, | ||
Markdown and MkDocs do not have a built-in feature. | ||
Instead, | ||
you can use markdown extensions such as `md-in-html`_ to allow the necessary HTML structures for including figures: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.