Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat: template-defined Liquid filters

Đang mở
#37 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
57/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading the FluidTemplateEngine constructor and AddFilter calls to understand how filters are registered, then inspect the xUnit tests in Fanstatic.Test/ and fixture sites in .TestSites/. Run ./build.sh test while developing. Done means a fixture site's filters/stars.liquid makes {{ 4 | stars }} render ★★★★☆, with the other listed behaviors covered by tests and the documentation examples added.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

c:templates p:medium size:S t:feature

Part of the Phase 3 epic (#33).

Current State

Custom filters can only be added in C# (FluidTemplateEngine constructor, AddFilter calls). Sites cannot package
reusable logic.

Tasks:
  • Every filters/<name>.liquid (site, then theme) registers a filter <name>
  • In the filter template: input, args (positional list) and named args, plus page and site
  • Result = trimmed rendered output (string); document that numbers come back as strings
  • Name clash with a built-in filter: error at startup
  • Docs page with examples (slugify, stars)

Tests live in Fanstatic.Test/ (xUnit + NSubstitute); fixture sites in .TestSites/. Run ./build.sh test; new/changed methods need CRAP ≤ 15 and ≥ 75 % line coverage.

Acceptance Criteria:
  • {{ 4 | stars }} renders ★★★★☆ from filters/stars.liquid on a fixture site.
Related:
  • #33 (Phase 3 epic, parent)
Ngôn ngữ chính
C#
Star
1
Fork
0
Merge trung bình
10 giờ 23 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MASS4ORG/Fanstatic

Tất cả issue của MASS4ORG/Fanstatic

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.