Monday, June 1, 2020

Updating syntax highlighting imports to CDN (alexgorbatchev)

TL;DR:

replace:
https://alexgorbatchev.com/pub/sh/current/
with:
https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83

Syntax highlighting


For many years I have used a javascript based syntax highlighter on this blog. Including it directly from the author Alex Gorbatchev's site alexgorbatchev.com. Lately his site has been timing out behind Cloudflare (522) and slowing my initial render.

I've fixed the links to point to the wonderful javascript mirror Cloudflare provides at https://cdnjs.cloudflare.com/ajax/libs. This should fix the loading issue. I also took this opportunity to move to https loading for the embed, to fix any mixed-content warnings. Apologizes to any patron who was inconvenienced.

The Cloudflare page for this packages is https://cdnjs.com/libraries/SyntaxHighlighter, which shows all of the available files within the package.

A three-year-old answer on this lowly rated stackoverflow question provided details on the new link location.

No comments: