From now on I stop updating my Previous blog and start posting my notes using the lightweight github pages.

To create a new post, use command

rake post title="new post title" tags="xxx"

Now it is quite easy to write a blog using Markdown. A quick reference for mastering the markdown can be found here.

  • Test: insert an image (online image)

    Image of San Francisco

  • Test: highlight code

class Dummy {
  public:
  // constructor
  Dummy(string _s): name(_s){}
  string  name;
  }

To view the blogs running on the localhost, use command:

jekyll serve

Contributions to this theme

I improve the UI experience of this theme by:

1. Adding Tex Support

To use the tex in the articles, I refer the article of Christopher Poole: Using MathJax on Github:Pages. So in the file _include/default.html, I added a script element in the head element:

<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Now test the MathJax

Here is an example MathJax inline rendering \\( 1/x^{2} \\), and here is a block rendering:
\\[ \frac{1}{n^{2}} \\]

Here is an example MathJax inline rendering \( 1/x^{2} \), and here is a block rendering: \[ \frac{1}{n^{2}} \]

2. Adding “Read More…” on Index Page

By default, this theme only can show a list of full articles or articles names on the index page. I use solution posted in Jekyll-Read More without Plugin to show partial contents.

Be sure to put <!--more--> in the post, otherwise, the contents shown on the index page will be messy.

3. Adding Disqus for Comments

This theme does not come with any comment block. One of simple ways to add comments to the jekyll blog is using Disqus.

  1. Sign up for a disqus acount and register dormain
  2. Follow the setup instructions to embed the div element into the _include/post.html
<div id="disqus_thread"></div>
    <script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'ysonggit'; // required: replace example with your forum shortname
    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

Yang Song

Ph.D. Student in Robotics