mirror of
https://gh.wpcy.net/https://github.com/TGMPA/TGM-Plugin-Activation.git
synced 2026-07-14 10:56:39 +08:00
Jekyll 3.0 forces switching from Pygments to Rouge for code highlighting. Using the Rouge native linenr feature screws up the layout of our code samples - see screenshots below. This PR fixes that by: * turning off the Rouge line nr feature. * using Liquid to add empty linenr spans at the beginning of each line * using CSS with :before to add the actual line numbers This PR also includes some additional HTML source code compression, getting rid of extraneous new lines caused by Liquid parsing (outside of `<pre>` tags). Both the linenrs as well as the blank line removal can be turned on/off via a configuration feature in `_config.yml`. Additionally, the syntax highlight styling has been synced with the GH native syntax highlight styles. ##### How it used to display  ##### Display after switching to Rouge 
19 lines
No EOL
366 B
HTML
19 lines
No EOL
366 B
HTML
---
|
|
layout: compress
|
|
---
|
|
<!doctype html>
|
|
<html lang="en">
|
|
{% include header.html %}
|
|
|
|
{% unless page.anchor == "home" or page.anchor == "blog" or page.menu == false %}
|
|
{% include tweet-button.html %}
|
|
{% endunless %}
|
|
|
|
{{ content }}
|
|
|
|
{% capture backtotop %}[Back to Top](#top){:.top}{% endcapture %}
|
|
{{ backtotop|markdownify }}
|
|
|
|
{% include footer.html %}
|
|
|
|
</html> |