Local post assets with Jekyll

后端 未结 6 1211
鱼传尺愫
鱼传尺愫 2021-01-30 01:58

I was wondering how other people are organising their assets for individual posts when using Jekyll. For example, if a post has an image, do you just dump it in a shared images

6条回答
  •  你的背包
    2021-01-30 02:40

    I wrote a plugin to let me organise assets in subdirectories easily:
    https://github.com/samrayner/jekyll-asset-path-plugin

    {% asset_path my-image.png %}
    

    in post 2013-01-01-post-title would output:

    /assets/posts/post-title/my-image.png
    

    in page my-first-page would output:

    /assets/my-first-page/my-image.png
    

提交回复
热议问题