From bf8c15f9490d889a69af2dd952240bfb703e7cf4 Mon Sep 17 00:00:00 2001 From: DirtyF Date: Tue, 2 Aug 2016 09:28:36 +0200 Subject: [PATCH 1/4] [docs] Document link Liquid tag --- site/_docs/templates.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index 19f1ca7c..a6c9f639 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -488,6 +488,24 @@ You can also use this tag to create a link to a post in Markdown as follows: {% endraw %} {% endhighlight %} +### Link + +If you would like to include a link to a collection's document, the `link` tag will generate the correct permalink URL for the document path you specify. You must include the file extension when using the `link` tag. + +{% highlight liquid %} +{% raw %} +{% link _collection/name-of-document.md %} +{% endraw %} +{% endhighlight %} + +You can also use this tag to create a link to a collection's document in Markdown as follows: + +{% highlight liquid %} +{% raw %} +[Name of Link]({% link _collection/name-of-document.md %}) +{% endraw %} +{% endhighlight %} + ### Gist Use the `gist` tag to easily embed a GitHub Gist onto your site. This works From d5e96757a56bb72cce353cf296ea98adb8f35a71 Mon Sep 17 00:00:00 2001 From: DirtyF Date: Tue, 2 Aug 2016 20:24:30 +0200 Subject: [PATCH 2/4] [docs] link tag example for a post * put link tag before post_url * example of link to a post with link tag --- site/_docs/templates.md | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index a6c9f639..18bf3abd 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -458,6 +458,25 @@ site. If you use `linenos`, you might want to include an additional CSS class definition for the `.lineno` class in `syntax.css` to distinguish the line numbers from the highlighted code. +### Link + +If you would like to include a link to a collection's document or to a post, the `link` tag will generate the correct permalink URL for the path you specify. You must include the file extension when using the `link` tag. + +{% highlight liquid %} +{% raw %} +{% link _collection/name-of-document.md %} +{% link _posts/2016-07-26-name-of-post.md %} +{% endraw %} +{% endhighlight %} + +You can also use this tag to create a link in Markdown as follows: + +{% highlight liquid %} +{% raw %} +[Name of Link]({% link _collection/name-of-document.md %}) +{% endraw %} +{% endhighlight %} + ### Post URL If you would like to include a link to a post on your site, the `post_url` tag @@ -488,24 +507,6 @@ You can also use this tag to create a link to a post in Markdown as follows: {% endraw %} {% endhighlight %} -### Link - -If you would like to include a link to a collection's document, the `link` tag will generate the correct permalink URL for the document path you specify. You must include the file extension when using the `link` tag. - -{% highlight liquid %} -{% raw %} -{% link _collection/name-of-document.md %} -{% endraw %} -{% endhighlight %} - -You can also use this tag to create a link to a collection's document in Markdown as follows: - -{% highlight liquid %} -{% raw %} -[Name of Link]({% link _collection/name-of-document.md %}) -{% endraw %} -{% endhighlight %} - ### Gist Use the `gist` tag to easily embed a GitHub Gist onto your site. This works From 50854d2f76e77f93939c887ed5e7521390e0df9b Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 4 Aug 2016 10:55:53 +0200 Subject: [PATCH 3/4] add more link tag usage examples --- site/_docs/templates.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index 18bf3abd..087ca940 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -460,12 +460,16 @@ numbers from the highlighted code. ### Link -If you would like to include a link to a collection's document or to a post, the `link` tag will generate the correct permalink URL for the path you specify. You must include the file extension when using the `link` tag. +If you would like to include a link to a collection's document, a post, a page or a file the `link` tag will generate the correct permalink URL for the path you specify. + +You must include the file extension when using the `link` tag. {% highlight liquid %} {% raw %} {% link _collection/name-of-document.md %} {% link _posts/2016-07-26-name-of-post.md %} +{% link news/index.html %} +{% link /assets/files/doc.pdf %} {% endraw %} {% endhighlight %} @@ -473,7 +477,10 @@ You can also use this tag to create a link in Markdown as follows: {% highlight liquid %} {% raw %} -[Name of Link]({% link _collection/name-of-document.md %}) +[Link to a document]({% link _collection/name-of-document.md %}) +[Link to a post]({% link _posts/2016-07-26-name-of-post.md %}) +[Link to a page]({% link news/index.html %}) +[Link to a file]({% link /assets/files/doc.pdf %}) {% endraw %} {% endhighlight %} From ab4abb19332c71307a3e052746e65ff62d305b38 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 7 Aug 2016 11:54:32 -0700 Subject: [PATCH 4/4] templates.md: {% link %} tag only accepts collection documents Remove examples of pages/static file links until it's released. #5182 #5199 --- site/_docs/templates.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index 087ca940..307916e4 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -460,7 +460,9 @@ numbers from the highlighted code. ### Link -If you would like to include a link to a collection's document, a post, a page or a file the `link` tag will generate the correct permalink URL for the path you specify. +If you would like to include a link to a collection's document, or a post +the `link` tag will generate the correct permalink URL for the path you +specify. You must include the file extension when using the `link` tag. @@ -468,8 +470,6 @@ You must include the file extension when using the `link` tag. {% raw %} {% link _collection/name-of-document.md %} {% link _posts/2016-07-26-name-of-post.md %} -{% link news/index.html %} -{% link /assets/files/doc.pdf %} {% endraw %} {% endhighlight %} @@ -479,11 +479,12 @@ You can also use this tag to create a link in Markdown as follows: {% raw %} [Link to a document]({% link _collection/name-of-document.md %}) [Link to a post]({% link _posts/2016-07-26-name-of-post.md %}) -[Link to a page]({% link news/index.html %}) -[Link to a file]({% link /assets/files/doc.pdf %}) {% endraw %} {% endhighlight %} +Support for static files and pages is coming in a later release but is +**not** released as of v3.2.1. + ### Post URL If you would like to include a link to a post on your site, the `post_url` tag