Specify site creation location

I apologize if this question has already been answered and I’m just not finding it/using the wrong terminology in my searches. I have tried to find the answer searching YouTube tutorials, official documentation, and also this forum. I suppose I could assume the inability to find the answer is an answer in of itself but I just want to make sure.

I run a home file server for all of my documents. Just Ubuntu server on an old pc in the basement that I connect to via SMB with my various devices.

My folder structure is based on a main “Projects” folder and then individual “Project” sub-folders. The actual projects aren’t necessarily websites. They may just be images, or notes, or documents, etc.

My question is related to HUGO’s site creation.

Are you able to specify a specific location/folder for HUGO to create the website files in or do the sites/files have to be “in” the HUGO application/location?

Furthermore, if you are able to specify the location of the website/files does it matter which machine (server vs another pc/laptop on the network) is running HUGO? For the testing server to work I would think that HUGO would need to be running on the machine hosting the files, but then the chosen editor could be on any machine.

Thank you very much and I apologize for any confusion or inconvenience!

No.

For example:

  1. Install the prebuilt binary for your OS/architecture in /usr/local/sbin
  2. Make sure /usr/local/sbin is in your PATH
  3. cd $HOME
  4. hugo new site /media/user/some_id/foo

You just created a new site on some removable media.

To build the site you can either cd into the project directory and run hugo, or run hugo --source /media/user/some_id/foo.

You can also change the location of the published site with the --destination flag.

1 Like

Thank you very much!

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