Adding in the ability to link to posts internally. #369

merged 1 commit into from Jan 23, 2012


None yet

thatguystone commented Jul 21, 2011

Syntax: {% post_url 2010-07-21-name-of-post %}.
Useful for: [Some Link]({% post_url 2010-07-21-name-of-post %})

This addresses issue #66

@thatguystone thatguystone Adding in the ability to link to posts internally. Syntax: {% post_ur…
…l 2010-07-21-name-of-post %}; useful for: [Some Link]({% post_url 2010-07-21-name-of-post %})

mojombo merged commit 5cffe5e into jekyll:master Jan 23, 2012


bhardin commented Oct 23, 2012

I have been trying to get this to work, but without luck. I am using Jekyll 0.11.2, If I do the following, shouldn't it work?

[A Post name]({% post_url 2012-07-04-my-post %})

bhardin commented Nov 12, 2012


ixti commented Nov 13, 2012

@bhardin it was merged into master after 0.11.2 release.
Use master, just put in your Gemfile:

gem 'jekyll', :github => 'mojombo/jekyll'

bhardin commented Nov 16, 2012

@ixti Does github pages use 11.2 or Tom's repo for jekyll in production?


ixti commented Nov 17, 2012

@bhardin I really don't have a clue :)) I use my own fork (which is current jekyll master with some patches from other forks merged in) for my blog and pretty happy. :))

hey guys i tried it
this way

[Talent Hunt]({% post_url 2013-01-01-test %})
[link to this post]({% post_url 2013-01-01-test %})

and it is generating output like this

Talent Huntost_url 2013-01-01-test %})
link to this postost_url 2013-01-01-test %})
i checked the version of jekyll its 0.11.2

please help me what might be the problem

fancyoung referenced this pull request in imathis/octopress Jan 1, 2013


How to add internal link in post? #544

Brixy commented Jan 20, 2013

Hi all,

{% post_url 2010-07-21-name-of-post %} works fine, but I am desperately trying to generate an internal link using this (and similar) code:

{% post_url {{ myLink }} %}

myLink itself works fine. It is generated from YAML meta data.

Is there a way to accomplish that?

Thank you!

PS: I hope this is the correct place to ask my question. I am pretty new to jekyll and totally convinced!


bhardin commented Jan 23, 2013

@Brixy You may want to post your question as a new issue. There will be more visibility and you will get a quicker response.

Brixy commented Jan 26, 2013

@bhardin Thank you very much for the advice. I posted my question here.

Any chance this could be extended to pages too?


parkr commented Aug 23, 2013

@benedfit It was attempted in #1407 but we decided it doesn't really make sense for the core to have a page_url tag.

How about pages that have permalinks that don't match their names? E.g 01-contact.html with permalink /contact-us/

It would remove the need to edit pages that linked to the permalink should it change in the future


parkr commented Aug 26, 2013

So it'd be {% page_url relative/path/to/ %} and link to that page's Page#url?

That's what I was hoping for


parkr commented Aug 26, 2013

Hm... ok. Would you mind opening a pull request for this and we'll discuss it further?

rnz commented Oct 5, 2013

May be add "target" - [blogger]( {:target="_blank"}) ?
Or this currently already present?


parkr commented Oct 6, 2013

@rnz Unfortunately we can't add custom link parsing. There may be a markdown parser that offers this, but I'm not sure.

gest01 commented Dec 9, 2013


{% post_url 2012-12-12-my-cool-post %} works great for me :-)
But it would be nice, if post_url first checks in the _draft folder for draft posts.

Is this possible ?

when I use below in markdown, it did not correctly become permalink url because there is "baseurl: /b" in my _config.yml

[Welcome to jekyll]({% post_url 2014-04-30-welcome-to-jekyll %})

Is it a bug?


parkr commented May 1, 2014

No, baseurl is not used automatically for any URL's, just for jekyll serve:

@jarylwang jarylwang pushed a commit to jarylwang/ that referenced this pull request May 11, 2015

@sparanoid sparanoid Use internal links instead of hardcoded links, read more about this s…
…pecification at jekyll/jekyll#369

jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.