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

[site] Document `link` Liquid tag #5182

Merged
merged 3 commits into from Aug 7, 2016

Conversation

Projects
None yet
3 participants
@DirtyF
Member

DirtyF commented Aug 2, 2016

Following #4624

Documentation for new link tag introduced in v3.2.0

cc @jekyll/documentation

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Aug 2, 2016

Member

@DirtyF I like it! A couple thoughts:

  1. Should this go above post_url as it's a superset of its functionality?
  2. Should we show an example with linking to a page or post? It works with everything AFAIR.
Member

parkr commented Aug 2, 2016

@DirtyF I like it! A couple thoughts:

  1. Should this go above post_url as it's a superset of its functionality?
  2. Should we show an example with linking to a page or post? It works with everything AFAIR.

@parkr parkr added the documentation label Aug 2, 2016

@DirtyF

This comment has been minimized.

Show comment
Hide comment
@DirtyF

DirtyF Aug 2, 2016

Member

@parkr Done but you should know that It does not seem to work with everything yet.

One can link to collection's document or a post but I didn't manage to link to a page.

For example on the jekyll website, if I try to link to the help index page:
{% link help/index.md %}

Jekyll will throw an error:
Liquid Exception: Could not find document 'help/index.md' in tag 'link'. Make sure the document exists and the path is correct.

Update : fixed with #5199

Member

DirtyF commented Aug 2, 2016

@parkr Done but you should know that It does not seem to work with everything yet.

One can link to collection's document or a post but I didn't manage to link to a page.

For example on the jekyll website, if I try to link to the help index page:
{% link help/index.md %}

Jekyll will throw an error:
Liquid Exception: Could not find document 'help/index.md' in tag 'link'. Make sure the document exists and the path is correct.

Update : fixed with #5199

[docs] link tag example for a post
* put link tag before post_url
* example of link to a post with link tag

jeffkole added a commit to jeffkole/jekyll that referenced this pull request Aug 3, 2016

Adds ability to link to all files
Fixes request made in #4624 and bug found in #5182
@DirtyF

This comment has been minimized.

Show comment
Hide comment
@DirtyF

DirtyF Aug 4, 2016

Member

@parkr Documentation has been updated as you asked.

depends on #5199

Member

DirtyF commented Aug 4, 2016

@parkr Documentation has been updated as you asked.

depends on #5199

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Aug 7, 2016

Member

depends on #5199

Can you mention in the documentation that this is unreleased?

Member

parkr commented Aug 7, 2016

depends on #5199

Can you mention in the documentation that this is unreleased?

@parkr parkr merged commit 50854d2 into jekyll:master Aug 7, 2016

1 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
jekyll/lgtm Awaiting approval from at least 2 maintainers.
continuous-integration/travis-ci/pr The Travis CI build passed
Details

parkr added a commit that referenced this pull request Aug 7, 2016

templates.md: {% link %} tag only accepts collection documents
Remove examples of pages/static file links until it's released.
#5182 #5199

parkr added a commit that referenced this pull request Aug 7, 2016

@DirtyF DirtyF deleted the DirtyF:doc-link-tag branch Aug 7, 2016

@tomjoht

This comment has been minimized.

Show comment
Hide comment
@tomjoht

tomjoht Aug 8, 2016

Contributor

In looking at the Templates page, it's unclear how the Post URL section that immediately follows the Link section differs. Does Link provide a way to link to a collection that was not possible with post_url?

Now that we have link, do we still need the post_url approach? I think the post_url section may just need to be deleted. At the very least, some kind of note needs to appear in Post URL that that explains the difference between using link or post_url.

Contributor

tomjoht commented Aug 8, 2016

In looking at the Templates page, it's unclear how the Post URL section that immediately follows the Link section differs. Does Link provide a way to link to a collection that was not possible with post_url?

Now that we have link, do we still need the post_url approach? I think the post_url section may just need to be deleted. At the very least, some kind of note needs to appear in Post URL that that explains the difference between using link or post_url.

@tomjoht

This comment has been minimized.

Show comment
Hide comment
@tomjoht

tomjoht Aug 8, 2016

Contributor

Also, there's a small typo:

If you would like to include a link to a collection’s document, or a post the

Should be:

If you would like to include a link to a collection’s document or a post, the

Contributor

tomjoht commented Aug 8, 2016

Also, there's a small typo:

If you would like to include a link to a collection’s document, or a post the

Should be:

If you would like to include a link to a collection’s document or a post, the

@DirtyF

This comment has been minimized.

Show comment
Hide comment
@DirtyF

DirtyF Aug 8, 2016

Member

some kind of note needs to appear in Post URL that that explains the difference between using link or post_url.

The only difference is that you don't need to specify file extension with post_url whereas you have to specify the extension with link. It is duly noted in the documentation.

The tag names seem pretty explanatory to me. If it's not obvious enough, we could add something like:

link is a generic tag that will allow you to link to different type of resources : pages, posts, collection's documents and static files whereas post_urlcan only link to posts. (depends on #5199)

Member

DirtyF commented Aug 8, 2016

some kind of note needs to appear in Post URL that that explains the difference between using link or post_url.

The only difference is that you don't need to specify file extension with post_url whereas you have to specify the extension with link. It is duly noted in the documentation.

The tag names seem pretty explanatory to me. If it's not obvious enough, we could add something like:

link is a generic tag that will allow you to link to different type of resources : pages, posts, collection's documents and static files whereas post_urlcan only link to posts. (depends on #5199)

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