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.
Hi. I've been using your
amp-jekyll
plugin on a blog, but I've had a problem when using it with thejekyll-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 thejekyll-sitemap
plugin usesJekyll::Page#url
to output the<loc>
of each post in the generated sitemap, andamp-jekyll
overrides@url
withdir
, which doesn't include the extension.I've made this change, which uses the
Jekyll::URL
class to set@url
in theJekyll::AmpPage
constructor. This fixes my problem above. I don't know whether this negatively impacts things elsewhere though... :SDoes this work as a general enhancement to
amp-jekyll
? I can tidy up the changes, such as constructor args if it does.