I'd love to be able to use this with NetlifyCMS. But NetlifyCMS does not use actual relative paths, which results in a weird url when it's parsed by dev-to-git.
The solution is to not rely on the markdown file's basePath, but I suggest making it configurable.
if (path) {
const basePath: string = 'static'; // This solves my issue, but actual solution might make this customizable?
const assetPath = path.substr(2);
localImagesToReplace.push({
localImage: image,
remoteImage: `![${alt || ''}](https://raw.githubusercontent.com/${this.articleConfig.repository.username}\/${
this.articleConfig.repository.name
}/master/${basePath}/${assetPath}${title ? ` '${title}'` : ``})`,
});
}
I of course completely understand if you don't want to implement this. This package is still super awesome :)
I'd love to be able to use this with NetlifyCMS. But NetlifyCMS does not use actual relative paths, which results in a weird url when it's parsed by dev-to-git.
The solution is to not rely on the markdown file's basePath, but I suggest making it configurable.
I of course completely understand if you don't want to implement this. This package is still super awesome :)