Skip to content

Missing canonical link in the default theme #2550

@xuhdev

Description

@xuhdev

Search terms

default theme, canonical link

Expected Behavior

Index page generated by typedoc should include a rel canonical link.

Actual Behavior

Index page generated with the default theme does not have it.

Explanation

A rel canonical link informs a search engines that which page is the canonical page, i.e., the page that users should use. For example, the following two URLs have the exactly the same content:

A user can read the content by visiting either the of the URLs above. However, it is better for search engine to only index one of them so that the search results would be consistent and avoids content duplication in search results (while Search Engines also do some guesswork, they are not reliable and would punish the websites that do not mark canonical pages properly). By including a rel canonical link in the index page, search engines would understand the relationship between the two pages:

<link rel=canonical href=${sitemapBaseUrl}/>

The link does not have any effects to human visitors; they are only there for search engines.

(I'm getting a ton of warnings from Google Search Console)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions