Is it possible to mount iCloud directory to Content?

I tried mounting iCloud directory (absolute path) but it doesn’t seem to be working. Is this the right way of doing it?

config.toml

[module]
[[module.mounts]]
  source = '/Users/<user>/Library/Mobile\ Documents/27N4MQEA55\~pro\~writer/Documents/site-content'
  target = 'content'
[[module.mounts]]
  source = 'example'
  target = 'content'

First, do not escape any of the characters:

[[module.mounts]]
source = '/Users/<user>/Library/Mobile Documents/27N4MQEA55~pro~writer/Documents/site-content'
target = 'content'

Second, if you want to include content from the content directory in the root of your project, make sure to include the default mount:

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

Thank you! That works… However when I create hugo new "some content" it ends up in “Content” directory and not the iCloud folder.
Is that how mounts are supposed to work?

Yes, that is how mounts are supposed to work.

Ok… I am thinking to set an environment variable in bashrc to shorten the long path, As I still want to get benefitted from Hugo archetypes. Do you think of any better ways?

Why do you want the content files in iCloud?

I am trying to create a workflow where I can manage my content through “iAWriter” (Mac & iOS) so that the data is synced across.

You might consider creating a symbolic link.

Or, perhaps you can configure iCloud to sync your project’s content directory, instead of placing the content directory in the iCloud path.

1 Like

Makes sense… I try to over complicate things sometimes. :slight_smile:

Symbolic link works (If any one else wants to know)

1 Like

I keep my whole Hugo directory in an iCloud folder at ~/Blog - the only gotcha was setting the build directory to be outside of iCloud because the sync kind of freaks out with a bunch of page generation. I set build to /tmp/blog and it works great.

1 Like

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