Truncate the description value to 280 chars
Currently the value of the `description`, `og: description` and `twitter: description` tags includes the whole text of the post. Which means that, on post pages, the text of the post is included *four* times in the HTML document – adding to the page weight needlessly. This commit ensures the description string is truncated to a sane value.
This commit is contained in:
parent
db0e639259
commit
160505dcd0
|
@ -89,7 +89,8 @@ module Jekyll
|
|||
|
||||
def description
|
||||
@description ||= begin
|
||||
format_string(page["description"] || page["excerpt"]) || site_description
|
||||
value = format_string(page["description"] || page["excerpt"]) || site_description
|
||||
filters.truncate(value, 280)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue