Giter Club home page Giter Club logo

Comments (5)

samyberkane04 avatar samyberkane04 commented on May 23, 2024

@rufuspollock

I found your issue intersting,I have solution .
do you agree that i contribute in this project ?
thank you .

from web3.

rufuspollock avatar rufuspollock commented on May 23, 2024

@samyberkane04 yes - please jump in and propose your solution or do a pull request.

from web3.

AceTheCreator avatar AceTheCreator commented on May 23, 2024

I think a simple approach to solving this issue is.

Firstly: Add an edit this page link or button in the MDX component

Secondly: Get the file path link using the flattened path returned in the slug.js page

Thirdly: The link ensures it takes the editor to the right edit version of the page on GitHub

Lastly: The editor can edit the page and create a PR

@rufuspollock what do you think?

from web3.

rufuspollock avatar rufuspollock commented on May 23, 2024

@AceTheCreator sounds good as an approach.

from web3.

rufuspollock avatar rufuspollock commented on May 23, 2024

Comment from @olayway in the PR #159 copied here:


Changes

  • 'Edit this page' button added at the bottom of the guide, claims, and concepts pages

Notes

I've arbitrarily added this option only for /guide, /claims/[...] and /concepts/[...] pages since it didn't make much sense to me to add it for non-wiki-like pages (e.g. notes from our podcasts which I thought should not be subject to external user's changes). However, not adding this button on a particular page doesn't really prevent a user from finding it directly to GitHub and committing changes.

Content protection

There is no way to create protection rules on GitHub for selected paths or files within a project = protection rules can only be set on a whole branch (but I may be wrong). Thus there seem to be a few options we could consider (I'm no expert in this subject so please take it with a grain of salt):

Solution A

Making the main branch protected and allowing commits only through PRs that require reviews from someone from Life Itself.

Solution B

Making the main branch protected and creating a separate non-protected branch, e.g. contributions that anyone could commit to.

  • potential issues: how to make this non-protected branch (contributions) up-to-date with main branch, so that the content the user sees on the webpage (sourced from main) and intends to edit is the same he will see when clicking on 'Edit this page' (redirects to the page file on contributions branch) are in constant alignment.
  • possible solution: GitHub Action on push that would automatically pull from main (after someone from Life Itself has pushed some changes) to contributions. However, there may occur some conflicting changes in this case in which such pull would fail, and further action would be required.
Solution C (The best option in my opinion)

Creating an unprotected branch e.g. contributions and creating a submodule of web3 repo, that would point to itself but to its unprotected branch (contributions). So, we would have:

  • contributions - unprotected branch with:
    • directories with pages we want others to easily commit to
  • main - protected branch with:
    • submodule pointing to the contributions branch of the repo

Flow:

  • Some user makes changes to any file and commits them to the contributions branch:
cd web3/submodule-with-unprotected-content
# modify files
git add .
git commit -m "modify submodule-with-unprotected-content files"
  • In order to make these changes reflected on the main branch we would do sth like this:
# on web3 repo main branch
git add submodule-with-unprotected-content
git commit -m "record submodule-with-unprotected-content new SHA1"
git push

Reference: https://stackoverflow.com/a/35307501

from web3.

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.