Menu

All 106 of our page titles fit in 600 pixels, and 82 of our descriptions get cut mid-word
📰

All 106 of our page titles fit in 600 pixels, and 82 of our descriptions get cut mid-word

DEV Community: html·Daniel Pertu·6 days ago
#T9IOPI8o
#devto2#devto#dev#character#pixels
Long article (1514 words) — no AI summary yet.
Reading 0:00
15s threshold

Every content page on Nakodo passes a generated test before it can ship. Two of its assertions are about length:

assert . ok ( page . metaTitle . length <= MAX_TITLE , `title is ${page.metaTitle.length} chars` ) ; assert . ok ( page . metaDescription . length >= 90 && page . metaDescription . length <= MAX_DESCRIPTION , . . . ) ;

Enter fullscreen mode

Exit fullscreen mode

// The layout appends " · Nakodo" (9 characters) to page titles. Titles stay at // 50 so the whole thing clears 60. export const MAX_TITLE = 50 ; export const MAX_DESCRIPTION = 158 ;

Enter fullscreen mode

Exit fullscreen mode

I have written before about what those rules did to 27 new pages and about the fourteen call sites that build the metadata . What I had never done is check the unit. A search result page does not count characters. It lays out a line of text in a font, in a box, and cuts what does not fit.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.