summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/partials/home
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
committerChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
commite77051ccc4b47951bfa4fde2be436b1bb2fb113b (patch)
treef0b75ee3521da9c8cd39dac4359212348f70e4e8 /themes/blowfish/layouts/partials/home
parent4b355837824ac2422d371acef790f0f4249255c7 (diff)
use https://github.com/nunocoracao/blowfish.git
Diffstat (limited to 'themes/blowfish/layouts/partials/home')
-rw-r--r--themes/blowfish/layouts/partials/home/background.html88
-rw-r--r--themes/blowfish/layouts/partials/home/card.html43
-rw-r--r--themes/blowfish/layouts/partials/home/hero.html75
-rw-r--r--themes/blowfish/layouts/partials/home/page.html11
-rw-r--r--themes/blowfish/layouts/partials/home/profile.html37
5 files changed, 254 insertions, 0 deletions
diff --git a/themes/blowfish/layouts/partials/home/background.html b/themes/blowfish/layouts/partials/home/background.html
new file mode 100644
index 0000000..2549033
--- /dev/null
+++ b/themes/blowfish/layouts/partials/home/background.html
@@ -0,0 +1,88 @@
+{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
+<article class="max-w-full prose dark:prose-invert">
+ <div class="relative">
+ <div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
+ <div class="mx-auto max-w-7xl p-0">
+ <div class="relative sm:overflow-hidden">
+ <div class="fixed inset-x-0 top-0" style="z-index:-10">
+ {{ $homepageImage := "" }}
+ {{ with .Site.Params.defaultBackgroundImage }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $homepageImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $homepageImage = resources.Get . }}
+ {{ end }}
+ {{ end }}
+ {{ with .Site.Params.homepage.homepageImage }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $homepageImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $homepageImage = resources.Get . }}
+ {{ end }}
+ {{ end }}
+ {{ if $homepageImage }}
+ <img class="w-full h-[1000px] object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}" role="presentation">
+ <div
+ class="absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
+ </div>
+ <div
+ class="opacity-60 absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral-100 dark:to-neutral-800 mix-blend-normal">
+ </div>
+ {{ end }}
+ </div>
+ <div class="relative px-1 py-1 flex flex-col items-center justify-center text-center">
+ {{ with .Site.Author.image }}
+ {{ $authorImage := "" }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $authorImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $authorImage = resources.Get . }}
+ {{ end }}
+ {{ if $authorImage }}
+ {{ if not $disableImageOptimization }}
+ {{ $authorImage = $authorImage.Fill "288x288" }}
+ {{ end }}
+ <img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
+ alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
+ {{ end }}
+ {{ end }}
+ <h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
+ {{ .Site.Author.name | default .Site.Title }}
+ </h1>
+ {{ with .Site.Author.headline }}
+ <h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
+ {{ . | markdownify | emojify }}
+ </h2>
+ {{ end }}
+ <div class="mt-3 mb-10 text-2xl">
+ {{ with .Site.Author.links }}
+ <div class="flex flex-wrap">
+ {{ range $links := . }}
+ {{ range $name, $url := $links }}
+ <a class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200" href="{{ $url }}" target="_blank"
+ aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
+ "icon.html" $name }}</a>
+ {{ end }}
+ {{ end }}
+ </div>
+ {{ end }}
+ </div>
+ <section class="prose dark:prose-invert">{{ .Content | emojify }}</section>
+ </div>
+ </div>
+ </div>
+ </div>
+</article>
+<section>
+ {{ partial "recent-articles/main.html" . }}
+</section>
+{{ if .Site.Params.homepage.layoutBackgroundBlur | default false }}
+<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
+<script>
+ window.addEventListener('scroll', function (e) {
+ var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
+ var background_blur = document.getElementById('background-blur');
+ background_blur.style.opacity = (scroll / 300)
+ });
+</script>
+{{ end }}
diff --git a/themes/blowfish/layouts/partials/home/card.html b/themes/blowfish/layouts/partials/home/card.html
new file mode 100644
index 0000000..0b17f83
--- /dev/null
+++ b/themes/blowfish/layouts/partials/home/card.html
@@ -0,0 +1,43 @@
+<div class="relative pt-16 pb-32">
+ <div aria-hidden="true" class="absolute inset-x-0 top-0 h-48 bg-gradient-to-b from-gray-100"></div>
+ <div class="relative">
+ <div class="lg:mx-auto lg:grid lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-2 lg:gap-24 lg:px-8">
+ <div class="mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
+ <article class="max-w-full prose dark:prose-invert">
+ {{ with .Title }}
+ <header>
+ <h1>{{ . | emojify }}</h1>
+ </header>
+ {{ end }}
+ <section>{{ .Content | emojify }}</section>
+ </article>
+ </div>
+ <div class="mt-6 sm:mt-16 lg:mt-0 mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
+ <div class="-mr-48 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0" style="width:100%">
+ {{ $homepageImage := "" }}
+ {{ with .Site.Params.defaultBackgroundImage }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $homepageImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $homepageImage = resources.Get . }}
+ {{ end }}
+ {{ end }}
+ {{ with .Site.Params.homepage.homepageImage }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $homepageImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $homepageImage = resources.Get . }}
+ {{ end }}
+ {{ end }}
+ {{ if $homepageImage }}
+ <img class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
+ src="{{ $homepageImage.RelPermalink }}">
+ {{ end }}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<section>
+ {{ partial "recent-articles/main.html" . }}
+</section> \ No newline at end of file
diff --git a/themes/blowfish/layouts/partials/home/hero.html b/themes/blowfish/layouts/partials/home/hero.html
new file mode 100644
index 0000000..cb5933d
--- /dev/null
+++ b/themes/blowfish/layouts/partials/home/hero.html
@@ -0,0 +1,75 @@
+{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
+<article class="max-w-full prose dark:prose-invert">
+ <div class="relative">
+ <div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
+ <div class="mx-auto max-w-7xl p-0">
+ <div class="relative shadow-xl sm:overflow-hidden rounded-2xl">
+ <div class="absolute inset-0">
+ {{ $homepageImage := "" }}
+ {{ with .Site.Params.defaultBackgroundImage }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $homepageImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $homepageImage = resources.Get . }}
+ {{ end }}
+ {{ end }}
+ {{ with .Site.Params.homepage.homepageImage }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $homepageImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $homepageImage = resources.Get . }}
+ {{ end }}
+ {{ end }}
+ {{ if $homepageImage }}
+ <img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}">
+ <div
+ class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply">
+ </div>
+ {{ end }}
+ </div>
+ <div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
+ {{ with .Site.Author.image }}
+ {{ $authorImage := "" }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $authorImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $authorImage = resources.Get . }}
+ {{ end }}
+ {{ if $authorImage }}
+ {{ if not $disableImageOptimization }}
+ {{ $authorImage = $authorImage.Fill "288x288" }}
+ {{ end }}
+ <img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
+ alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
+ {{ end }}
+ {{ end }}
+ <h1 class="mb-2 text-4xl font-extrabold text-neutral-200">
+ {{ .Site.Author.name | default .Site.Title }}
+ </h1>
+ {{ with .Site.Author.headline }}
+ <h2 class="mt-0 mb-0 text-xl text-neutral-300">
+ {{ . | markdownify | emojify }}
+ </h2>
+ {{ end }}
+ <div class="mt-3 mb-10 text-2xl">
+ {{ with .Site.Author.links }}
+ <div class="flex flex-wrap">
+ {{ range $links := . }}
+ {{ range $name, $url := $links }}
+ <a class="px-1 hover:text-primary-400 text-primary-300" href="{{ $url }}" target="_blank"
+ aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
+ "icon.html" $name }}</a>
+ {{ end }}
+ {{ end }}
+ </div>
+ {{ end }}
+ </div>
+ <section class="prose prose-invert">{{ .Content | emojify }}</section>
+ </div>
+ </div>
+ </div>
+ </div>
+</article>
+<section>
+ {{ partial "recent-articles/main.html" . }}
+</section>
diff --git a/themes/blowfish/layouts/partials/home/page.html b/themes/blowfish/layouts/partials/home/page.html
new file mode 100644
index 0000000..d715b78
--- /dev/null
+++ b/themes/blowfish/layouts/partials/home/page.html
@@ -0,0 +1,11 @@
+<article class="max-w-full prose dark:prose-invert">
+ {{ with .Title }}
+ <header>
+ <h1>{{ . | emojify }}</h1>
+ </header>
+ {{ end }}
+ <section>{{ .Content | emojify }}</section>
+</article>
+<section>
+ {{ partial "recent-articles/main.html" . }}
+</section>
diff --git a/themes/blowfish/layouts/partials/home/profile.html b/themes/blowfish/layouts/partials/home/profile.html
new file mode 100644
index 0000000..70e4ac9
--- /dev/null
+++ b/themes/blowfish/layouts/partials/home/profile.html
@@ -0,0 +1,37 @@
+{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
+<article class="{{ if not .Site.Params.homepage.showRecent }}
+ h-full
+ {{ end }} flex flex-col items-center justify-center text-center">
+ <header class="relative px-1 py-1 flex flex-col items-center mb-3">
+ {{ with .Site.Author.image }}
+ {{ $authorImage := "" }}
+ {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
+ {{ $authorImage = resources.GetRemote . }}
+ {{ else }}
+ {{ $authorImage = resources.Get . }}
+ {{ end }}
+ {{ if $authorImage }}
+ {{ if not $disableImageOptimization }}
+ {{ $authorImage = $authorImage.Fill "288x288" }}
+ {{ end }}
+ <img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Author.name | default " Author" }}"
+ src="{{ $authorImage.RelPermalink }}" />
+ {{ end }}
+ {{ end }}
+ <h1 class="text-4xl font-extrabold">
+ {{ .Site.Author.name | default .Site.Title }}
+ </h1>
+ {{ with .Site.Author.headline }}
+ <h2 class="text-xl text-neutral-500 dark:text-neutral-400">
+ {{ . | markdownify | emojify }}
+ </h2>
+ {{ end }}
+ <div class="mt-1 text-2xl">
+ {{ partialCached "author-links.html" . }}
+ </div>
+ </header>
+ <section class="prose dark:prose-invert">{{ .Content | emojify }}</section>
+</article>
+<section>
+ {{ partial "recent-articles/main.html" . }}
+</section> \ No newline at end of file