Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll how to display an image in a post

Tags:

image

jekyll

I am trying to follow the Jekyll docs and am stuck on how to display an image

--- layout: post title:  "My first post!" date:   2016-10-20 16:17:57 +0200 categories: jekyll update regenerate: true ---  This is in the `_posts` directory. It can be edited then rebuild the site to see the changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.  ![name of the image][{{site.url}}/assets/P6740674.JPG] 

I feel very silly asking this question as it is so basic but I can not find any answers to my question

Is it possibly a configuration error on my own system. I am using apache2, ruby gems, etc

Thanks in advance

like image 818
Clive Tristram Avatar asked Oct 22 '16 21:10

Clive Tristram


1 Answers

If you want to use site.url, you have to add a url variable to your _config.yml file. More info in the Jekyll documentation.

But you might not have to use site.url at all. Any urls that start with a / slash will be relative to the top level of your domain. So you could do this:

![image tooltip here](/assets/image.jpg) 
like image 200
Kevin Workman Avatar answered Oct 06 '22 14:10

Kevin Workman