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

Merged
merged 1 commit into from Jan 23, 2012

Projects

None yet
@thatguystone
Contributor

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 %})
5cffe5e
@mojombo mojombo merged commit 5cffe5e into jekyll:master Jan 23, 2012
@bhardin
Contributor
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
Contributor
bhardin commented Nov 12, 2012
@ixti
Member
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
Contributor
bhardin commented Nov 16, 2012

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

@ixti
Member
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. :))

@itsmeravitejak

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 fancyoung referenced this pull request in imathis/octopress Jan 1, 2013
Closed

How to add internal link in post? #544

@Brixy
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
Contributor
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
Brixy commented Jan 26, 2013

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

@benedfit

Any chance this could be extended to pages too?

@parkr
Member
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.

@benedfit

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
Member
parkr commented Aug 26, 2013

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

@benedfit

That's what I was hoping for

@parkr
Member
parkr commented Aug 26, 2013

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

@rnz
rnz commented Oct 5, 2013

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

@parkr
Member
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
gest01 commented Dec 9, 2013

Hi,

{% 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 ?

@timesking

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
Member
parkr commented May 1, 2014

No, baseurl is not used automatically for any URL's, just for jekyll serve: http://blog.parkermoore.de/2014/04/27/clearing-up-confusion-around-baseurl/

@jarylwang jarylwang pushed a commit to jarylwang/www.jarylwang.com 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
6c007b1
@jekyllbot 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.