Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make basePath customizable #4

Open
SigmundurMorkore opened this issue Jul 8, 2019 · 0 comments
Open

Make basePath customizable #4

SigmundurMorkore opened this issue Jul 8, 2019 · 0 comments

Comments

@SigmundurMorkore
Copy link

SigmundurMorkore commented Jul 8, 2019

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant