I wanted to publish a blog post today about using Shopify menus to drive hierarchical breadcrumbs. Then I realized that, as near as I can tell, there is nobody who has a syntax highlighter for Liquid, the templating language that Shopify uses. So I created one. This is an pre-pre-alpha experimental plugin, but it’s working just fine on the page I linked above. I already see that the keyword “in” (used in for loops) is missing from my highlighter file.
To use it, you need to first install the Syntax Highlighter Evolved plugin. All I’ve done is add a “brush” that hooks into that plugin.
Once that’s running, just download and install my plugin: Syntax Highlighter Liquid Brush. At some point I’ll put it on Github and WP.org, but I actually lost my WP.org login and the recovery email is no longer valid… so I need to create a new profile.
Very simple. Using the text editor (not tested with the visual editor), simply wrap your liquid code in the shortcode
and you’re all set. Like so:
-- Liquid code goes here --
There’s no need to add “pre” or “code” tags, convert anything to HTML entities or anything. Just paste your code from your code editor into WordPress between the shortcodes and away you go. Again, you can see it in action here.