mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-10 22:09:31 +00:00
feat: share translated feature images and animate landing
This commit is contained in:
1 parent
d296e16e41
commit
bbf194ce31
15 files changed
+87
-12
No files matched your search
@@ -41,7 +41,7 @@
|
||||
{{/* frontmatter */}}
|
||||
{{ with $page }}
|
||||
{{ $p := . }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{{/* frontmatter */}}
|
||||
{{ with $page }}
|
||||
{{ $p := . }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{/* frontmatter */}}
|
||||
{{ with $page }}
|
||||
{{ $p := . }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
{{/* frontmatter */}}
|
||||
{{ with $page }}
|
||||
{{ $p := . }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{{/* Return the page's feature image, falling back to a translated sibling.
|
||||
This keeps a translated article visually aligned with its source page without
|
||||
forcing every locale to duplicate presentation-only front matter. */}}
|
||||
{{ $featureImage := .Params.featureimage }}
|
||||
{{ if not $featureImage }}
|
||||
{{ range .Translations }}
|
||||
{{ with .Params.featureimage }}{{ $featureImage = . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ return $featureImage }}
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ $useDefault := false }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ $useDefault := false }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{ $useDefault := false }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
{{/* === Featured === */}}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ with .Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" . }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ if site.Params.hotlinkFeatureImage }}
|
||||
{{ $featuredURL = . }}
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
<article class="relative isolate overflow-hidden">
|
||||
<div aria-hidden="true" class="absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80">
|
||||
<div class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-primary-400 to-secondary-500 opacity-20 sm:left-[calc(50%-30rem)] sm:w-[72rem]"></div>
|
||||
</div>
|
||||
{{ if .Site.Params.homepage.animatedBackground | default false }}
|
||||
{{ $background := resources.Get (.Site.Params.homepage.animatedBackgroundImage | default "images/v3/animated-background.png") }}
|
||||
{{ with $background }}
|
||||
<div aria-hidden="true" class="homepage-ambient-background absolute inset-0 -z-10 overflow-hidden" style="background-image: url('{{ .RelPermalink }}');"></div>
|
||||
<div aria-hidden="true" class="homepage-ambient-wash absolute inset-0 -z-10"></div>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<div aria-hidden="true" class="absolute inset-x-0 -top-40 -z-10 transform-gpu overflow-hidden blur-3xl sm:-top-80">
|
||||
<div class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36rem] -translate-x-1/2 rotate-[30deg] bg-gradient-to-tr from-primary-400 to-secondary-500 opacity-20 sm:left-[calc(50%-30rem)] sm:w-[72rem]"></div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<section class="mx-auto max-w-7xl px-4 pb-16 pt-12 sm:px-6 sm:pb-24 sm:pt-20 lg:px-8">
|
||||
<div class="mx-auto max-w-4xl text-center">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{ if isset .Page.Params "featureImageHover" }}{{ $featureImageHover = .Page.Params.featureImageHover }}{{ end }}
|
||||
{{ $featureImagePosition := .Page.Params.imagePositionFeature | default site.Params.imagePositionFeature | default site.Params.imagePosition }}
|
||||
{{ $p := .Page }}
|
||||
{{ with .Page.Params.featureimage }}
|
||||
{{ with partial "functions/feature-image.html" .Page }}
|
||||
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
||||
{{ $featured = resources.GetRemote . }}
|
||||
{{ else }}
|
||||
|
||||
Reference in new issue
Block a user