Writing Blogs With Jekyll
23 Jan 2014When I play with jekyll and github pages, I have encountered some errors which are annoying and cost me a lot of time. The records of those errors are listed below.
ERROR LIST
SPECIAL CHARACTERS
special characters: < , & , *
< and & is special characters, the only way make them appear in normal area is to put spaces on the both side of them.
for example, some thing like below will cause markdown errors.
x<y
x&y
the correct way to write this two is:
x < y
x & y
* can also cause markdown errors. the expression below will cause error.
N*T
so, i turn it into 'NT' to avoid this error.
PICTURES DON’T SHOW UP
At first I use relative directory to refer pictures in markdown files, like this:
![](../images/XXX.jpg)
actually it works for the local version of the website, however, after it has been pushed to github, pictures can not be found in the web pages, and when I examine the source markdown files, picture shows correctly.
The reason of this problem is that the final html file generated by jekyll locating in different directories with the ones source markdown files locating. So, absolute directory is needed. Like this:
![](/images/XXX.jpg)
PS: The ‘/’ is the root directory of the whole web site, jekyll just put static objects(like, jpg, css, js and so on) in where they are used to be in the source directory.
FILE NAME PROBLEMS
If post name consistent special characters mentioned above “ < & * “, it will cause compelling errors in “index.md”.