Skip to content
Snippets Groups Projects
Commit a50f1334 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix(post): post image broken links

parent d7889aad
No related branches found
No related tags found
1 merge request!104Dev
......@@ -72,13 +72,15 @@ export class PostsService {
if (!postData.custom_excerpt) {
postData.excerpt = 'Inconnu';
}
const test = `<p>Test qui va bien Test qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bienTest qui va bien.</p><figure class=\"kg-card kg-image-card\"><img src=\"https://resin-dev.grandlyon.com/content/images/2022/01/resin-logo-1200x630.png\" class=\"kg-image\" alt loading=\"lazy\" width=\"1200\" height=\"630\" srcset=\"https://resin-dev.grandlyon.com/content/images/size/w600/2022/01/resin-logo-1200x630.png 600w, https://resin-dev.grandlyon.com/content/images/size/w1000/2022/01/resin-logo-1200x630.png 1000w, https://resin-dev.grandlyon.com/content/images/2022/01/resin-logo-1200x630.png 1200w\" sizes=\"(min-width: 720px) 720px\"></figure>`;
// Handle image display. Rewrite image URL to fit ghost infra issue.
if (postData.feature_image && !this.configService.isLocalConf()) {
// if (postData.feature_image && !this.configService.isLocalConf()) {
if (postData.feature_image) {
postData.feature_image = `https://${this.configService.config.host}/blog/content${
postData.feature_image.split('/content')[1]
}`;
const regex = /(https?:\/\/ghost):(\d*)?/g;
postData.html = postData.html.replace(regex, `https://${this.configService.config.host}`);
postData.html = postData.html.replace(regex, `https://${this.configService.config.host}/blog`);
}
return postData;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment