Commit da6c4b35 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

change meta desc truncate method

parent 7f12a1f0
......@@ -31,6 +31,16 @@ export class SeoSErvice {
const imageUrl = (post.content.og_image != null) ?
post.content.og_image : post.content.featureImage;
var description: string = '';
if (post.content.meta_description) {
description = post.content.meta_description;
}
else {
description = post.content.excerpt;
if (description.length > 140 ) {
description = `${description.substr(0,description.substr(0,136).lastIndexOf(' '))}...`;
}
}
var description: string = post.content.meta_description ?
post.content.meta_description : `${post.content.excerpt.slice(0,136)}...`;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment