Verified Commit 7d39ac88 authored by Aral Balkan's avatar Aral Balkan
Browse files

Possible fix for #199

parent 0868e846
......@@ -187,8 +187,7 @@ function serve (args) {
process.exit(1)
} else {
const options = {
let options = {
domain,
path,
port,
......@@ -197,6 +196,11 @@ function serve (args) {
aliases
}
if (syncRequested) {
// Add the syncHost
options.syncHost = syncOptions.host
}
// Start serving the site.
let site
try {
......
......@@ -469,7 +469,14 @@ class Site {
const localBaseURL = `https://localhost${mountPath}`
const globalBaseURL = `https://${Site.hostname}${mountPath}`
const baseURL = this.global ? globalBaseURL : localBaseURL
let baseURL = this.global ? globalBaseURL : localBaseURL
// If a syncHost is provided (because we are about to sync), that overrides the calculated base
// URL as we are generating the content not for localhost or the current machine’s hostname but
// for the remote machine’s host name.
if (options.syncHost !== undefined) {
baseURL = `https://${options.syncHost}`
}
// Start the server and await the end of the build process.
let hugoServerProcess, hugoBuildOutput
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment