Is there a way to extend the markdown syntax to allow for wiki-like links using double square brackets"[[link to a post]]"?

I am using kramdown as my markdown parser/engine. I wanted to have the wiki like syntax for creating links to internal pages/posts i.e., double square brackets. My question is, is it possible to do without plugins, and if not, is there a plugin for achieving this?

Let’s say my site has two posts: Post A and PostsB, and if I wanted to link Post B in Post A I want to be able to do it in the following way: (See Below for [[PostB]])

Post A

Lorem ipsum dolor sit amet,   [[PostB]]  consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo

What I mean is saying [[PostB]] should get turned into <a href="path-to-postB">PostB Title</a>, as it would with [PostB](path-to-postB)

Any help is appreciated

1 Like

You need a specific and unique identifier, such as the URL. If you put that in double square brackets this is possible.

Could you please elaborate on that? When you say possible, how do you mean?

I seems that you can best use the EXACT TITLE as your semi-unique identifier. I have explained the solution in more detail here:

1 Like

Hi jhvanderschee,

Thanks a lot for the response. I tried the code, apparently it doesn’t replace the link in html instead it leaves the [[link]] as is, and adds additional content. What I want is more like replacing the link with actual url in the html.

What I mean is saying [[PostB]] should get turned into <a href="path-to-postB">PostB Title</a> , as it would with [PostB](path-to-postB)

Do you think this is achievable with liquid? Or this would require writing some ruby code, say a plugin maybe?

Did you download the repo and type jekyll serve?

This code turns [[Post B]] into <a href="path-to-the-post-b">Post B</a>, as you would get with [Post B](path-to-post-b).

1 Like

Hi jhvanderschee,

My bad. I used it without reading the code. I was using a collection while the code was looping through site.pages, which I had to change. It is working perfectly fine, thanks a lot.

Raghuveer S