Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
SEO adjustments for KB forums and user-related links (#5320)
* disallow crawling of KB forums via robots.txt * add rel='ugc nofollow' to KB forum links * add tests * add rel='nofollow' to user links * add doc for SEO notes/policies
- Loading branch information
Showing
53 changed files
with
305 additions
and
110 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -31,6 +31,7 @@ Part 2: Developer's Guide | ||
svelte | ||
browser_permissions | ||
zendesk | ||
seo | ||
notes | ||
|
||
|
||
This file contains 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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
=== | ||
SEO | ||
=== | ||
|
||
This document covers notes and policies related to SEO. | ||
|
||
Prefer ``meta`` tag if possible | ||
============================= | ||
|
||
If an entire page should not be indexed, and/or none of its links | ||
followed, prefer to use the ``<meta name="robots" ...>`` tag by specifying | ||
something like:: | ||
|
||
{% set meta = (('robots', 'noindex'),) %} | ||
|
||
or:: | ||
|
||
{% set meta = (('robots', 'noindex, nofollow'),) %} | ||
|
||
|
||
within the lowest-level Jinja2 templates of the inheritance chain that | ||
apply to only the desired pages. | ||
|
||
However, if you only want to discourage the crawling of specific links within | ||
a page, you'll have to add ``rel="nofollow"`` to each of those links within its | ||
template. For example:: | ||
|
||
<a rel="nofollow" href="...">...</a> | ||
|
||
|
||
Breadcrumbs | ||
=========== | ||
|
||
If one or more of the breadcrumb links for a page should not be crawled, you | ||
can add an extra string to those breadcrumb tuples to specify the proper | ||
attribute to use, for example:: | ||
|
||
{% set crumbs = [((profile_url(user), 'rel="nofollow"'), user.username), (None, title)] %} | ||
|
||
or:: | ||
|
||
{% set crumbs = [(document.get_absolute_url(), document.title), ((url('wiki.discuss.threads', document.slug), 'rel="ugc nofollow"'), _('Discuss'))] %} | ||
|
||
KB Forums | ||
========= | ||
|
||
KB forums are user-generated content about KB articles. They are not | ||
official content, and therefore not meant to be searchable. All links to | ||
KB forums should be marked with ``rel="ugc nofollow"``. | ||
|
||
User Links | ||
========== | ||
|
||
User-related pages are also not meant to be indexed (searchable), and links | ||
to them should not be crawled, so the base user template | ||
(``kitsune/users/jinja2/users/base.html``) contains:: | ||
|
||
{% set meta = (('robots', 'noindex'),) %} | ||
|
||
and all user links on all pages should be marked with ``rel="nofollow"``. |
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% macro date_by_user(date, user) -%} | ||
{% trans date=datetimeformat(date, format='longdatetime'), user=display_name(user), url=profile_url(user) %} | ||
{{date}} by <a href="{{url}}">{{user}}</a> | ||
{{date}} by <a rel="nofollow" href="{{url}}">{{user}}</a> | ||
{% endtrans %} | ||
{%- endmacro %} |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.