From d5e96757a56bb72cce353cf296ea98adb8f35a71 Mon Sep 17 00:00:00 2001 From: DirtyF Date: Tue, 2 Aug 2016 20:24:30 +0200 Subject: [PATCH] [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