vienna icon indicating copy to clipboard operation
vienna copied to clipboard

Header background isn't relative to site baseURL

Open alanorth opened this issue 10 years ago • 3 comments

If your site is not at the root, then the background doesn't work.

alanorth avatar Nov 30 '15 11:11 alanorth

I think this can be fixed with an edit at https://github.com/keichi/vienna/blob/master/layouts/partials/header.html#L13. Let me know if you need help with this.

ethanmad avatar Nov 30 '15 18:11 ethanmad

That's just the image used in the open graph protocol. I think the problem is a bit further down, in the CSS that sets the background image in the header—the image is always fetched relative to the root.

I tried to make the URL relative to the base URL using {{ .Site.BaseURL }}/images/bg.jpg but Go's template system said that wasn't safe.

For a single post I made it work by specifying the path to the image in the front matter:

image = "../images/bg.jpg"

But this only works on posts (for some reason specifying an "image" in the main config doesn't work there).

alanorth avatar Dec 01 '15 07:12 alanorth

I'll look into it when I get the chance and see if I can figure it out. Your first attempt looks right to me, but I'm no expert.

ethanmad avatar Dec 01 '15 21:12 ethanmad