Shorten truncated text to 300 characters (for Open Graph)

This commit is contained in:
swagg boi 2023-06-04 16:47:50 -04:00
parent 277afd71fc
commit 782545b70f

View file

@ -62,8 +62,8 @@ sub startup($self) {
}); });
$self->helper(truncate_text => sub ($c, $input_text) { $self->helper(truncate_text => sub ($c, $input_text) {
my $truncated_text = 500 < length($input_text) my $truncated_text = 299 < length($input_text)
? substr($input_text, 0, 500) . '…' : $input_text; ? substr($input_text, 0, 299) . '…' : $input_text;
return $truncated_text; return $truncated_text;
}); });