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.…