Skip to content

Feature request: Allow dynamic github edit links #312

@gskril

Description

@gskril

It would be helpful if editLink.pattern accepted a function with a path argument so the "Edit on Github" link could be customized per page.

Ideal usage would look something like this:

editLink: {
    pattern: (path) => {
      if (path.startsWith('/ensip/')) {
        return `https://github.com/ensdomains/ensips/edit/master/ensips/${path}.md`
      }

      return `https://github.com/ensdomains/docs/edit/master/src/pages/${path}`
    },
    text: 'Edit on Github',
  },

An example use case is ENS, where our ENSIP pages are generated from another repo at build time.

Related to ensdomains/docs#446

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions