Skip to content

Conversation

@AlexDaines
Copy link
Contributor

@AlexDaines AlexDaines commented Nov 25, 2025

Description

  • Changes canonical URLs from index.html?page=X&tocid=Y to direct paths like items/S3/TS3Client.html
  • Adds <meta name="aws-tocid"> for redirect logic
  • Updates parentloader.js to read tocid from meta tag

Motivation and Context

Canonical URLs pointed to frameset with query params. Search engines saw mismatch between canonical and actual page URL, hurting indexing.

Testing

  • Built doc generator
  • Verified canonical URLs on class, namespace, and method pages
  • Confirmed redirect behavior preserved via meta tag

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the code style of this project
  • I have read the README document
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@AlexDaines AlexDaines changed the base branch from main to development November 25, 2025 18:34
@GarrettBeatty GarrettBeatty requested a review from Copilot December 1, 2025 19:15
@GarrettBeatty
Copy link
Contributor

can you share the exact testing steps/validations/screenshots that you tested?

}
}
else {
//This content page is not in the expected frameset which contains the TOC so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file generated? i see its in output-files folder.

Copilot finished reviewing on behalf of GarrettBeatty December 1, 2025 19:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation generator to fix canonical URL formatting for better search engine indexing. The change moves from query parameter-based URLs (index.html?page=X&tocid=Y) to direct path URLs (items/S3/TS3Client.html), while preserving frameset redirect functionality through a new meta tag.

Key Changes

  • Canonical URLs now point directly to documentation pages instead of frameset with query parameters
  • Added <meta name="aws-tocid"> tag to store the table of contents ID needed for redirect logic
  • Updated JavaScript redirect logic to read tocid from meta tag instead of parsing canonical URL

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docgenerator/SDKDocGeneratorLib/Writers/BaseWriter.cs Updated canonical URL format to use direct paths and added aws-tocid meta tag
docgenerator/SDKDocGeneratorLib/output-files/resources/parentloader.js Modified frameset redirect logic to read tocid from meta tag and construct URL from current pathname

Comment on lines +44 to +48
var filename = pathname.substring(pathname.lastIndexOf('/') + 1);
//Reload the parent frameset and this content page. The inFrame part of this script
//will run on reload to replace the address bar URL with the actual friendly content
//frame page URL.
window.location.href = basePath + '/index.html?page=' + filename + '&tocid=' + tocid;
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page parameter should include the full relative path from /items/ (e.g., S3/TS3Client.html), not just the filename. This is inconsistent with how displayLink is called in BaseWriter.cs line 245-246, which passes GenerateFilepath() + '/' + GenerateFilename().

Current code extracts only the filename:

var filename = pathname.substring(pathname.lastIndexOf('/') + 1);

Should extract the full path after /items/:

var pagePath = pathname.substring(itemsIndex + '/items/'.length);

Then use:

window.location.href = basePath + '/index.html?page=' + pagePath + '&tocid=' + tocid;
Suggested change
var filename = pathname.substring(pathname.lastIndexOf('/') + 1);
//Reload the parent frameset and this content page. The inFrame part of this script
//will run on reload to replace the address bar URL with the actual friendly content
//frame page URL.
window.location.href = basePath + '/index.html?page=' + filename + '&tocid=' + tocid;
var pagePath = pathname.substring(itemsIndex + '/items/'.length);
//Reload the parent frameset and this content page. The inFrame part of this script
//will run on reload to replace the address bar URL with the actual friendly content
//frame page URL.
window.location.href = basePath + '/index.html?page=' + pagePath + '&tocid=' + tocid;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants