amp-jekyll icon indicating copy to clipboard operation
amp-jekyll copied to clipboard

Uses master post and URL to set @url and @name.

Open njpearman opened this issue 7 years ago • 0 comments

Hi. I've been using your amp-jekyll plugin on a blog, but I've had a problem when using it with the jekyll-sitemap plugin. The AMP files were added to the sitemap, but the .html extension for the generated AMP posts was excluded, meaning the sitemap links where broken. This is because the jekyll-sitemap plugin uses Jekyll::Page#url to output the <loc> of each post in the generated sitemap, and amp-jekyll overrides @url with dir, which doesn't include the extension.

I've made this change, which uses the Jekyll::URL class to set @url in the Jekyll::AmpPage constructor. This fixes my problem above. I don't know whether this negatively impacts things elsewhere though... :S

Does this work as a general enhancement to amp-jekyll? I can tidy up the changes, such as constructor args if it does.

njpearman avatar Dec 20 '17 12:12 njpearman