Task #1841
[3 Subjects] Canonical URL should not be hardcoded
Description
Regardless of how we land up on a page, the canonical url should contain "<subjectName>*". Today, it is hardcoded to "python-3*". One exception:for Whirlwind book, please hardcode it to python-3* so that we do not have to make Google crawl all our whirlwind book pages again.
Updated by Ram Kordale about 3 years ago
- Subject changed from Canonical URL should not be hardcoded to [Beyond Python] Canonical URL should not be hardcoded
Updated by Ram Kordale about 3 years ago
- Subject changed from [Beyond Python] Canonical URL should not be hardcoded to [3 Subjects] Canonical URL should not be hardcoded
Updated by Ayush Khandelwal about 3 years ago
- Due date set to 11/09/2021
- Assignee changed from Ayush Khandelwal to Rishabh Sharma
- Estimated time set to 2.00 h
Updated by Rishabh Sharma about 3 years ago
Approaches tried (did not work)-
1. subscribing to subjectEmitter (emitted by website-search.component.ts) event INSIDE router.event.subscribe (this subscription was already present and settting canonical was working perfect) and then update tag accordingly when event is emitted.
2.without using any subscription or event , setting the canonical inside website-search.component.ts file just after we fetch books.
3.change the code of link service (green tick answer) and tried directive (last answer) of the document https://stackoverflow.com/questions/50737862/how-to-add-canonical-link-in-angular-5
4.tried console.log() statements in ssr commands to know the difference when it is working (previous working code) and when it is not working.
helpful Url- https://github.com/angular/angular/issues/15776
Updated by Rishabh Sharma about 3 years ago
some findings-
while updating canonical link tag using function (lets call it UpdateSubject(fakeSubject:string)) with fake hardcoded subject (so no subscription or event emitter needed) from the website-search.component.ts using link service, I found that if I put updateSubject() inside constructor or ngOninit of website-search.component.ts, it shows effect in view page source, but If I put the same function somewhere else (like after getBooks() or inside getBooks() or inside onSelectBook()), it does not shows effect in view page source, but in inspect element, we can see change.
Updated by Rishabh Sharma about 3 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Updated by Rishabh Sharma about 3 years ago
- Status changed from Resolved to Feedback
- Assignee changed from Rishabh Sharma to Ayush Khandelwal
Updated by Ayush Khandelwal over 2 years ago
Updated by Ayush Khandelwal over 2 years ago
- Due date changed from 11/09/2021 to 03/10/2022
- Status changed from Feedback to Reopened
- Assignee changed from Ayush Khandelwal to Rishabh Sharma
- % Done changed from 100 to 50
Canonical url is not present on QA
Updated by Rishabh Sharma over 2 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
Updated by Rishabh Sharma over 2 years ago
- Status changed from Resolved to Feedback
- Assignee changed from Rishabh Sharma to Ayush Khandelwal
Updated by Ayush Khandelwal about 2 years ago
- Assignee changed from Ayush Khandelwal to Ram Kordale
Working as expected