chriskyfung / chriskyfung.github.io

My Personal Website
https://chriskyfung.github.io
3 stars 1 forks source link

🔧 chore (deps): remove jekyll-gist dependency for AMP compatibility #17

Closed chriskyfung closed 9 months ago

chriskyfung commented 9 months ago

Overview

The project's Gemfile includes the jekyll-gist package, which allows embedding GitHub gists in posts and pages. However, this package is incompatible with AMP, and it renders script tags that break AMP validation and page layout. To prevent these issues, the theme should remove the jekyll-gist dependency and use alternative methods to embed gists.

Problem

The jekyll-gist package always renders the gist content with a script tag, regardless of whether the page is an AMP page or not. This violates the AMP specification, and results in AMP validation errors and broken page layout.

Steps to reproduce the behavior

Environment

Solution

The jekyll-gist package should be removed from the theme's Gemfile and any usage of the gist tag should be replaced with using an <amp-gist> component to embed the gist. This will ensure that the theme is compatible with AMP and does not render any script tags that are forbidden by AMP.

Steps to implement the solution