I had a lot of pain finding a easy way to post code snippets in blogger. After a lot of searching found a easy way. Here it is.
- Go to gist.github.com
- Write a description (Optional)
- Write a file name including extension. Without extension syntax will not be highlighted.
- Add your code, which you want to post in blogger.
- Now click "Create Public Gist" button.
- Then Copy the embed Script.
- Now back to blogger.
- Paste the script where you need to add the code snippet.
- Make sure to select the option “Interpret typed HTML” under Post Options -> Compose mode.
After following these steps here my code looks like.
Happy Coding 🌝
No comments:
Post a Comment