article related pages meta update and other improvements

This commit is contained in:
tmshv committed 2020-02-25 02:01:57 +03:00
1 parent 9e5ec860e8
commit 488ea6ec06
6 files changed
+41 -36

No files matched your search

+16 -8
View File
@@ -51,18 +51,26 @@ export class MetaBuilder {
}
build() {
const artifact = this.image.artifacts.fb
const image = {
image: artifact.src,
imageWidth: artifact.width,
imageHeight: artifact.height,
}
const image = this.buildImage()
return meta({
...this.data,
...image,
title: this.title,
description: this.description,
title: this.title ?? undefined,
description: this.description ?? undefined,
})
}
private buildImage() {
if (!this.image) {
return null
}
const artifact = this.image.artifacts.fb
return {
image: artifact.src,
imageWidth: artifact.width,
imageHeight: artifact.height,
}
}
}