1. Edit your blog template.
2. Find the
</body>
tag.
3. Paste the fragment below before the tag you found above
(NOTE: this is my custom helper and will load js from my github cdn,
you can modify it to create your own as needed)
<script type='text/javascript'>
syntaxHighlighterConfig = {
config: {
// required for blog
bloggerMode: true
},
defaults: {
// optional, collapse code block
// collapse: true
},
themes: {
// optional, use other themes
// 'dark' can be any string
// 'shThemeRDark.css' should be the file name
'dark': 'shThemeRDark.css'
}
};
</script>
<script src='//cdn.rawgit.com/benbai123/HTML_CSS_Javascript_practice/2da59146af1a73f8700c33f3562e09c0b2c31ef8/libs_tools/SyntaxHighlighter/helper/shHelper.js' type='text/javascript'></script>
4. Save template
Done
(It seems there is an
autoloader feature but that page not works well so
I wrote my own.)
References:
My testing files
SyntaxHighlighter-themes
SyntaxHighlighter-configuration
No comments:
Post a Comment