Dirty hack to add summary img as hero background
parent
a73ab8bed5
commit
e089d4b02a
|
@ -7,8 +7,14 @@
|
||||||
<link rel="stylesheet" href="{{ $styleCustom.Permalink }}">
|
<link rel="stylesheet" href="{{ $styleCustom.Permalink }}">
|
||||||
<!-- tbh I am too lazy to extend Bulma, so put dirty CSS directives here to be able to use Hugo templating system -->
|
<!-- tbh I am too lazy to extend Bulma, so put dirty CSS directives here to be able to use Hugo templating system -->
|
||||||
<style>
|
<style>
|
||||||
{{ $bg := resources.Get "img/hero_home.png" }}
|
/* Default to home image */
|
||||||
.has-bg-img { background: url('{{ $bg.Permalink }}')center center; background-size:cover; }
|
{{ $image := resources.Get "img/hero_home.png" }}
|
||||||
|
{{ $imageURL := $image.Permalink }}
|
||||||
|
/* If header image exists in current context, use it instead */
|
||||||
|
{{ with .Resources.GetMatch "top.jpg" }}
|
||||||
|
{{ $imageURL = .Permalink }}
|
||||||
|
{{ end }}
|
||||||
|
.has-bg-img { background: url('{{ $imageURL }}')center center; background-size:cover; }
|
||||||
</style>
|
</style>
|
||||||
<!-- Favico -->
|
<!-- Favico -->
|
||||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<header>
|
<header>
|
||||||
<section class="hero is-primary has-text-centered is-medium">
|
<section class="hero has-bg-img is-primary has-text-centered is-large">
|
||||||
<div class="hero-head mx-5">
|
<div class="hero-head mx-5">
|
||||||
<div class="level subtitle is-5">
|
<div class="level subtitle is-5">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
|
|
Loading…
Reference in New Issue