first
배열이나 리스트 데이터에서 가장 첫 번째에 위치한 요소를 추출하여 반환하는 필터입니다.
문법
{{ array | first }}예시
{% assign cities = "서울,부산,대구" | split: "," %}{{ cities | first }}결과
서울first 필터는 배열 컬렉션의 첫 번째 원소 하나만을 꺼내오는 데이터 탐색 필터입니다. 인덱스 번호를 직접 지정하지 않고도 체이닝 구문을 통해 가장 우선순위가 높은 대표 항목을 직관적으로 취득할 수 있습니다.
키워드 조합 페이지에서는 쉼표로 나열된 서비스 지역이나 주요 키워드 목록 중에서 '대표 지역' 하나만을 뽑아 메타 제목이나 빵부스러기(Breadcrumb)에 반영할 때 이상적입니다. 예를 들어 {{ row.service_areas | split: ',' | first }} 본점 안내처럼 대표 거점을 간결하게 명시하여 검색 사용자에게 핵심 거점을 명확히 전달합니다.
필터
- abs
- append
- at_least
- at_most
- capitalize
- ceil
- compact
- concat
- date
- default
- divided_by
- downcase
- escape
- escape_once
- first
- floor
- join
- last
- lstrip
- map
- minus
- modulo
- newline_to_br
- plus
- prepend
- remove
- remove_first
- replace
- replace_first
- reverse
- round
- rstrip
- size
- slice
- sort
- sort_natural
- split
- strip
- strip_html
- strip_newlines
- times
- truncate
- truncatewords
- uniq
- upcase
- url_decode
- url_encode
- where
- raw
- slugify
- number_format
