sunlight icon indicating copy to clipboard operation
sunlight copied to clipboard

Blogger Integration

Open hongthaiis opened this issue 10 years ago • 2 comments

Hi, I would like to integrate SunlightJS to blogger. I followed step by step in "installation guide" at your home page: http://sunlightjs.com/docs.html#installation:

  • First, I added these line to my template:

    <link rel="stylesheet" type="text/css" href="/path/to/sunlight.default.css" />
    <script type="text/javascript" src="/[my_path]/sunlight-min.js">
    

    <script type="text/javascript" src="/[my_path]/sunlight.csharp-min.js"> <script type="text/javascript"> Sunlight.highlightAll(); </script>

  • Then, in post, I wrapped code in pre tag:

    public object DoStuff() {
    return new object();
    }
    

But all my result only be this: http://i.imgur.com/JdbOyT1.png Where am I wrong?

hongthaiis avatar Dec 09 '15 04:12 hongthaiis

A couple possibilities:

  1. Sunlight.highlightAll() needs to come after the DOM is ready, i.e. right before the closing </body> tag or in a DOMReady event listener (like $(document).ready(...))
  2. You are missing the sunlight-highlight-csharp class on your <pre> tag.

tmont avatar Dec 09 '15 14:12 tmont

Sorry, tmont! I've tried many ways to integrate sunlightJS to Blogger, including your way, but it didn't work! :(

hongthaiis avatar Feb 17 '16 01:02 hongthaiis