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

[Data Liberation] Edit static files directly in a git repository #2109

Draft
wants to merge 23 commits into
base: support-static-pages
Choose a base branch
from

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Dec 25, 2024

Motivation for the change, related issues

🚧 Experimental! Do not merge! 🚧

Experimenting for fun with editing WP_Filesystem files and implementing a WP_Git_Filesystem class.

$fs = new WP_Git_Filesystem(
    new WP_Git_Client(GIT_REPO_URL, [
        'author' => 'Adam Zieliński <[email protected]>',
        'committer' => 'Adam Zieliński <[email protected]>',
    ]),
    'main',
    '/pages'
);

// Every $fs operation creates a commit
$fs->put_contents('/index.md', '# Markdown file!' );
$fs->mkdir('/setup');
$fs->put_contents('/setup/01-introduction.md', '# Setup introduction' );
$fs->put_contents('/setup/02-installation.md', '# Install things' );
$fs->rmdir('/setup', ['recursive' => true']);

// In the future we could have a local index and batch all the
// updates to push as a single commit

CleanShot 2024-12-25 at 19 04 49@2x

CleanShot 2024-12-25 at 19 04 14@2x

@adamziel adamziel added [Type] Exploration An exploration that may or may not result in mergable code [Aspect] Data Liberation labels Dec 25, 2024
@adamziel adamziel changed the title [Data Liberation] Local files browser [Data Liberation] Edit static files directly in a git repository Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Aspect] Data Liberation [Type] Exploration An exploration that may or may not result in mergable code
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant