Skip to content

Commit 5af45cc

Browse files
NoahDragonJLHwung
authored andcommitted
Revert "Limit meta description length to 160 characters" (#2883)
1 parent 284c1b9 commit 5af45cc

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

lib/plugins/helper/open_graph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function openGraphHelper(options) {
7575
}
7676

7777
if (description) {
78-
result += meta('description', description.substring(0, 160), false); // Truncate meta description to 160 characters - SEO Best practice - See https://github.com/hexojs/hexo/issues/2809
78+
result += meta('description', description, false);
7979
}
8080

8181
if (keywords) {

test/scripts/helpers/open_graph.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -240,19 +240,6 @@ describe('open_graph', () => {
240240
result.should.contain(meta({property: 'og:site_name', content: 'foo'}));
241241
});
242242

243-
it('description - truncate meta description to 160 characters', () => {
244-
var ctx = {
245-
// 160 `a`s followed by some `b`s
246-
page: {description: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbb'},
247-
config: hexo.config,
248-
is_post: isPost
249-
};
250-
251-
var result = openGraph.call(ctx);
252-
253-
result.match('<meta name="description"[^>]+content="([^")]*)"')[1].length.should.be.at.most(160);
254-
});
255-
256243
it('description - page', () => {
257244
var ctx = {
258245
page: {description: 'test'},

0 commit comments

Comments
 (0)