Closed RNAer closed 10 years ago
I place image files in `source/images' and then reference them in posts as follows:
{% img images/image-filename.png %}
So if the link to your image does not have a path, then I assume you should place them in the source
directory.
I use the source/images' directory as it keeps all the images together and keep the
source` directory easier to manage (assuming you have lots of image files).
Hope that helps.
thanks!
On Wed, Jun 4, 2014 at 1:30 PM, John Stevenson notifications@github.com wrote:
I place image files in `source/images' and then reference them in posts as follows:
{% img images/image-filename.png %}
So if the link to your image does not have a path, then I assume you should place them in the source directory.
I use the source/images' directory as it keeps all the images together and keep thesource` directory easier to manage (assuming you have lots of image files).
Hope that helps.
— Reply to this email directly or view it on GitHub https://github.com/tommy351/hexo/issues/658#issuecomment-45139876.
You can also use the post_asset_folder: true
option in _config.yml
I can't find any documentation on it though.
It allows you to store your assets (images for instance) in a directory with same name as your post.
If you have 2014/06/my-post.md
you can put images in 2014/06/my-post/
.
After generation, they will be with the index.html of your article :
2014/06/my-post/index.html
2014/06/my-post/some_image.png
Example with my blog: https://github.com/floriancargoet/blog.floriancargoet.com/tree/master/source/_posts/2013/03 where I use {% img /2013/03/someone-git-push-force/forced.png %}
to reference the images.
@RNAer I think this issue can be closed now.
Thanks cc @tommy351
yeah, thanks all.
Thanks for the awesome packages at first.
To properly display posts locally with "hexo server", where should the image files of the hyperlinks (assuming the link does not have path before the image file name)?