{{ $contextType := printf "%T" . }} {{ $isShortcode := (eq $contextType "*hugolib.ShortcodeWithPage") }} {{/* sectionId: Optional argument to override the default HTML id for this section. If not provided, the default id is used. hideViewAll: Optional argument to hide the "View All" button. Set to "true" to hide the button. */}} {{ $sectionId := "experience-single" }} {{ $showViewAll := true }} {{ if $isShortcode }} {{ with .Get "sectionId" }} {{ $sectionId = . }} {{ end }} {{ $hideViewAllParam := .Get "hideViewAll" }} {{ if eq $hideViewAllParam "true" }} {{ $showViewAll = false }} {{ end }} {{ end }}

{{ if $isShortcode }} {{ .Get "title" | default "" }} {{ else }} {{ i18n "experience_title" }} {{ end }}

{{ $xp := where .Site.RegularPages.ByDate "Type" "experience" }} {{ if not $isShortcode }} {{ $baseLangSite := .Sites.Default }} {{ $xp = $xp | lang.Merge (where $baseLangSite.RegularPages.ByDate.Reverse "Type" "experience") }} {{ end }} {{ $xpCount := len $xp }} {{/* in the homepage we limit to the homepageExperienceCount param (6 by default) in the inner page (experience) we display the all */}} {{ $totalCount := .Site.Params.homepageExperienceCount }} {{ if not $isShortcode }} {{ if not .IsHome }} {{ $totalCount = $xpCount }} {{ end }} {{ end }} {{ range first $totalCount (sort $xp "Date" "desc") }} {{ end }} {{ if and (gt $xpCount $totalCount) $showViewAll }}
{{ $xpExtra := sub $xpCount $totalCount }} And {{ $xpExtra }} more
{{ i18n "experience_button3" }}
{{ end }}
{{ partial "experience-description.html" . }}