Kentico / kentico-amp

Accelerated Mobile Pages module for Kentico EMS.
https://www.kentico.com/
MIT License
9 stars 14 forks source link

AMP pages Canonical URL macros not resolving #39

Open bhuvanavramana opened 4 years ago

bhuvanavramana commented 4 years ago

We have implemented the AMP Module in our site based on the below reference link and our site running on kentico 10 version and the Nuget package version we used for AMP module is Kentico.AcceleratedMobilePages/1.0.3.

Ref: https://devnet.kentico.com/articles/google-amping-the-kentico-advantage-site

We have an issue in our site while browsing the page we are getting wrong URL as canonical URL. We have given custom URL pattern to our page. In that custom URL we given a macros like "/amp/{sectionname}/{mm}/{dd}/{yy}/{title}", so the canonical URL displaying

the same path instead of page URL. Below are the steps to reproduce the issue on live site.

Kindly help me to get the correct canonical url display or to remove the canonical URL link. custom url path

fvolner commented 4 years ago

The issue occurs because of the implementation of the GetDocumentPath method that takes the DocumentUrlPath property, which does not resolve the wildcard.

You can check a quick fix I did in my forked repository and apply it to your code to see if it resolves your issue.

After a proper review, those changes will be merged into this repository.