Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 23, 2012

Conversation

thatguystone
Copy link
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

…l 2010-07-21-name-of-post %}; useful for: [Some Link]({% post_url 2010-07-21-name-of-post %})
@mojombo mojombo merged commit 5cffe5e into jekyll:master Jan 23, 2012
@bhardin
Copy link

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
Copy link

bhardin commented Nov 12, 2012

@thatguystone ?

@ixti
Copy link
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
Copy link

bhardin commented Nov 16, 2012

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

@ixti
Copy link
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
Copy link

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

@Brixy
Copy link

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
Copy link

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
Copy link

Brixy commented Jan 26, 2013

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

@benedfit
Copy link

Any chance this could be extended to pages too?

@parkr
Copy link
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
Copy link

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
Copy link
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
Copy link

That's what I was hoping for

@parkr
Copy link
Member

parkr commented Aug 26, 2013

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

@rnz
Copy link

rnz commented Oct 5, 2013

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

@parkr
Copy link
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
Copy link

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
Copy link

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
Copy link
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 pushed a commit to jarylwang/www.jarylwang.com that referenced this pull request May 11, 2015
@jekyll jekyll 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet