Hey, to help grow my website, I’ve been publishing blogs and I’d like to be able to add snippets of code sort of like how its displayed on vs code. I’ve found online that I can use highlight.js but I couldn’t find anything specific to shopify. Can someone please explain or link me to how to both install something like this into my website and how to enable it in specific areas. I’d also be willing to do it in a simpler way if anyone has any suggestions.
This is Noah from PageFly - Shopify Page Builder App
Hi @Oblivion1 Sorry, I don’t quite understand what you mean. but not sure if this is what you want. Create a code snippet file and write the code in it. then call it to use.
Please add code here if you want call it in other file {% render ‘name-file-snippet’ %}
Thank you !
Best regards,
Noah | PageFly
Hey Noah thanks for the reply. I’m trying to display code so people can copy it for their own programs but entering it as plain text isn’t that appealing. https://bmr9kb5tre832bzx-87000219940.shopifypreview.com/blogs/main/articles?preview_key=edb18460f2c7c41c78b58f0b05f7a9e3 If you look at this preview of a potential future blog, under step 3 I have displayed a snippet of code however this is a temporary solution as I’d also like to have code in different languages. How this make it a bit more clear.
Thanks,
Ethan