smr/src/pages/author_index.etlua

52 lines
1.2 KiB
Plaintext

<% assert(author,"No author specified") %>
<% assert(bio,"No bio included") %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>&#x1f351;</title>
<link href="/_css/milligram.css" rel="stylesheet">
<link href="/_css/style.css" rel="stylesheet">
</head>
<body class="container">
<h1 class="title">
<a href="https://<%= author %>.<%= domain %>"><%= author %></a>.<a href="https://<%= domain %>"><%= domain %></a>
</h1>
<div class="content">
<%= bio %>
</div>
<div class="content">
<% if #stories == 0 then %>
This author has not made any pastes yet.
<% else %>
<table>
<% for k,v in pairs(stories) do %>
<tr><td>
<a href="<%= v.url %>">
<%- v.title %>
</a>
</td><td>
By <a href="https://<%= author %>.<%= domain %>"><%= author %></a>
</td><td>
<ul class="row tag-list">
<% for i = 1,math.min(#v.tags, 5) do %>
<li><a class="tag button button-outline" href="https://<%= domain %>/_search?tag=<%= v.tags[i] %>"><%= v.tags[i] %></a></li>
<% end %>
</ul>
</td><td>
<%= v.posted %>
</td></tr>
<% end %>
</table>
<% end %>
</div>
<footer class="footer">
</footer>
</body>
<body>