Recently, I used SyntaxHighter to show source code in my blog. It works fine,
but I feel something not very familiar. Just like the source code shown isn’t similar to other pages, like Github. I
decided to change to Google Prettify, and wait to see if it’s better. It’s
quite easy to setup, just follow official guide in Github. Here is a short summary:
- Embed Prettify into template:
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
more...
Blogger allowed to customize the appearance of our blog, by editing Blogger template - an HTML makeup code.
The structure of Blogger template is quite similar to every HTML pages with standard HTML components (head, body,
div…).
more...
Google Analytics is a tool that helps to
tracking traffic of visitor into your website, for example: from where user redirect to your website; how long they
stay on your website or specific page; information like age, gender, location, browser, phone model, their interests…
more...
Blogs that related to IT and Software Engineering will sometime need to show source code to reader. But not just
displayed as plain text, it’s better if source code can be formatted with color, indentation, alignment…just like
be displayed in IDE.
In web front-end, it can be implemented by using Javascript and CSS. Checking around some open source libraries/utils,
I found that SyntaxHighlighter is well known one. Below is
step-by-step guide to use this library in Blogger.
more...