-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Generate sitemap with only canonical urls #7131
Conversation
console.log(`${path} doesn't exist`); | ||
return formatDate(new Date()); | ||
}; | ||
const PLATFORMS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we reuse the platform const from https://github.com/aws-amplify/docs/blob/main/src/data/platforms.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tried to do that originally, it kept throwing an error saying it couldn't find the module @data/platforms
. I also tried specifying the relative path ../src/data/platforms.js
but that didn't work either. Maybe I'm doing something wrong though? Do you have any thoughts on what I tried so far?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's because platforms.ts
is a typescript file and it needs to be a complied js file? 🤔
Description of changes:
cheerio
to help parse HTML build filesmain
elements in each of the HTML files. After comparing them, we group the duplicate pages and select one to be the canonical url based on its platform ranking. We use this selected url in the sitemap to denote that it is a canonical url.sitemap built from this branch: https://canonical-sitemap.d1ywzrxfkb9wgg.amplifyapp.com/sitemap.xml
Staging site: https://canonical-sitemap.d1ywzrxfkb9wgg.amplifyapp.com/
Related GitHub issue #, if available:
Instructions
If this PR should not be merged upon approval for any reason, please submit as a DRAFT
Which product(s) are affected by this PR (if applicable)?
Which platform(s) are affected by this PR (if applicable)?
Please add the product(s)/platform(s) affected to the PR title
Checks
Does this PR conform to the styleguide?
Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.
Are any files being deleted with this PR? If so, have the needed redirects been created?
Are all links in MDX files using the MDX link syntax rather than HTML link syntax?
ref: MDX:
[link](https://docs.amplify.aws/)
HTML:
<a href="https://docs.amplify.aws/">link</a>
When this PR is ready to merge, please check the box below
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.