Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll: how a draft refer to another draft

Tags:

jekyll

I am writing a draft in _drafts/ directory.

   _drafts/
          draft_a.md
          draft_b.md

What is the syntax of referring to draft_b inside draft_a.md?

I tried post_url, or just simply /draft_b.md. None of those worked.

like image 938
simonso Avatar asked Nov 19 '25 10:11

simonso


1 Answers

Two steps:

  1. Use jekyll serve with --drafts to make them accessible

    jekyll serve --drafts
    
  2. In one draft use the tag link to refer to the other draft. Suppose you have two drafts:

     /_drafts/one.md
     /_drafts/two.md
    

In one.md:

      {{ site.baseurl }}{% link _drafts/two.md %}

Then when accessing the served one.md it will contain a link to the other post /two.

like image 127
marcanuy Avatar answered Nov 21 '25 10:11

marcanuy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!