Home
Support Forums

Can I have my own website and hugo website at the same time?

Hello! I’m trying to understand how to make this but I’m not successful so far. What I want to do is to on my main domain have my hand-coded website: www.examplewebsite.com = to my hand-coded files while I want to run Hugo blogs on blog.examplewebsite.com I have tried different branches and stuff like that but it always gives me build error. What should I do to achieve this? and is this even possible?

Yes it’s totally possible using branch deploys. The error you’re getting might not be related to having 2 websites. Maybe if you share the build log (or the Git repo), we can help you better.

6:20:55 PM: Build ready to start
6:20:57 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
6:20:57 PM: build-image tag: v3.4.1
6:20:57 PM: buildbot version: 9c8ae11ff96d61099561d579a91d03dc24930de5
6:20:57 PM: Fetching cached dependencies
6:20:57 PM: Starting to download cache of 120.7MB
6:21:00 PM: Finished downloading cache in 3.20256171s
6:21:00 PM: Starting to extract cache
6:21:01 PM: Finished extracting cache in 968.603349ms
6:21:01 PM: Finished fetching cache in 4.204035124s
6:21:01 PM: Starting to prepare the repo for build
6:21:02 PM: Preparing Git Reference refs/heads/master
6:21:08 PM: Starting build script
6:21:08 PM: Installing dependencies
6:21:08 PM: Python version set to 2.7
6:21:10 PM: v12.18.0 is already installed.
6:21:10 PM: Now using node v12.18.0 (npm v6.14.4)
6:21:10 PM: Started restoring cached build plugins
6:21:10 PM: Finished restoring cached build plugins
6:21:11 PM: Attempting ruby version 2.7.1, read from environment
6:21:12 PM: Using ruby version 2.7.1
6:21:12 PM: Using PHP version 5.6
6:21:12 PM: 5.2 is already installed.
6:21:12 PM: Using Swift version 5.2
6:21:12 PM: Started restoring cached go cache
6:21:12 PM: Finished restoring cached go cache
6:21:12 PM: go version go1.14.4 linux/amd64
6:21:12 PM: go version go1.14.4 linux/amd64
6:21:12 PM: Installing missing commands
6:21:12 PM: Verify run directory
6:21:13 PM: ​
6:21:13 PM: ┌─────────────────────────────┐
6:21:13 PM: │ Netlify Build │
6:21:13 PM: └─────────────────────────────┘
6:21:13 PM: ​
6:21:13 PM: ❯ Version
6:21:13 PM: @netlify/build 5.2.1
6:21:13 PM: ​
6:21:13 PM: ❯ Flags
6:21:13 PM: deployId: 5fa1917742f1db0c31362c05
6:21:13 PM: mode: buildbot
6:21:13 PM: ​
6:21:13 PM: ❯ Current directory
6:21:13 PM: /opt/build/repo
6:21:13 PM: ​
6:21:13 PM: ❯ Config file
6:21:13 PM: No config file was defined: using default values.
6:21:13 PM: ​
6:21:13 PM: ❯ Context
6:21:13 PM: production
6:21:13 PM: ​
6:21:13 PM: ┌───────────────────────────────────┐
6:21:13 PM: │ 1. Build command from Netlify app │
6:21:13 PM: └───────────────────────────────────┘
6:21:13 PM: ​
6:21:13 PM: $ yarn build
6:21:13 PM: bash: yarn: command not found
6:21:13 PM: ​
6:21:13 PM: ┌─────────────────────────────┐
6:21:13 PM: │ “build.command” failed │
6:21:13 PM: └─────────────────────────────┘
6:21:13 PM: ​
6:21:13 PM: Error message
6:21:13 PM: Command failed with exit code 127: yarn build
6:21:13 PM: ​
6:21:13 PM: Error location
6:21:13 PM: In Build command from Netlify app:
6:21:13 PM: yarn build
6:21:13 PM: ​
6:21:13 PM: Resolved config
6:21:13 PM: build:
6:21:13 PM: command: yarn build
6:21:13 PM: commandOrigin: ui
6:21:13 PM: publish: /opt/build/repo/dist
6:21:14 PM: Caching artifacts
6:21:14 PM: Started saving build plugins
6:21:14 PM: Finished saving build plugins
6:21:14 PM: Started saving pip cache
6:21:14 PM: Finished saving pip cache
6:21:14 PM: Started saving emacs cask dependencies
6:21:14 PM: Finished saving emacs cask dependencies
6:21:14 PM: Started saving maven dependencies
6:21:14 PM: Finished saving maven dependencies
6:21:14 PM: Started saving boot dependencies
6:21:14 PM: Finished saving boot dependencies
6:21:14 PM: Started saving go dependencies
6:21:14 PM: Finished saving go dependencies
6:21:17 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:21:17 PM: Failing build: Failed to build site
6:21:17 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
6:21:17 PM: Finished processing build request in 19.666719167s

I just noticed it shows yarn command not found, but it shows the same for all commands such as hugo etc…

