7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-12-27 14:20:24 +00:00
web-ansol.org/themes/academic/layouts/partials/widgets/hero.html
2021-09-30 23:28:16 +01:00

68 lines
2.6 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">
{{ end }}
{{ with $page.Content }}
<div class="hero-lead">{{ . }}</div>
{{ end }}
{{/* Call-to-action link */}}
{{ if $page.Params.cta.url }}
{{ $pack := or $page.Params.cta.icon_pack "fas" }}
{{ $pack_prefix := $pack }}
{{ if in (slice "fab" "fas" "far" "fal") $pack }}
{{ $pack_prefix = "fa" }}
{{ end }}
{{ $link := $page.Params.cta.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="cta-btns">
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} class="btn {{if $bg.text_color_light}}btn-light{{else}}btn-primary{{end}} btn-lg">{{ if $page.Params.cta.icon }}<i class="{{ $pack }} {{ $pack_prefix }}-{{ $page.Params.cta.icon }} pr-1" aria-hidden="true"></i>{{end}}{{ $page.Params.cta.label | markdownify | emojify | safeHTML }}</a>
{{/* Alternative Call-to-action link */}}
{{ if $page.Params.cta_alt.url }}
{{ $link := $page.Params.cta_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="hero-cta-alt pl-4">{{ $page.Params.cta_alt.label | markdownify | emojify | safeHTML }} <i class="fas fa-angle-right"></i></a>
{{ end }}
</p>
{{ end }}
{{/* Call-to-action note */}}
{{ with $page.Params.cta_note }}
<p class="hero-note text-muted mb-0">
{{ .label | markdownify | emojify | safeHTML }}
</p>
{{ end }}
{{/* Hero image */}}
{{ if $page.Params.hero_media }}
</div>
<div class="col-6 mx-auto col-md-6 order-md-2 hero-media text-left">
<p style="background-color: rgba(0,0,0, .3); padding: 20px">
A “ANSOL - Associação Nacional para o Software Livre” é uma associação
portuguesa sem fins lucrativos que tem como fim a divulgação, promoção,
desenvolvimento, investigação e estudo da Informática Livre e das suas
repercussões sociais, políticas, filosóficas, culturais, técnicas e
científicas.
</p>
</div>
</div>
{{ end }}