Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header background isn't relative to site baseURL #26

Open
alanorth opened this issue Nov 30, 2015 · 3 comments
Open

Header background isn't relative to site baseURL #26

alanorth opened this issue Nov 30, 2015 · 3 comments

Comments

@alanorth
Copy link

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

@ethanmad
Copy link
Contributor

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.

@alanorth
Copy link
Author

alanorth commented Dec 1, 2015

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).

@ethanmad
Copy link
Contributor

ethanmad commented Dec 1, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants