Closed kemenaran closed 1 year ago
@kemenaran If it can be customized according to the percentage, this should be the ultimate solution: for example, from 10% to 90% of the full text (if the description is defined in the preface), it is recommended to consider it!
@mattr- would you consider this improvement mergeable in the current state – or do you prefer to make it configurable?
280 characters feels like a twitter specific limitation. Regardless of that, a blanket truncation at 280 characters doesn't take into account word or sentence endings, and it feels like we should do that before this PR is mergeable.
@mattr- thanks for your review! I updated the PR to:
I also added tests, and a new documentation section describing the behavior.
Does that look reasonable to you?
Yup, I just pushed fixes to the rubocop issues, it should be good now.
Thanks for tackling this!
@jekyllbot: merge +minor
Great! Thanks for having a look into this, and for the maintenance work.
@jekyllbot @kemenaran
Thank you for your great efforts. Please tell me how to update the improved code. Because the plug-in has been installed before, no matter whether you use gem install jekyll-seo-tag
or gem update jekyll-seo-tag
, it will not help.
You'll need to wait on a plugin release or tell bundler to fetch the code from the git
repo in order to use this new feature.
Currently, on post pages, the value of the
description
,og: description
,twitter: description
andapplication/ld-json
tags represent the whole text of the post.Which means that the text of the post is included five times in the HTML document – adding to the page weight needlessly.
This commit ensures the description string is truncated to a sane value.