rough issues

This commit is contained in:
Aria Blue 2023-08-02 19:10:20 -04:00
parent d66398543c
commit 3aefd79807
No known key found for this signature in database
GPG key ID: E851AE999FFCBC37
2 changed files with 32 additions and 0 deletions

View file

@ -41,4 +41,22 @@ app.get('/:owner/:repo', async function (req, res) {
res.send(await render(html))
})
app.get('/:owner/:repo/issues/:num', async function (req, res) {
const issueResp = await fetch(
`https://git.gay/api/v1/repos/${req.params.owner}/${req.params.repo}/issues/${req.params.num}`
)
const issue = await issueResp.json()
const html = await eta.renderAsync('issue', {
issue,
debug
})
if (debug) {
res.send(html)
return
}
res.type('png')
res.set('Content-Disposition', 'inline')
res.send(await render(html))
})
app.listen(8085)

14
views/issue.eta Normal file
View file

@ -0,0 +1,14 @@
<div class="main">
<div class="contents">
<div class="info">
<p style="font-size: 36px; color: #9A8FA7;">@<%= it.issue.repository.full_name %></p>
<p style="font-weight: 800; font-size: 4.5rem; line-height: 1.2em;"><%= it.issue.title %></p>
<% if (it.issue.body) { %>
<p style="font-size: 42px; font-weight: 500; text-overflow: ellipsis; color: #9A8FA7; overflow: hidden; white-space: nowrap;"><%= it.issue.body %></p>
<% } %>
</div>
<div class="graphics">
<img width="120" height="120" src="<%= it.issue.user.avatar_url %>"></img>
</div>
</div>
</div>