Ssl and localhost

Because my site is all SSL i set my baseurl to reflect that:

baseurl: https://example.com/

This caused some problems when developing locally because all generated links point to https://localhost:1313. I figured i could set the URLs to be relative somehow and found this

canonifyurls: false

However, that isn’t actually working. All my generated URLs still contain the domain. I’ve restarted the server and all that. Am i missing something?

$  hugo version
Hugo Static Site Generator v0.13-DEV buildDate: 2014-11-24T18:04:18-05:00

I noticed this too. In my case, all URLs which is generated by {{ .RelPermalink }} are OK but the menu items URLs are overwritten by baseUrl + menu item’s URL even if canonifyurls is disabled. It seems to be caused by https://github.com/spf13/hugo/blob/master/hugolib/site.go#L613 but simply removing it may cause the other problems.

Forgot to write what version I use. Mine is

$ ./hugo version
Hugo Static Site Generator v0.13-DEV-01EC44A BuildDate: 2015-01-23T06:56:32+09:00

The current tip.

The line in question is mine.

I tried describe some of this mess here:

But you could avoid this by

hugo server -b http://localhost:1313

I believe I have cleaned up this mess with this commit:

Please test and shout if it doesn’t work …

1 Like