Add custom header image

Add support for configuring a custom header image from a page's front
matter, and use a new one for foundation.
This commit is contained in:
Basti 2022-07-02 17:07:23 +02:00
parent 7faf3602fd
commit 4f1d03ba5f
Signed by untrusted user: basti
GPG Key ID: 9F88009D31D99C72
11 changed files with 17 additions and 9 deletions

View File

@ -1,6 +1,7 @@
--- ---
title: Kosmos Infrastructure Foundation title: Kosmos Infrastructure Foundation
description: Providing physical infrastructure for Kosmos software and services description: Providing physical infrastructure for Kosmos software and services
headerImage: servers-01.jpg
menu: menu:
main: main:
identifier: foundation identifier: foundation

File diff suppressed because one or more lines are too long

BIN
public/img/network-01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 KiB

BIN
public/img/servers-01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
static/img/network-01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 KiB

BIN
static/img/servers-01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,15 @@
{{ define "main" }} {{ define "main" }}
<div class="w-full h-32 bg-[url('/img/lagoon-close-02.jpg')] {{ if .Params.HeaderImage }}
bg-[center_top_30rem] bg-cover"> <!-- <div class="w&#45;full h&#45;32 bg&#45;[center_bottom_23rem] bg&#45;cover" -->
</div> <!-- style="background&#45;image: url(/img/{{ .Params.HeaderImage }})"> -->
<div class="w-full h-32 bg-[center] bg-cover"
style="background-image: url(/img/{{ .Params.HeaderImage }})">
</div>
{{ else }}
<div class="w-full h-32 bg-[url('/img/lagoon-close-02.jpg')]
bg-[center_top_30rem] bg-cover">
</div>
{{ end }}
<div class="max-w-5xl mx-auto -mt-12 py-8 px-8 text-left bg-white"> <div class="max-w-5xl mx-auto -mt-12 py-8 px-8 text-left bg-white">
<header class="mb-8"> <header class="mb-8">
<h1 class="text-2xl font-bold">{{ .Title }}</h1> <h1 class="text-2xl font-bold">{{ .Title }}</h1>