I have been working on converting something from Next.js to Ruby. The Next.js version is still more visually appealing to me, but the benefits of working in Ruby far supior to me long term.

Before:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    <Card as="article">
      <Card.Title href={`/articles/${article.slug}`}>
        {article.title}
      </Card.Title>
      <Card.Eyebrow as="time" dateTime={article.date} decorate>
        {formatDate(article.date)}
      </Card.Eyebrow>
      <Card.Description>{article.description}</Card.Description>
      <Card.Cta>Read article</Card.Cta>
    </Card>

After:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    {%@ Shared::Card::Card as: :article do %}
      {%@ Shared::Card::Title as: :h2, href: article.relative_url do %}
        {{article.data.title}}
      {% end %}
      {%@ Shared::Card::Eyebrow as: :time, dateTime: article.data.date, decorate: true do %}
        {{article.data.date}}
      {% end %}
      {%@ Shared::Card::Description do %}
        {{article.data.description}}
      {% end %}
      {%@ Shared::Card::Cta do %}Read article{% end %}
    {% end %}