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

[CORL-2877]: clarify data-coral-url in docs for comment count #4330

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/docs/counts.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ After successful injection it will become:
Set the class of your html element to `coral-count` in order to get story counts. The following `data-coral-*` attributes will configure the output:

- `data-coral-id` – The id of the story of which counts should be injected.
- `data-coral-url` – The URL of the story of which counts should be injected.
- `data-coral-url` – The URL of the story of which counts should be injected. See more info below on when it needs to be set.
- `data-coral-notext` – If set to `"true"`, only the count number will be injected

Either `data-coral-id` or `data-coral-url` should be set. If none are provided the story URL
will be retrieved from the [canonical url reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs#Using_%3Clink_relcanonical%3E) `<link rel="canonical" href="...">` or inferred using the current page url.
The `data-coral-url` attribute should always be provided or be able to be inferred from the canonical url reference or current page url. If it is not provided in the data attribute, the story URL will be retrieved from the [canonical url reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs#Using_%3Clink_relcanonical%3E) `<link rel="canonical" href="...">` or inferred using the current page url. Therefore, on pages where the story URL cannot be inferred from the canonical url reference or current page url (such as indexes and homepages), it's important that the `data-coral-url` be included.