Skip to content

Make basePath customizable #4

Description

@SigmundurMorkore

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions