{%- comment -%}
HeroSlider → J-Södra headless src/app/components/HeroSlider(Client).tsx.
Data: latest nyheter flagged "visa upp på start". Full-viewport slider, autoplay 5s,
dark-green (#002418) bottom gradient, gold CTA. Background uses the image's FOCAL POINT
(focal_x/focal_y, 0–100) via background-position so the crop keeps the important area.
{%- endcomment -%}
{% fetch posts from: 'nyheter' limit: 5 sort: 'published_at:desc' where: 'content.visa_upp_pa_start=true' into: 'slides' %}
{%- if slides == blank or slides.size == 0 -%}{% fetch posts from: 'nyheter' limit: 5 sort: 'published_at:desc' into: 'slides' %}{%- endif -%}
{%- if slides and slides.size > 0 -%}
{%- endif -%}
{%- comment -%}
UpcomingMatchesBlock → Liquid (html block). Replaces the headless `custom` component
"UpcomingMatchesBlock". Next scheduled matches, soonest first. Reuses .jsm-card styles
from jsodra.css (markup inlined — html blocks can't {% render %}).
{%- endcomment -%}
{%- comment -%} html-block {% fetch %} can't interpolate {{ }} in the where (attr regex breaks on the inner quotes of {{ 'now'|date }}), and some old matches are still match_status=scheduled — so fetch all scheduled and filter datum>=today in the loop below. {%- endcomment -%}
{% fetch posts from: 'svff-matcher' where: 'content.match_status=scheduled' sort: 'content.datum:asc' limit: 200 into: 'um' %}
{% fetch standings team: '25585' into: 'tabH' %}
{% fetch standings team: '238729' into: 'tabD' %}
{%- assign monthsSv = 'januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december' | split: ',' -%}
Kommande matcher
Alla matcher →
{%- assign today = 'now' | date: '%Y-%m-%d' -%}
{%- assign futureCount = 0 -%}{% for m in um %}{% if m.content.datum >= today %}{%- assign futureCount = futureCount | plus: 1 -%}{% endif %}{% endfor %}
{% if futureCount > 0 %}
{% if tabH.rows.size > 0 or tabD.rows.size > 0 %}
{% endif %}
-
{%- assign shown = 0 -%}
{% for m in um %}{%- assign c = m.content -%}{% if c.datum >= today and shown < 3 %}{%- assign shown = shown | plus: 1 -%}
{%- assign dp = c.datum | split: '-' -%}{%- assign mi = dp[1] | plus: 0 | minus: 1 -%}{%- assign dnum = dp[2] | plus: 0 -%}
-
{% if c.logotyp_hemmalag %}
{% else %}{{ c.hemmalag | truncate: 3, '' | upcase }}{% endif %}
{{ c.hemmalag }}{{ dnum }} {{ monthsSv[mi] }}{% if c.tid_for_avspark and c.tid_for_avspark != '' and c.tid_for_avspark != '00:00' %}{{ c.tid_for_avspark }}{% else %}TBD{% endif %}{% if c.logotype_bortalag %}{% else %}{{ c.bortalag | truncate: 3, '' | upcase }}{% endif %}
{{ c.bortalag }}{{ c.leaguename | default: c.arena }}{% if c.leaguename and c.arena %}{{ c.arena }}{% endif %}
{% endif %}{% endfor %}
Inga kommande matcher just nu.
{% endif %}{%- comment -%}
LatestNewsBlock → Liquid (html block for the page-builder). Replaces the headless
`custom` component "LatestNewsBlock". Self-contained: {% fetch %} + inline markup
(html blocks can't use {% render %} snippets). Reuses .jsm-ncard styles from jsodra.css.
{%- endcomment -%}
{% fetch posts from: 'nyheter' limit: 3 sort: 'published_at:desc' into: 'ln' %}
{%- assign months = 'januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december' | split: ',' -%}
{% if ln and ln.size > 0 %}
Senaste nytt
Alla nyheter →
{% for n in ln %}
{%- assign img = n.featured_image | default: n.content.omslagsbild -%}
{%- if img == nil or img == '' -%}{%- assign yl = n.content.youtubelink -%}{%- if yl and yl != '' -%}{%- assign ytid = '' -%}{%- if yl contains 'v=' -%}{%- assign ytid = yl | split: 'v=' | last | split: '&' | first | split: '?' | first -%}{%- elsif yl contains 'youtu.be/' -%}{%- assign ytid = yl | split: 'youtu.be/' | last | split: '?' | first | split: '&' | first -%}{%- elsif yl contains '/shorts/' -%}{%- assign ytid = yl | split: '/shorts/' | last | split: '?' | first -%}{%- elsif yl contains '/embed/' -%}{%- assign ytid = yl | split: '/embed/' | last | split: '?' | first -%}{%- endif -%}{%- if ytid != '' -%}{%- assign img = 'https://i.ytimg.com/vi/' | append: ytid | append: '/hqdefault.jpg' -%}{%- endif -%}{%- endif -%}{%- endif -%}
{%- assign mnum = n.published_at | date: '%m' | plus: 0 | minus: 1 -%}
{% endfor %}
{% endif %}
{% if n.content.youtubelink %}{% endif %}



