add character limit to titles

This commit is contained in:
hazycora 2023-08-02 19:40:36 -05:00
parent 7cc6357a5f
commit 81e08a08e3
No known key found for this signature in database
GPG key ID: 215AF1F81F86940E

View file

@ -1,5 +1,10 @@
<% layout('layout') %>
<%
let title = it.issue.title
const titleCharLimit = 50
if (title.length > titleCharLimit) {
title = title.slice(0, titleCharLimit) + '...'
}
let body = it.issue.body
const bodyCharLimit = 50
if (body.length > bodyCharLimit) {
@ -10,9 +15,17 @@
<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; 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>
<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: title})
%></p>
<% if (it.issue.body) { %>
<p style="font-size: 42px; font-weight: 500; flex-wrap: wrap; color: #9A8FA7; display: flex; column-gap: 0.25em;"><%~ include('spanwords', {text: 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">