About page, most of frontpage, news
Frontpage: - Implement initial pass of swipers, might look for something that doesn't require JS. - Implemented transitions - Added transitions / company logos to assets About page: - Basically duplicated layout from existing website News: - Renamed /blog -> /news, not too much in this section left to do, relatively straightforward for that
This commit is contained in:
93
layouts/partials/bg_image.html
Normal file
93
layouts/partials/bg_image.html
Normal file
@@ -0,0 +1,93 @@
|
||||
{{ $imagePath:= string .Src }}
|
||||
{{ $image:= . }}
|
||||
{{ $size:= .Size }}
|
||||
{{ $perspective:= .Perspective | default "cover" }}
|
||||
{{ $position:= .Position | default "center center" }}
|
||||
{{ $repeat:= .Repeat | default "no-repeat" }}
|
||||
{{ $webp:= .Webp | default true }}
|
||||
{{ $context:= .Context | default . }}
|
||||
{{ $contentImage:= false }}
|
||||
{{ $assetImage:= false }}
|
||||
{{ $placeholder:= .Placeholder | default false }}
|
||||
{{ $placeholderQuality:= "40x q20" }}
|
||||
|
||||
<!-- check content image -->
|
||||
{{ with $context.Resources }}
|
||||
{{ if .GetMatch $imagePath }}
|
||||
{{ $contentImage = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- /check content image -->
|
||||
|
||||
<!-- check asset image -->
|
||||
{{ if fileExists (add `assets/` (string $imagePath)) }}
|
||||
{{ $assetImage = true }}
|
||||
{{ end }}
|
||||
<!-- /check asset image -->
|
||||
|
||||
{{ if or (hasPrefix $imagePath "http") (fileExists (add `static/` (string $imagePath))) }}
|
||||
<div style="background-size: {{$size}};background-position: {{$position}};background-repeat: {{$repeat}};" {{if $placeholder}}data-src="{{ $imagePath | absURL }}"{{end}} class="{{ .Class }}"></div>
|
||||
|
||||
<!-- check file existence -->
|
||||
{{ else if or $assetImage $contentImage }}
|
||||
|
||||
{{ if $assetImage }}
|
||||
{{ $image = resources.Get $imagePath }}
|
||||
{{ else if $contentImage }}
|
||||
{{ $image = $context.Resources.GetMatch $imagePath }}
|
||||
{{ end }}
|
||||
|
||||
<!-- image extension -->
|
||||
{{ $imageExt := path.Ext $image }}
|
||||
|
||||
<!-- image height, width (if not svg) -->
|
||||
{{ if eq $imageExt `.svg` }}
|
||||
{{ .Scratch.Set "image-height" "" }}
|
||||
{{ .Scratch.Set "image-width" "" }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "image-height" $image.Height }}
|
||||
{{ .Scratch.Set "image-width" $image.Width }}
|
||||
{{ end }}
|
||||
{{ $imageHeight:= .Scratch.Get "image-height" }}
|
||||
{{ $imageWidth:= .Scratch.Get "image-width" }}
|
||||
|
||||
<!-- gif/svg image -->
|
||||
{{ if or (eq $imageExt `.gif`) (eq $imageExt `.svg`) }}
|
||||
|
||||
<!-- placeholder -->
|
||||
<div class="{{ .Class }}" style="background-image: url({{ $image.RelPermalink }});background-size: {{$perspective}};background-position: {{$position}};background-repeat: {{$repeat}};"></div>
|
||||
|
||||
{{ else }}
|
||||
|
||||
{{ if $size }}
|
||||
|
||||
{{ $imageWebp:= $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageWebp.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
<div class="{{ .Class }}" style="background-image: url({{if $placeholder}}data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}{{else}}{{ $imageWebp.RelPermalink }}{{end}});background-size: {{$perspective}};background-position: {{$position}};background-repeat: {{$repeat}};" {{if $placeholder}}data-src="{{ $imageWebp.RelPermalink }}"{{end}}></div>
|
||||
|
||||
{{ else }} <!-- if not size -->
|
||||
|
||||
{{ $height:= string $image.Height }}
|
||||
{{ $width:= string $image.Width }}
|
||||
{{ $defaultSize:= add (add $width "x") $height }}
|
||||
{{ $imageWebp:= $image.Resize (add $defaultSize " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $defaultSize) }}
|
||||
{{ end }}
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageWebp.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
<div class="{{ .Class }}" style="background-image: url({{if $placeholder}}data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}{{else}}{{ $imageWebp.RelPermalink }}{{end}}); background-size: {{$perspective}};background-position: {{$position}};background-repeat: {{$repeat}};" {{if $placeholder}}data-src="{{ $imageWebp.RelPermalink }}"{{end}}></div>
|
||||
|
||||
{{ end }} <!-- /if size -->
|
||||
|
||||
{{ end }} <!-- /check file existence -->
|
||||
|
||||
{{ end }}
|
||||
@@ -1,18 +1,5 @@
|
||||
<!-- DNS preconnect -->
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on" />
|
||||
<link rel="preconnect" href="https://use.fontawesome.com" crossorigin />
|
||||
<link rel="preconnect" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="preconnect" href="//www.googletagmanager.com" />
|
||||
<link rel="preconnect" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="https://use.fontawesome.com" />
|
||||
<link rel="dns-prefetch" href="//ajax.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="dns-prefetch" href="//www.googletagmanager.com" />
|
||||
<link rel="dns-prefetch" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//connect.facebook.net" />
|
||||
<link rel="dns-prefetch" href="//platform.linkedin.com" />
|
||||
<link rel="dns-prefetch" href="//platform.twitter.com" />
|
||||
|
||||
<!-- google fonts -->
|
||||
{{ $pf:= site.Data.theme.fonts.font_family.primary }}
|
||||
|
||||
93
layouts/partials/img_url.html
Normal file
93
layouts/partials/img_url.html
Normal file
@@ -0,0 +1,93 @@
|
||||
{{ $imagePath:= string .Src }}
|
||||
{{ $image:= . }}
|
||||
{{ $size:= .Size }}
|
||||
{{ $perspective:= .Perspective | default "cover" }}
|
||||
{{ $position:= .Position | default "center center" }}
|
||||
{{ $repeat:= .Repeat | default "no-repeat" }}
|
||||
{{ $webp:= .Webp | default true }}
|
||||
{{ $context:= .Context | default . }}
|
||||
{{ $contentImage:= false }}
|
||||
{{ $assetImage:= false }}
|
||||
{{ $placeholder:= .Placeholder | default false }}
|
||||
{{ $placeholderQuality:= "40x q20" }}
|
||||
|
||||
<!-- check content image -->
|
||||
{{ with $context.Resources }}
|
||||
{{ if .GetMatch $imagePath }}
|
||||
{{ $contentImage = true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- /check content image -->
|
||||
|
||||
<!-- check asset image -->
|
||||
{{ if fileExists (add `assets/` (string $imagePath)) }}
|
||||
{{ $assetImage = true }}
|
||||
{{ end }}
|
||||
<!-- /check asset image -->
|
||||
|
||||
{{ if or (hasPrefix $imagePath "http") (fileExists (add `static/` (string $imagePath))) }}
|
||||
{{ $imagePath | absURL }}
|
||||
|
||||
<!-- check file existence -->
|
||||
{{ else if or $assetImage $contentImage }}
|
||||
|
||||
{{ if $assetImage }}
|
||||
{{ $image = resources.Get $imagePath }}
|
||||
{{ else if $contentImage }}
|
||||
{{ $image = $context.Resources.GetMatch $imagePath }}
|
||||
{{ end }}
|
||||
|
||||
<!-- image extension -->
|
||||
{{ $imageExt := path.Ext $image }}
|
||||
|
||||
<!-- image height, width (if not svg) -->
|
||||
{{ if eq $imageExt `.svg` }}
|
||||
{{ .Scratch.Set "image-height" "" }}
|
||||
{{ .Scratch.Set "image-width" "" }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "image-height" $image.Height }}
|
||||
{{ .Scratch.Set "image-width" $image.Width }}
|
||||
{{ end }}
|
||||
{{ $imageHeight:= .Scratch.Get "image-height" }}
|
||||
{{ $imageWidth:= .Scratch.Get "image-width" }}
|
||||
|
||||
<!-- gif/svg image -->
|
||||
{{ if or (eq $imageExt `.gif`) (eq $imageExt `.svg`) }}
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $image.RelPermalink }}
|
||||
|
||||
{{ else }}
|
||||
|
||||
{{ if $size }}
|
||||
|
||||
{{ $imageWebp:= $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageWebp.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
{{if $placeholder}}data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}{{else}}{{ $imageWebp.RelPermalink }}{{end}}
|
||||
|
||||
{{ else }} <!-- if not size -->
|
||||
|
||||
{{ $height:= string $image.Height }}
|
||||
{{ $width:= string $image.Width }}
|
||||
{{ $defaultSize:= add (add $width "x") $height }}
|
||||
{{ $imageWebp:= $image.Resize (add $defaultSize " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $defaultSize) }}
|
||||
{{ end }}
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageWebp.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
{{if $placeholder}}data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}{{else}}{{ $imageWebp.RelPermalink }}{{end}}
|
||||
|
||||
{{ end }} <!-- /if size -->
|
||||
|
||||
{{ end }} <!-- /check file existence -->
|
||||
|
||||
{{ end }}
|
||||
9
layouts/partials/page-header-breadcrumbs.html
Normal file
9
layouts/partials/page-header-breadcrumbs.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<section>
|
||||
<div class="container text-center">
|
||||
<div
|
||||
class="from-body to-theme-light dark:from-darkmode-body dark:to-darkmode-theme-light rounded-2xl bg-gradient-to-b px-8 py-14">
|
||||
<h1>{{ T (printf "%s" (lower .Title)) | default .Title | title }}</h1>
|
||||
{{ partial "components/breadcrumb" (dict "Context" . "Class" "mt-6") }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,9 +1,8 @@
|
||||
<section>
|
||||
<div class="container text-center">
|
||||
<div
|
||||
class="from-body to-theme-light dark:from-darkmode-body dark:to-darkmode-theme-light rounded-2xl bg-gradient-to-b px-8 py-14">
|
||||
class="px-8 py-14">
|
||||
<h1>{{ T (printf "%s" (lower .Title)) | default .Title | title }}</h1>
|
||||
{{ partial "components/breadcrumb" (dict "Context" . "Class" "mt-6") }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
243
layouts/partials/parallax_bg.html
Normal file
243
layouts/partials/parallax_bg.html
Normal file
@@ -0,0 +1,243 @@
|
||||
{{ $image:= . }}
|
||||
{{ $imagePath:= .Src }}
|
||||
{{ $class:= .Class }}
|
||||
{{ $size:= .Size }}
|
||||
{{ $alt:= .Alt }}
|
||||
{{ $displayXL:= .DisplayXL | default "1110x" }}
|
||||
{{ $displayLG:= .DisplayLG | default "700x" }}
|
||||
{{ $displayMD:= .DisplayMD | default "600x" }}
|
||||
{{ $displaySM:= .DisplaySM | default "545x" }}
|
||||
{{ $resize:= .Resize | default true }}
|
||||
{{ $loading:= .Loading | default "lazy" }}
|
||||
{{ $context:= .Context | default . }}
|
||||
{{ $contentImage:= false }}
|
||||
{{ $assetImage:= false }}
|
||||
{{ $sizeValue:= index (split $size ` `) 0 }}
|
||||
{{ $height:= index (split $sizeValue `x`) 1 }}
|
||||
{{ $width:= index (split $sizeValue `x`) 0 }}
|
||||
{{ $webp:= .Webp | default true }}
|
||||
{{ $command:= .Command | default "Resize" }}
|
||||
{{ $placeholder:= .Placeholder | default false }}
|
||||
{{ $placeholderQuality:= "40x q20" }}
|
||||
|
||||
|
||||
<!-- check content image -->
|
||||
{{ with $context.Resources.GetMatch $imagePath }}
|
||||
{{ $contentImage = true }}
|
||||
{{ end }}
|
||||
<!-- /check content image -->
|
||||
|
||||
<!-- check asset image -->
|
||||
{{ if fileExists (add `assets/` (string $imagePath)) }}
|
||||
{{ $assetImage = true }}
|
||||
{{ end }}
|
||||
<!-- /check asset image -->
|
||||
|
||||
<!-- image static/CDN -->
|
||||
{{ if or (hasPrefix $imagePath "http") (fileExists (add `static/` (string $imagePath))) }}
|
||||
<div
|
||||
loading="{{ .Loading }}"
|
||||
decoding="async"
|
||||
style="background-image: url('{{ $imagePath | absURL }}')"
|
||||
alt="{{ .Alt }}"
|
||||
class="{{ $class }} img"
|
||||
height="{{ $height }}"
|
||||
width="{{ $width }}" />
|
||||
{{ else }}
|
||||
<!-- /image cdn -->
|
||||
|
||||
<!-- check file existence -->
|
||||
{{ if or $assetImage $contentImage }}
|
||||
{{ if $assetImage }}
|
||||
{{ $image = resources.Get $imagePath }}
|
||||
{{ else if $contentImage }}
|
||||
{{ $image = $context.Resources.GetMatch $imagePath }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- image extension -->
|
||||
{{ $imageExt := path.Ext $image }}
|
||||
|
||||
|
||||
<!-- image height, width (if not svg) -->
|
||||
{{ if eq $imageExt `.svg` }}
|
||||
{{ .Scratch.Set "image-height" "" }}
|
||||
{{ .Scratch.Set "image-width" "" }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "image-height" $image.Height }}
|
||||
{{ .Scratch.Set "image-width" $image.Width }}
|
||||
{{ end }}
|
||||
{{ $imageHeight:= .Scratch.Get "image-height" }}
|
||||
{{ $imageWidth:= .Scratch.Get "image-width" }}
|
||||
|
||||
|
||||
<!-- gif/svg image -->
|
||||
{{ if or (eq $imageExt `.gif`) (eq $imageExt `.svg`) }}
|
||||
<div
|
||||
style="background-image: url('{{ $image.RelPermalink }}')"
|
||||
loading="{{ $loading }}"
|
||||
decoding="async"
|
||||
alt="{{ .Alt }}"
|
||||
class="{{ $class }} img"
|
||||
width="{{ $width }}"
|
||||
height="{{ $height }}" />
|
||||
{{ else }}
|
||||
<!-- single image -->
|
||||
{{ if $size }}
|
||||
<!-- resize -->
|
||||
{{ $imageFallback:= $image.Resize $size }}
|
||||
{{ $imageWebp:= $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
<!-- fit -->
|
||||
{{ if eq $command "Fit" }}
|
||||
{{ $imageFallback = $image.Fit $size }}
|
||||
{{ $imageWebp = $image.Fit (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Fit (string $size) }}
|
||||
{{ end }}
|
||||
<!-- fill -->
|
||||
{{ else if eq $command "Fill" }}
|
||||
{{ $imageFallback = $image.Fill $size }}
|
||||
{{ $imageWebp = $image.Fill (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Fill (string $size) }}
|
||||
{{ end }}
|
||||
<!-- crop -->
|
||||
{{ else if eq $command "Crop" }}
|
||||
{{ $imageFallback = $image.Crop $size }}
|
||||
{{ $imageWebp = $image.Crop (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Crop (string $size) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageWebp.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
|
||||
<div
|
||||
{{ if $placeholder }}
|
||||
style="background-image: 'data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}'"
|
||||
data-src={{ $imageWebp.RelPermalink }}
|
||||
{{ else }}
|
||||
src="{{ $imageWebp.RelPermalink }}" loading="{{ $loading }}"
|
||||
decoding="async"
|
||||
{{ end }}
|
||||
|
||||
alt="{{ .Alt }}"
|
||||
class="{{ if $placeholder }}lazy{{ end }} {{ $class }} img"
|
||||
width="{{- with $width -}}
|
||||
{{- . -}}
|
||||
{{- else -}}
|
||||
{{- $imageWebp.Width -}}
|
||||
{{- end -}}
|
||||
"
|
||||
height="{{- with $height -}}
|
||||
{{- . -}}
|
||||
{{- else -}}
|
||||
{{- $imageWebp.Height -}}
|
||||
{{- end -}}
|
||||
"
|
||||
onerror="this.onerror='null';
|
||||
this.src='{{ $imageFallback.RelPermalink }}';" />
|
||||
|
||||
<!-- if image size less then 500x and size not defined -->
|
||||
{{ else if or (lt ($image.Width) 500) (not $resize) }}
|
||||
{{ $size:= add (add (string $image.Width) "x") (string $image.Height) }}
|
||||
<!-- resize -->
|
||||
{{ $imageWebp:= $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
<!-- fit -->
|
||||
{{ if eq $command "Fit" }}
|
||||
{{ $imageWebp = $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
<!-- fill -->
|
||||
{{ else if eq $command "Fill" }}
|
||||
{{ $imageWebp = $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
<!-- crop -->
|
||||
{{ else if eq $command "Crop" }}
|
||||
{{ $imageWebp = $image.Resize (add (string $size) " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageWebp = $image.Resize (string $size) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageWebp.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
|
||||
<div
|
||||
{{ if $placeholder }}
|
||||
src="data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}"
|
||||
data-src={{ $imageWebp.RelPermalink }} alt="placeholder"
|
||||
{{ else }}
|
||||
src="{{ $imageWebp.RelPermalink }}" loading="{{ $loading }}"
|
||||
decoding="async" alt="{{ .Alt }}"
|
||||
{{ end }}
|
||||
|
||||
class="{{ if $placeholder }}lazy{{ end }} {{ $class }} img"
|
||||
width="{{- with $width -}}
|
||||
{{- . -}}
|
||||
{{- else -}}
|
||||
{{- $imageWebp.Width -}}
|
||||
{{- end -}}
|
||||
"
|
||||
height="{{- with $height -}}
|
||||
{{- . -}}
|
||||
{{- else -}}
|
||||
{{- $imageWebp.Height -}}
|
||||
{{- end -}}
|
||||
"
|
||||
onerror="this.onerror='null';this.src='{{ $image.RelPermalink }}';" />
|
||||
{{ else }}
|
||||
<!-- /if image size less then 500x and size not defined -->
|
||||
|
||||
<!-- image processing for multiple device -->
|
||||
{{ $imageFallback:= $image.Resize $displayXL }}
|
||||
{{ $imageXL:= $image.Resize (add $displayXL " webp") }}
|
||||
{{ $imageLG:= $image.Resize (add $displayLG " webp") }}
|
||||
{{ $imageMD:= $image.Resize (add $displayMD " webp") }}
|
||||
{{ $imageSM:= $image.Resize (add $displaySM " webp") }}
|
||||
{{ if not $webp }}
|
||||
{{ $imageXL = $image.Resize $displayXL }}
|
||||
{{ $imageLG = $image.Resize $displayLG }}
|
||||
{{ $imageMD = $image.Resize $displayMD }}
|
||||
{{ $imageSM = $image.Resize $displaySM }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- placeholder -->
|
||||
{{ $placeholderImage := ($imageFallback.Resize $placeholderQuality) | images.Filter (images.GaussianBlur 5) }}
|
||||
|
||||
|
||||
<div
|
||||
{{ if $placeholder }}
|
||||
src="data:image/jpeg;base64,{{ $placeholderImage.Content | base64Encode }}"
|
||||
data-src={{ $imageFallback.RelPermalink }}
|
||||
{{ else }}
|
||||
loading="{{ $loading }}" decoding="async"
|
||||
style="background: url('{{ $imageFallback.RelPermalink }}')"
|
||||
{{ end }}class="{{ if $placeholder }}
|
||||
lazy
|
||||
{{ end }} {{ $class }} img"
|
||||
alt="{{ .Alt }}" />
|
||||
{{ end }}
|
||||
<!-- end image processing -->
|
||||
{{ end }}
|
||||
<!-- end single image -->
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- end check file existence -->
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user