Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show images in posts of Github pages created by jekyll?

I got a repo in Github. I created a static website for this repo using Jekyll. Here is the website: http://andrewhzau.github.io/RICENCODE/. I created some .md files in the _posts directory. Everything is okay except that the figures are not shown correctly.

Here is one of my .md file:

---
layout: post
title: "GSD1"
description: ""
category: genes
tags: [grain setting, photoassimilate translocation, plasma membrane, grain filling]
---
{% include JB/setup %}

........

## Key figures
![Expression]({{ site.url }}/assets/images/GSD1.exp.png)  
![Phenotype]({{ site.url }}/assets/images/GSD1.pheno.png)

And here is the generated page for this post:

http://andrewhzau.github.io/RICENCODE/genes/2014/09/20/GSD1/

On my local computer, I use "jekyll serve" to generate the website and access it using

http://localhost:4000/ 

and the figures are okay.

Can you guys help me with this? Thanks!

like image 503
Ven Yao Avatar asked Sep 12 '25 23:09

Ven Yao


1 Answers

Maybe you forgot to set the site.JB.BASE_PATH parameter in _config.yml :

BASE_PATH : /RICENCODE

Then call your images like this :

![GSD1 phenotype]({{ BASE_PATH }}/assets/images/GSD1.pheno.png)
like image 86
David Jacquel Avatar answered Sep 15 '25 12:09

David Jacquel