Using {{.Site.BaseURL}} results in a 404

I must be doing something wrong here; I’m using

<link href="{{.Site.BaseURL}}css/style.css" rel="stylesheet">

in a template called baseof.html in the /layouts/_default folder/, and while that outputs

<link href="//localhost:1313/css/style.css" rel="stylesheet">

in page source, that link 404’s and style.css doesn’t load. style.css is at layouts/css/style.css

I’m using baseURL = "" in config.toml. Running hugo server -D on OS X,

Any ideas?

Hi,

I would suggest composing your urls using absURL and relURL instead.

Also, you probably need to specify a value for baseURL.

Neither absURL or relURL work, even with http://example.com as a baseURL in config.

Put the css file in the static folder, not layouts.

That works - thanks! I’ve never heard of a static folder.