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

Use canonical links #896

Closed
Tracked by #894
codemonkey800 opened this issue Feb 9, 2023 · 2 comments
Closed
Tracked by #894

Use canonical links #896

codemonkey800 opened this issue Feb 9, 2023 · 2 comments
Assignees
Labels

Comments

@codemonkey800
Copy link
Collaborator

codemonkey800 commented Feb 9, 2023

https://ahrefs.com/blog/canonicalization/

Canonical links is a way for us to specify the primary URL for all pages that can be derived from a single authoritative URL. This is important for the following scenarios:

  1. Faceted navigation on home page: Given the search page is driven by search, filters, sort, and pagination, there can be a large combination of possible URLs because of the different possible query parameters. For example:
    https://www.napari-hub.org/?search=napari&sort=relevance&license=oss&supportedData=2D&page=1
  2. Plugin page category highlighting: When filtering by npe2 metadata, the hub will add additional query parameters to the URL to highlight the filtered metadata. For example:
    https://www.napari-hub.org/plugins/napari-stracking?workflowStep=Object+tracking
  3. Prevent aliased deployments from being indexed on Google, like https://public-frontend.prod.imaging.cziscience.com

Because of this, it's important we specify a canonical URL for each page so that it points directly to the napari hub.

@codemonkey800
Copy link
Collaborator Author

we can probably add the metadata here in the _app.tsx file so it applies to every page:

<Head>
{/*
Disable indexing for non-production deployments.
https://developers.google.com/search/docs/advanced/crawling/block-indexing
*/}
{(!PROD || process.env.PREVIEW) && (
<meta name="robots" content="noindex" />
)}
</Head>

you just need a way to pass the URL without any query parameters

@EricMaxWang EricMaxWang moved this from Backlog to Ready in napari hub backlog Feb 13, 2023
@klai95 klai95 moved this from Ready to In Progress in napari hub backlog Feb 27, 2023
@klai95 klai95 moved this from In Progress to In Code Review in napari hub backlog Mar 2, 2023
@klai95
Copy link
Contributor

klai95 commented Mar 2, 2023

@codemonkey800 Could you also provide a screenshot of the current behavior? I think it would make it more clear visually what the problem is.

@klai95 klai95 moved this from In Code Review to Pending QA & Release in napari hub backlog Mar 3, 2023
@klai95 klai95 closed this as completed Mar 9, 2023
@github-project-automation github-project-automation bot moved this from Pending QA & Release to Done in napari hub backlog Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants