portfolios_lea-jean/layouts/partials/widgets/hero.html

63 lines
3.1 KiB
HTML

{{ $ := .root }}
{{ $page := .page }}
{{ $bg := $page.Params.design.background }}
{{ if $page.Params.hero_media }}
<div class="row">
<div class="col-md-6 order-md-1 text-center text-md-left align-self-center">
{{ end }}
{{ with $page.Content }}
<div style="text-align:justify; color:white;">{{ . }}</div>
{{ end }}
{{/* Call-to-action link */}}
{{ if $page.Params.btn.url }}
{{ $pack := or $page.Params.btn.icon_pack "fas" }}
{{ $pack_prefix := $pack }}
{{ if in (slice "fab" "fas" "far" "fal") $pack }}
{{ $pack_prefix = "fa" }}
{{ end }}
{{ $link := $page.Params.btn.url }}
{{ $scheme := (urls.Parse $link).Scheme }}
{{ $target := "" }}
{{ if not $scheme }}
{{ $link = $link | relLangURL }}
{{ else if in (slice "http" "https") $scheme }}
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
<p class="mt-4" style="text-align:center">
<a href="/files/cv.pdf" target="_blank" rel="noopener" class="btn {{if $bg.text_color_light}}btn-light{{else}}btn-primary{{end}} btn-lg page-scroll">{{ if $page.Params.btn.icon }}<i class="{{ $pack }} {{ $pack_prefix }}-{{ $page.Params.btn.icon }} mr-2" aria-hidden="true"></i>{{end}}{{ $page.Params.btn.label | markdownify | emojify | safeHTML }}</a>
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} class="btn {{if $bg.text_color_light}}btn-light{{else}}btn-primary{{end}} btn-lg page-scroll">{{ if $page.Params.btn.icon }}<i class="{{ $pack }} {{ $pack_prefix }}-{{ $page.Params.btn.icon }} mr-2" aria-hidden="true"></i>{{end}}En savoir plus...</a>
{{/* Alternative Call-to-action link */}}
{{ if $page.Params.btn_alt.url }}
{{ $link := $page.Params.btn_alt.url }}
{{ $scheme := (urls.Parse $link).Scheme }}
{{ $target := "" }}
{{ if not $scheme }}
{{ $link = $link | relLangURL }}
{{ else if in (slice "http" "https") $scheme }}
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} class="btn btn-lg {{if $bg.text_color_light}}btn-outline-light{{else}}btn-outline-primary{{end}} page-scroll"><i class="fas fa-envelope"></i> {{ if $page.Params.btn_alt.icon }}<i class="{{ $pack }} {{ $pack_prefix }}-{{ $page.Params.btn_alt.icon }} mr-2" aria-hidden="true"></i>{{end}}{{ $page.Params.btn_alt.label | markdownify | emojify | safeHTML }} <i class="fas fa-phone"></i></a>
{{ end }}
</p>
{{ end }}
<p class="mb-0" style="color:#ffb92c; font-size:85%">
<i class="fas fa-exclamation-circle"></i><i> Tous les dessins (hors section "Réalisations") ont été réalisés par <a href="https://www.instagram.com/sakki_ryuuketsu/" target="_blank" rel="noopener">Léa JEAN</a>.</i>
</p>
{{/* Hero image */}}
{{ if $page.Params.hero_media }}
</div>
<div class="col-10 mx-auto col-md-6 order-md-2 hero-media">
<img class="hero-img img-fluid" src="{{ printf "img/%s" $page.Params.hero_media | relURL }}" alt="">
</div>
</div>
{{ end }}