# How to replace symlinks to single files?

**URL:** <https://discourse.gohugo.io/t/how-to-replace-symlinks-to-single-files/48869>\
**Category:** support\
**Tags:** v0-123-x\
**Created:** [March 16, 2024, 1:05pm UTC](https://discourse.gohugo.io/t/how-to-replace-symlinks-to-single-files/48869 "2024-03-16T13:05:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbsilva](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jbsilva](https://discourse.gohugo.io/u/jbsilva)\
**Post date:** [March 16, 2024, 1:05pm UTC](https://discourse.gohugo.io/t/how-to-replace-symlinks-to-single-files/48869/1 "2024-03-16T13:05:45Z")

</div>

Hello.

My website relies **heavily** on symlinks, but I see they are no longer supported ([Remove symlink support for the input files · Issue #11556 · gohugoio/hugo · GitHub](https://github.com/gohugoio/hugo/issues/11556)).

I was able to replace symlinks to folders with module.mounts in hugo.yaml, but symlinks to files fail with “mount target must be one of: [archetypes assets content data i18n layouts static]”.

Hardlinks would work with Hugo, but not so well with Git as symlinks do.

This is only about symlinks inside the Hugo repo. Some of my content are in different repos that have symlinks themselves. They also broke and I have no idea how to fix.

BTW, is it possible to “mount” Hugo’s union file system?  
I would like to continue having visility of my folder structure.

---

<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:** [March 16, 2024, 1:18pm UTC](https://discourse.gohugo.io/t/how-to-replace-symlinks-to-single-files/48869/2 "2024-03-16T13:18:49Z")

</div>

This works with v0.123.8 and later (and maybe earlier too):

```plaintext
[[module.mounts]]
source = 'foo.md'
target = 'content/foo.md'

```

But remember to include the default mount:

```plaintext
[[module.mounts]]
source = 'content'
target = 'content'

[[module.mounts]]
source = 'foo.md'
target = 'content/foo.md'

```

---

<div class="post-metadata">

**Author:** ![jbsilva](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jbsilva](https://discourse.gohugo.io/u/jbsilva)\
**Post date:** [March 16, 2024, 2:32pm UTC](https://discourse.gohugo.io/t/how-to-replace-symlinks-to-single-files/48869/3 "2024-03-16T14:32:48Z")

</div>

Thanks for the quick answer.  
I see my mistake: I was trying to mount something outside of a component folder.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [March 20, 2024, 11:42am UTC](https://discourse.gohugo.io/t/how-to-replace-symlinks-to-single-files/48869/5 "2024-03-20T11:42:55Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
