fix lack of baseurl being applied to background-image url.

master
David Kebler 2017-04-07 20:28:56 -07:00
parent 9c4260d49e
commit 328149ed51
3 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,6 @@
<!-- Configurable Styles partial to appear in head -->
<style>
{{ with .Site.Params.font }}
body { font-family:{{ . }},Helvetica,Arial,sans-serif; }
{{ end }}
@ -46,12 +47,14 @@
{{ with .hero }}
{{ with .img }}
{{ with $.Site.Params.imagespath }} {{ $.Scratch.Set "path" ( . ) }} {{ else }}{{ $.Scratch.Set "path" "/images/" }}{{ end }}
#hero {
background-image: url("{{ $.Scratch.Get "path" }}{{ . }}");
}
{{ with $.Site.Params.imagespath }}
{{ $.Scratch.Set "path" ( . ) }}
{{ else }}
{{ $.Scratch.Set "path" ( printf "%s/images/" ( $.Site.BaseURL | default "" ) ) }}
{{ end }}
#hero {
background-image: url("{{ $.Scratch.Get "path" }}{{ .img | default "hero.jpg" }}");
}
{{ with .font }}
#hero > .section__container { font-family:{{ . }},Helvetica,Arial,sans-serif;}

View File

@ -4,7 +4,7 @@
### TL;DR
For those who are Hugo experienced and know what they are doing and are able to “figure out” the details simply clone the [guide repo](https://dkebler.github.io/landingpage-guide). Edit the markdown files in the /sections directory and settings in config.toml. To start from scratch by all means just clone (or submodule) this theme into an existing hugo projects themes folder. If you need to cheat and see ths guide it's [here](https://dkebler.github.io/landingpage-guide/#tldr)
For those who are Hugo experienced and know what they are doing and are able to “figure out” the details simply clone the [guide repo](https://github.com/dkebler/landingpage-guide). Edit the markdown files in the /sections directory and settings in config.toml. To start from scratch by all means just clone (or submodule) this theme into an existing hugo projects themes folder. If you need to cheat and see ths guide it's [here](https://dkebler.github.io/landingpage-guide/#tldr)
### About

View File

@ -139,7 +139,6 @@
Hero Section
---------------- */
#hero {
background-image: url("/images/hero.jpg");
background-size: cover;
background-position: center;
display: flex;