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

Corrections on the meta tags for news.

parent 37ccef3c
......@@ -116,12 +116,13 @@ export class GhostContentResponse {
this.status = (data.status != null) ? data.status : '';
this.title = (data.title != null) ? data.title : '';
this.html = (data.html != null) ? data.html : '';
this.excerpt = (data.excerpt != null) ? data.excerpt : '';
this.meta_title = (data.meta_title != null) ? data.meta_title: this.title;
this.meta_description = (data.meta_description != null) ? data.meta_description : this.excerpt;
this.og_title=(data.og_title != null) ? data.og_title : this.title;
this.og_description=(data.og_description != null) ? data.og_description : this.excerpt;
this.excerpt = (data.excerpt != null) ? data.excerpt : '';
this.meta_description = data.meta_description ;
this.og_description=(data.og_description != null) ? data.og_description : this.meta_description;
this.featureImage = data.feature_image;
this.og_image = this.featureImage;
......
......@@ -31,16 +31,18 @@ export class SeoSErvice {
const imageUrl = (post.content.og_image != null) ?
post.content.og_image : post.content.featureImage;
var description: string = post.content.meta_description ?
post.content.meta_description : `${post.content.excerpt.slice(0,136)}...`;
const meta = [
{ name: 'description', content: post.content.excerpt },
{ name: 'description', content: description },
{ property: 'og:title', content: post.content.og_title },
{ property: 'og:description', content: post.content.og_description },
{ property: 'og:image', content: imageUrl },
];
this._setMeta(meta);
this._setTitle(post.content.title);
this._setTitle(post.content.meta_title);
}
setDatasetSEO(data: Metadata)
......@@ -97,6 +99,7 @@ export class SeoSErvice {
metatags.forEach((meta) => {
if (meta.content!= null) {
meta.content = meta.content.replace('\n', ' ');
this._metaService.updateTag(meta);
}
});
......
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