website/lib/pages/projects_page.ex

27 lines
712 B
Elixir

defmodule Website.ProjectsPage do
use Tableau.Page,
layout: Website.ProjectsLayout,
permalink: "/projects",
title: "Projects"
use Phoenix.Component
def template(assigns) do
~H"""
<%= for type <- @data["projects"] do %>
<div class="projects" :for={{status, projects} <- type}>
<h2><%= status %></h2>
<article class="project" :for={project <- projects}>
<h3><%= if project["link"] do %>
<a href={project["link"]} target="_blank"><%= project["name"] %></a>
<% else %>
<%= project["name"] %>
<% end %></h3>
<%= project["description"] %>
</article>
</div>
<% end %>
"""
end
end