Skip to content
Snippets Groups Projects
Commit da6c4b35 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

change meta desc truncate method

parent 7f12a1f0
Branches
Tags
1 merge request!131SEO
...@@ -31,6 +31,16 @@ export class SeoSErvice { ...@@ -31,6 +31,16 @@ export class SeoSErvice {
const imageUrl = (post.content.og_image != null) ? const imageUrl = (post.content.og_image != null) ?
post.content.og_image : post.content.featureImage; 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 ? var description: string = post.content.meta_description ?
post.content.meta_description : `${post.content.excerpt.slice(0,136)}...`; post.content.meta_description : `${post.content.excerpt.slice(0,136)}...`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment