# Error when using ref in modules

**URL:** <https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703>\
**Category:** support\
**Tags:** modules\
**Created:** [October 17, 2023, 12:21pm UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703 "2023-10-17T12:21:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Hayter](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@John\_Hayter](https://discourse.gohugo.io/u/John_Hayter)\
**Post date:** [October 17, 2023, 12:21pm UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/1 "2023-10-17T12:21:54Z")

</div>

I’ve got a site (Site A) which creates a site. I want to reuse content from Site A in Site B. I import it using modules - but `ref` links fail.

I can use `ref` to create links in Site A. But those same links fail in Site B.

I hope I’m doing something fundamentally wrong. I should note that both sites are designed for offline use, so I’ve got

```auto
baseURL: "/"
uglyurls: true
relativeURLs: true
canonifyURLs: false

```

I’ve reproduced it on a Github repo at [https://github.com/honzik20/whatsNew](https://github.com/honzik20/whatsNew). It imports from a module at [https://github.com/honzik20/whatsNewContent](https://github.com/honzik20/whatsNewContent). That module has a file 2.21.md with the two links. You can only build the site if the “ref” link is removed…

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 18, 2023, 12:54am UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/2 "2023-10-18T00:54:48Z")

</div>

I am unable to access the content repository.

---

<div class="post-metadata">

**Author:** ![John\_Hayter](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@John\_Hayter](https://discourse.gohugo.io/u/John_Hayter)\
**Post date:** [October 19, 2023, 8:39am UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/3 "2023-10-19T08:39:45Z")

</div>

My apologies @jmooring . I’ve made the repo public now.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 19, 2023, 9:15am UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/4 "2023-10-19T09:15:42Z")

</div>

You content repo has an index.md file in the root of the content directory. When the two content directories are merged, you’re telling Hugo that the content directoy is both a leaf bundle (index.md) and a branch bundle (\_index.md). That’s going to cause a page collision.

Or maybe I’m missing something.

---

<div class="post-metadata">

**Author:** ![John\_Hayter](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@John\_Hayter](https://discourse.gohugo.io/u/John_Hayter)\
**Post date:** [October 19, 2023, 10:47am UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/5 "2023-10-19T10:47:04Z")

</div>

No, you’re right. But our project only uses the 2.17.html and 2.20.html output. I don’t know of a way to prevent the homepage from building - we don’t need it.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 19, 2023, 6:46pm UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/6 "2023-10-19T18:46:03Z")

</div>

I’m not sure how to test this. This repo is essentially empty:  
[https://github.com/honzik20/whatsNewContent](https://github.com/honzik20/whatsNewContent)

---

<div class="post-metadata">

**Author:** ![John\_Hayter](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@John\_Hayter](https://discourse.gohugo.io/u/John_Hayter)\
**Post date:** [October 23, 2023, 10:47am UTC](https://discourse.gohugo.io/t/error-when-using-ref-in-modules/46703/7 "2023-10-23T10:47:19Z")

</div>

It’s supposed to import a single topic file. I’ll close this for now and produce a more obvious example. Thanks for looking - sorry I wasted your time @jmooring
