To make sure that your blogger and your site always reference the same (latest) version of your code samples, and that the formatting is consistent across your site and your blog, you should consider using github to be the master for all your code samples. Take a look at how to embed gist in Blogger in this post. Here we’ll cover how to do the same thing in Google Sites (which is hosting this site).
We’ll use the code sample for Simple implementation of R- melt to embed the code from this gist.
Using Google Apps Script
Another way is to use the caja prettifier wrapped up in Google Apps Script. You can read about how this works here. This time we use a simple iFrame gadget, and embed a URL like this
The code below would have been displayed in the created gadget.