strapi-starter-nuxt-blog
strapi-starter-nuxt-blog copied to clipboard
Feature request : handle media URLs in post content
Thank you for this starter. I wanted to suggest a feature: I think it could be useful to provide a helper that parses posts contents and adds the strapi server base URL to the media relatives paths (otherwise, media in posts contents can't be loaded).
For example (using String.replace
to be compatible with Node.js 14 and below) :
// media.js
export function parseStrapiMediaUrls(content) {
return content.replace(new RegExp("]\\(/uploads/", "g"), `](${process.env.strapiBaseUri}/uploads/`);
}
I tried to make a PR but apparently I don't have the access rights for that. Otherwise I would be glad to do it.