# Error Message When Using Link Tag

**URL:** <https://talk.jekyllrb.com/t/error-message-when-using-link-tag/7257>\
**Category:** Help\
**Created:** [April 22, 2022, 5:16am UTC](https://talk.jekyllrb.com/t/error-message-when-using-link-tag/7257 "2022-04-22T05:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devnoob](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/devnoob/32/4848_2.png) [@Devnoob](https://talk.jekyllrb.com/u/Devnoob)\
**Post date:** [April 22, 2022, 5:16am UTC](https://talk.jekyllrb.com/t/error-message-when-using-link-tag/7257/1 "2022-04-22T05:16:18Z")

</div>

Hi.

I use collections to separate my project’s posts according to their relation. The collections are placed into a specific folder defined in the \_config file with `collections_dir` variable.

Here is the portion from \_config file that configures my collections:

```auto
collections_dir: my_collections
collections:
  - topic-1
  - topic-2

```

Following this configuration, my project’s collection structure is set as follows:

```nohighlight
.
├── my_collections:
│ └── _drafts
│ └── _posts
│ └── _topic-1
│ └── introduction.md
│ └── _topic-2
│ └── tool-x-usage.md
...

```

In a post inside \_topic-1 I have a link to another post inside \_tips. I used `{% link %}` tag to set the link as is shown in the example bellow:

my\_collections/\_topic-1/introduction.md

```nohighlight
---
layout: post
---

A [link] ({% link /my_collections/_topic-2/tool-x-usage.md %})

```

When I run `bundle exec jekyll build` I get an error message as follows:

```nohighlight
Liquid Exception: Could not find document '/my_collections_topic-2/tool-x-usage.md' in tag 'link'. Make sure the document exists and the path is correct. in C:/Users/fern/Documents/jekyll/test/my_collections/_topic-2/tool-x-usage.md

```

If I comment out the `collection_dir` variable, the linking works perfectly, for some reason.

I would like to both keep my personalized `collection_dir` and still be able to use the {% link %} tag. Is that possible? What am I missing?

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [April 22, 2022, 1:27pm UTC](https://talk.jekyllrb.com/t/error-message-when-using-link-tag/7257/2 "2022-04-22T13:27:48Z")

</div>

Try passing the relative\_path without `/my_collections/`:

```nohighlight
A [link]({% link _topic-2/tool-x-usage.md %})

```

---

<div class="post-metadata">

**Author:** ![Devnoob](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/devnoob/32/4848_2.png) [@Devnoob](https://talk.jekyllrb.com/u/Devnoob)\
**Post date:** [April 23, 2022, 12:04am UTC](https://talk.jekyllrb.com/t/error-message-when-using-link-tag/7257/3 "2022-04-23T00:04:18Z")

</div>

Hi.

Thanks for the answer. In addition to the suggested modification, I had to modify the collections configuration to include the `output: true` in the collection metadata.

```auto
collections_dir: my_collections
collections:
  topic-1:
    output: true
  topic-2:
    output: true

```
