update issue template to span paragraphs

This commit is contained in:
hazycora 2023-08-02 19:36:37 -05:00
parent 3bdee6d047
commit 7cc6357a5f
No known key found for this signature in database
GPG key ID: 215AF1F81F86940E
2 changed files with 12 additions and 8 deletions

View file

@ -1,19 +1,18 @@
<% layout('layout') %>
<%
const issueTitleWords = it.issue.title.split(/\s/)
// satori, the HTML-to-SVG engine we use, has no concept of "inline" or "inline-block"
// CSS display values. So, we must emulate them with flex-wrap and making each word a <span>...
let body = it.issue.body
const bodyCharLimit = 50
if (body.length > bodyCharLimit) {
body = body.slice(0, bodyCharLimit) + '...'
}
%>
<div class="main">
<div class="contents">
<div class="info">
<p style="font-size: 36px; color: #9A8FA7;">@<%= it.issue.repository?.full_name || it.issue.base.repo.full_name %></p>
<p style="font-weight: 800; font-size: 4.5rem; line-height: 1.2em; column-gap: 0.125em; flex-wrap: wrap;"><span style="font-weight: 400; color: #9A8FA7">#<%= it.issue.number %></span> <%
for (const word of issueTitleWords) { %>
<span><%= word %></span>
<% }%></p>
<p style="font-weight: 800; font-size: 4.5rem; line-height: 1.2em; display: flex; column-gap: 0.25em; flex-wrap: wrap;"><span style="font-weight: 400; color: #9A8FA7">#<%= it.issue.number %></span><%~ include('spanwords', {text: 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>
<p style="font-size: 42px; font-weight: 500; flex-wrap: wrap; color: #9A8FA7; display: flex; column-gap: 0.25em;"><%~ include('spanwords', {text: body}) %></p>
<% } %>
</div>
<div class="graphics">

5
views/spanwords.eta Normal file
View file

@ -0,0 +1,5 @@
<% /*
satori, the HTML-to-SVG engine we use, has no concept of "inline" or "inline-block"
CSS display values. So, we must emulate them with flex-wrap and making each word a <span>...
*/ %>
<% for (const word of it.text.split(/\s+/)) { %><span><%= word %></span><% } %>