如何在由jekyll创建的Github页面的帖子中显示图像?

时间:2014-11-04 06:38:49

标签: git image github repository jekyll

我在Github有一个回购。我使用Jekyll为这个回购创建了一个静态网站。这是网站:http://andrewhzau.github.io/RICENCODE/。我在_posts目录中创建了一些.md文件。一切都没问题,但数字没有正确显示。

这是我的.md文件之一:

---
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)

以下是此帖子的生成页面:

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

在我的本地计算机上,我使用“jekyll serve”生成网站并使用

访问它
http://localhost:4000/ 

并且数字还可以。

你们能帮助我吗?谢谢!

2 个答案:

答案 0 :(得分:2)

您可能忘记在site.JB.BASE_PATH中设置_config.yml参数:

BASE_PATH : /RICENCODE

然后像这样调用你的图像:

![GSD1 phenotype]({{ BASE_PATH }}/assets/images/GSD1.pheno.png)

答案 1 :(得分:0)

我使用了完整的网址,数据显示正确。

## Key figures
<img src="http://andrewhzau.github.io/RICENCODE/assets/images/GSD1.pheno.png" >  
<img src="http://andrewhzau.github.io/RICENCODE/assets/images/GSD1.exp.png" > 

这些数字在我的本地计算机上无法正常运行。无论如何,只要互联网上的网站没问题,问题就解决了。

相关问题