luckyframework / luckyframework/lucky

The `link` helper does not accept `options`

Open Beginner friendly
#2,041 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Crystal
Stars
2.7k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Unlike all other tag helpers, the `link` helper doesn't accept `options`. So you can't to do something like:

```crystal
link "Something", to: Something::Index, options: aria_current(Something::Index)

private def aria_current(path)
return {} of String => String unless current_page?(path)

{"aria-current" => "page"}
end
```

because this is such a common use case, I've also been thinking about an additional helper to simplify this:

```crystal
link_with_aria, to: Something::Index
```

But perhaps that a step too far.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the `link` helper and comparing its signature with the other tag helpers that accept options. Verify the expected options shape from those helpers, then make the shown `options: aria_current(...)` call work. Done means link attributes can be supplied through options while normal link generation still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.