Thursday, December 4, 2014

How to post markdown article on blogspot/blogger with enabled code syntax highlighting

How-to

  • Open StackEdit
  • In blogger create a new post and get postId from the URL
  • Setup post permalink to match the title
  • Using # synchronize the document with google drive
  • Using # publish the article to blogspot
  • As you keep editing simply synchronize/re-publish the article
  • In order to enable syntax highlighting for the C#/XML or any other code edit the blogspot template and insert the following script reference between <head></head> tags:
    <script src='https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js'/>
  • Use following at the top of markdown post to define whether the article is published, title and tags:
---
title: My article title
tags: tag1,tag2
published: true
---

References