By hdlopes
When deploying a Hugo site as a DigitalOcean app, is there a way to get it working if the hugo site is not at the root of the repository? I have a “site” directory with the hugo site along with other directories at the root.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
Hi @hdlopes, this option is currently supported by the app specification, but not the web control panel so you will need to make this change using either doctl or the API.
On your hugo component, set the source_dir option to the name of the subdirectory that your Hugo site lives in. It will then be used as the working directory for the build.
For example:
...
static_sites:
- name: hugo
source_dir: website
...
See the App Specification reference.
To make this change using doctl, follow these steps:
doctl apps listdoctl apps spec get APP-UUID > app.yamlapp.yaml in a text editor and add the source_dir property.doctl apps update --spec app.yaml APP-UUID. This will kick off a new deploymentGet paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.