Local post assets with Jekyll

后端 未结 6 996
鱼传尺愫
鱼传尺愫 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 03:00

    This answer:

    • Does not use plugins (works with GitHub Pages)
    • Allows you to keep images directly next to their relevant posts
    • Allows you to edit using Typora locally and see the images WYSIWYG

    Just name your folders like _posts/2020-10-10-My-Title/ and include files like index.md and hero.svg or other images.

    Then set your permalink: key in _config.yaml to :path.

    Caveats:

    • Your folder names must be sluggified
    • Your images must all be SVG

提交回复
热议问题