Long time ago I started blogging about tech stuff and changed a lot of platform from wordpress to my own hosted blog and for some reasons I started using blogger with my custom domain and when it comes to add code snippet in the posts, github's gist feature was my first choice but it involves writing snippet and adding its reference into my blog which is more than one step process. For that reason I recently explored highlightjs for code highlighting in my posts and it works great. The configuration is easy 1 step process. Configuration: To configure highlightjs into blogger, just go to the theme option in your blogger control panel and click customize. After that in the page header add following script:
<link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.1/styles/atom-one-light.min.css" rel="stylesheet"></link><script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
No comments:
Post a Comment