Well, when yarn is not found, it has various reasons like mentioned here: 'bash: yarn: command not found' error

I don’t see why hugo command can’t be found. How exactly are you building it? Are you using any Node Modules with your Hugo website?

1 Like

Now my hugo command is detected, but there is this problem: Here is the log
7:59:02 PM: Build ready to start
7:59:04 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
7:59:04 PM: build-image tag: v3.4.1
7:59:04 PM: buildbot version: 9c8ae11ff96d61099561d579a91d03dc24930de5
7:59:04 PM: Fetching cached dependencies
7:59:04 PM: Starting to download cache of 120.7MB
7:59:05 PM: Finished downloading cache in 1.03356207s
7:59:05 PM: Starting to extract cache
7:59:06 PM: Finished extracting cache in 993.281004ms
7:59:06 PM: Finished fetching cache in 2.058130649s
7:59:06 PM: Starting to prepare the repo for build
7:59:06 PM: Preparing Git Reference refs/heads/master
7:59:14 PM: Starting build script
7:59:14 PM: Installing dependencies
7:59:14 PM: Python version set to 2.7
7:59:15 PM: v12.18.0 is already installed.
7:59:16 PM: Now using node v12.18.0 (npm v6.14.4)
7:59:16 PM: Started restoring cached build plugins
7:59:16 PM: Finished restoring cached build plugins
7:59:16 PM: Attempting ruby version 2.7.1, read from environment
7:59:17 PM: Using ruby version 2.7.1
7:59:18 PM: Using PHP version 5.6
7:59:18 PM: 5.2 is already installed.
7:59:18 PM: Using Swift version 5.2
7:59:18 PM: Started restoring cached go cache
7:59:18 PM: Finished restoring cached go cache
7:59:18 PM: go version go1.14.4 linux/amd64
7:59:18 PM: go version go1.14.4 linux/amd64
7:59:18 PM: Installing missing commands
7:59:18 PM: Verify run directory
7:59:19 PM: ​
7:59:19 PM: ┌─────────────────────────────┐
7:59:19 PM: │ Netlify Build │
7:59:19 PM: └─────────────────────────────┘
7:59:19 PM: ​
7:59:19 PM: ❯ Version
7:59:19 PM: @netlify/build 5.2.1
7:59:19 PM: ​
7:59:19 PM: ❯ Flags
7:59:19 PM: deployId: 5fa1a8761c1e7c010b456474
7:59:19 PM: mode: buildbot
7:59:19 PM: ​
7:59:19 PM: ❯ Current directory
7:59:19 PM: /opt/build/repo
7:59:19 PM: ​
7:59:19 PM: ❯ Config file
7:59:19 PM: No config file was defined: using default values.
7:59:19 PM: ​
7:59:19 PM: ❯ Context
7:59:19 PM: production
7:59:19 PM: ​
7:59:19 PM: ┌───────────────────────────────────┐
7:59:19 PM: │ 1. Build command from Netlify app │
7:59:19 PM: └───────────────────────────────────┘
7:59:19 PM: ​
7:59:19 PM: $ hugo
7:59:19 PM: Building sites … Total in 0 ms
7:59:19 PM: Error: Error building site: open /opt/build/repo/content: no such file or directory
7:59:19 PM: ​
7:59:19 PM: ┌─────────────────────────────┐
7:59:19 PM: │ “build.command” failed │
7:59:19 PM: └─────────────────────────────┘
7:59:19 PM: ​
7:59:19 PM: Error message
7:59:19 PM: Command failed with exit code 255: hugo
7:59:19 PM: ​
7:59:19 PM: Error location
7:59:19 PM: In Build command from Netlify app:
7:59:19 PM: hugo
7:59:19 PM: ​
7:59:19 PM: Resolved config
7:59:19 PM: build:
7:59:19 PM: command: hugo
7:59:19 PM: commandOrigin: ui
7:59:19 PM: publish: /opt/build/repo/dist
7:59:19 PM: Caching artifacts
7:59:19 PM: Started saving build plugins
7:59:19 PM: Finished saving build plugins
7:59:19 PM: Started saving pip cache
7:59:19 PM: Finished saving pip cache
7:59:19 PM: Started saving emacs cask dependencies
7:59:19 PM: Finished saving emacs cask dependencies
7:59:19 PM: Started saving maven dependencies
7:59:19 PM: Finished saving maven dependencies
7:59:19 PM: Started saving boot dependencies
7:59:19 PM: Finished saving boot dependencies
7:59:19 PM: Started saving go dependencies
7:59:19 PM: Finished saving go dependencies
7:59:22 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:59:22 PM: Failing build: Failed to build site
7:59:22 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
7:59:22 PM: Finished processing build request in 18.324030601s

It says, there’s no folder called content in your repository.

I didn’t specify that folder anywhere, hmm.

It has to be somewhere. Either in your netlify.toml file or in your dashboard.

1 Like

I have managed to fix this issue by making a new netlify.toml file and configuring it myself. Thank you for your time and effort!