Giter Club home page Giter Club logo

Comments (9)

dotansimha avatar dotansimha commented on September 25, 2024 2

ooh, now I get it. thanks for clarifying. that being said can't we add another field there to control the "Edit this page on Github" URL? n1ru4l/envelop@main/website/src/lib/plugins.ts#L38 πŸ‘€

I assume it is possible, probably just point to a specific file, something like that:

editLink: false | string // false to disable, in case of an external link or unknown, and a string is to set the path to the GH file 

But we also need a way to pass this from pluginsArr to getStaticPaths and then all the way to the Edit component (@B2o5T is it even possible?)

from docs.

dotansimha avatar dotansimha commented on September 25, 2024 1

@YassinEldeeb I think this happens because of the lack of support for the dynamic pages?

from docs.

dotansimha avatar dotansimha commented on September 25, 2024 1

mmm... interesting. can you please elaborate more? I don't have much context about how this's working

For all regular pages (md, mdx) in our websites, the path to the file when clicking on "Edit this page" is inferred from the MDX file (which is static).
For Envelop plugins pages, we have a "dynamic" page that is being filled by the fact that we implement getStaticPaths, you can find it here:
https://github.com/n1ru4l/envelop/blob/main/website/src/pages/plugins/%5Bname%5D.mdx and https://github.com/n1ru4l/envelop/blob/main/website/src/lib/plugin-get-static-props.ts#L7

So when Next builds the pages, it uses getStaticPaths to generate the URLs. The Edit this page takes the NextJS route name by default (the static one).

@B2o5T can refine my answer and correct me if I'm wrong

from docs.

YassinEldeeb avatar YassinEldeeb commented on September 25, 2024 1

oh, so it's a matter of how to pass these metadata this far? πŸ€” curious about @B2o5T's opinion as well

from docs.

dotansimha avatar dotansimha commented on September 25, 2024 1

I guess so. I think the edit button is coming from Nextra (see https://github.com/shuding/nextra/blob/73241b3fee58f0318e9349a5eb7650a7cd55a4e3/packages/nextra-theme-docs/src/constants.tsx#L33 ) and it's using getGitEditUrl.
I guess we can override this in https://github.com/n1ru4l/envelop/blob/main/website/theme.config.tsx#L6 and have a custom editLink.component that uses custom behavior for the plugins pages of Envelop?

from docs.

dimaMachina avatar dimaMachina commented on September 25, 2024 1

closed since was fixed for envelop

from docs.

YassinEldeeb avatar YassinEldeeb commented on September 25, 2024

πŸ€” interesting. can you please elaborate more? I don't think I have much context about how this's working

from docs.

YassinEldeeb avatar YassinEldeeb commented on September 25, 2024

ooh, now I get it. thanks for clarifying. that being said can't we add another field there to control the "Edit this page on Github" URL? https://github.com/n1ru4l/envelop/blob/main/website/src/lib/plugins.ts#L38 πŸ‘€

from docs.

YassinEldeeb avatar YassinEldeeb commented on September 25, 2024

oh wait, you already have this field there https://github.com/n1ru4l/envelop/blob/main/website/src/lib/plugins.ts#L81, but why it's not working/being used

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.