{{ $item := .item }} {{ $link := $item.RelPermalink }} {{ $target := "" }} {{ if $item.Params.external_link }} {{ $link = $item.Params.external_link }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} {{ $resource := partial "functions/get_featured_image.html" $item }} {{ $anchor := $item.Params.image.focal_point | default "Center" }} {{ $fill_image := .config.fill_image | default true }} {{ $showDate := .config.show_date | default true }} {{ $showReadTime := .config.show_read_time | default true }} {{ $showReadMore := .config.show_read_more | default true }} {{ $hasMeta := or $showDate $showReadTime $showReadMore }} {{ $index := .index }}
{{ with $item.Params.content_meta }} {{ if .trending }}
{{ i18n "trending" | default "Trending" }}
{{ end }} {{ end }} {{ with $resource }} {{ if ne .MediaType.SubType "gif" }} {{ $original_image := "" }} {{ if $fill_image }} {{ $original_image = .Fill (printf "800x450 %s" $anchor) }} {{ else }} {{ $original_image = .Fit (printf "800x450 %s" $anchor) }} {{ end }} {{ $responsive := partial "functions/process_responsive_image.html" (dict "image" $original_image "mode" "responsive" "sizes" (slice 400 600 800) "formats" (slice "avif" "webp" "jpg") ) }} {{ $item.Title | plainify }} featured image {{ else }} {{ $item.Title | plainify }} featured image {{ end }} {{ else }}
{{end}}
{{ with $item.Params.content_meta }} {{ if or .content_type .difficulty }}
{{ with .content_type }} {{ . }} {{ end }} {{ with .difficulty }} {{ i18n "difficulty" }}: {{ . }} {{ end }}
{{ end }} {{ end }} {{ if and $item.Params.tags (gt (len $item.Params.tags) 0) }}
{{ with index ($item.GetTerms "tags") 0 }} {{ .Page.LinkTitle }} {{ end }}
{{ end }}

{{ $item.Title }} {{ if $item.Params.external_link }} {{ partial "functions/get_icon" (dict "name" "arrow-top-right-on-square" "attributes" "style=\"height: 1em;\" class=\"inline-flex h-4 w-4 ml-1 align-text-top\"") }} {{ end }}

{{ ($item.Params.summary | default $item.Summary) | plainify | htmlUnescape | truncate 180 }}

{{ with $item.Params.content_meta.prerequisites }} {{ $max := 2 }} {{ $count := len . }}
{{ i18n "prerequisites" }}: {{ range (first $max .) }} {{ . }} {{ end }} {{ if gt $count $max }} +{{ sub $count $max }} {{ end }}
{{ end }}
{{ if $item.Params.authors }}
{{ with index ($item.GetTerms "authors") 0 }}
{{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} {{ if $avatar }} {{ $avatar_48 := $avatar.Process "Fill 48x48 Center webp" }} avatar {{ end }}
{{ .Page.LinkTitle }} {{ end }}
• {{ end }} {{ if $showDate }} {{ end }} {{ if and $showDate $showReadTime }} {{ end }} {{ if $showReadTime }} {{ $content := $item.Content | plainify }} {{ $words := len (split $content " ") }} {{ $readTime := div $words 200 }} {{ if lt $readTime 1 }}{{ $readTime = 1 }}{{ end }} {{ end }}
{{ if $showReadMore }} {{ i18n "read_more" }} {{ end }}
{{ if $item.Params.ai_insights }}
{{ i18n "ai_insight" }}: {{ $item.Params.ai_insights }}
{{ end }}