Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions plugins/push-md/docs/landing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Push MD - WordPress as the Git remote for agents</title>
<meta name="description" content="Push MD lets coding agents and Markdown-first teams work with WordPress content through Git while WordPress remains the source of truth.">
<meta name="theme-color" content="#101614">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Push MD">
<meta property="og:title" content="Push MD - WordPress as the Git remote for agents">
Expand All @@ -30,6 +31,7 @@
</a>
<nav class="site-nav" aria-label="Main navigation">
<a href="#how-it-works">Use cases</a>
<a href="#install">Clone demo</a>
<a href="#permissions">Permissions</a>
<a href="#agent-skills">Agent skills</a>
<a href="#faq">FAQ</a>
Expand Down Expand Up @@ -76,18 +78,18 @@ <h1 id="hero-title"><span class="md-token">#</span> Markdown in Git. WordPress i
<span class="terminal-status">trunk / WordPress remote</span>
</div>
<div class="terminal-summary" aria-label="Terminal tabs">
<span class="is-active">
<button class="is-active" type="button" data-terminal-demo="markdown" aria-pressed="true">
<strong>.md</strong>
Markdown
</span>
<span>
</button>
<button type="button" data-terminal-demo="roles" aria-pressed="false">
<strong>WP</strong>
Roles
</span>
<span>
</button>
<button type="button" data-terminal-demo="pull" aria-pressed="false">
<strong>pull</strong>
Admin edits
</span>
</button>
</div>
<div class="terminal-body">
<div class="terminal-output" id="landing-terminal-output" aria-live="polite"></div>
Expand Down Expand Up @@ -274,29 +276,30 @@ <h3><span class="md-token">###</span> Is this a static site generator?</h3>
<div class="section-copy">
<h2 id="install-title"><span class="md-token">##</span> Clone WordPress like a Git remote.</h2>
<p>
Install Push MD, authenticate with a WordPress Application Password, then clone
the <code>trunk</code> branch from your site. Any Git client can talk to WordPress directly.
Clone the public read-only remote for a first look. When you are ready to push
back, install Push MD on your own WordPress site and authenticate with an
Application Password.
</p>
</div>
<div class="install-panel">
<ol class="install-steps">
<li>Install and activate the Push MD plugin.</li>
<li>Create or use a WordPress Application Password.</li>
<li>Clone the WordPress Git remote and work on <code>trunk</code>.</li>
<li>Try the read-only public remote from this site.</li>
<li>Open the Markdown files with an editor or agent.</li>
<li>Install the plugin on your WordPress site when you are ready to accept pushes.</li>
</ol>
<div class="code-block">
<code id="clone-command">git clone https://example.com/wp-json/git/v1/md.git my-site</code>
<code id="clone-command">git clone https://pushmd.blog/wp-json/git/v1/md.git my-site</code>
<button class="copy-button" type="button" data-copy-target="clone-command">Copy</button>
</div>
<p class="install-note">Pushes to other branches are rejected. WordPress remains the source of truth.</p>
<p class="install-note">The public remote is pullable for a first look. Pushes need the plugin on your own authenticated WordPress site.</p>
</div>
</section>
</main>

<footer class="site-footer">
<p>An Automattic experiment by <a href="https://adamadam.blog/">zieladam</a> and <a href="https://piszek.com">artpi</a></p>
<div>
<a href="https://github.com/WordPress/php-toolkit/tree/trunk/plugins/push-md">GitHub</a>
<a href="https://github.com/Automattic/php-toolkit/tree/trunk/plugins/push-md">GitHub</a>
</div>
</footer>

Expand Down
49 changes: 44 additions & 5 deletions plugins/push-md/docs/landing/landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ pre {
padding: clamp(34px, 5vw, 58px) 0 46px;
}

.hero-copy,
.section-copy,
.authority-strip article,
.use-case-card,
.faq-item,
.install-panel {
min-width: 0;
}

.callout-label {
margin: 0 0 12px;
color: var(--hash);
Expand Down Expand Up @@ -316,7 +325,7 @@ pre {
background: #191817;
}

.terminal-summary span {
.terminal-summary button {
display: inline-flex;
align-items: baseline;
gap: 8px;
Expand All @@ -329,12 +338,24 @@ pre {
border-radius: 7px 7px 0 0;
background: #24211e;
color: #bcb2a3;
cursor: pointer;
font: inherit;
font-size: 12px;
line-height: 1.2;
white-space: nowrap;
}

.terminal-summary span.is-active {
.terminal-summary button:hover,
.terminal-summary button:focus-visible {
color: #efe8d8;
outline: 0;
}

.terminal-summary button:focus-visible {
box-shadow: inset 0 0 0 1px rgba(145, 214, 238, 0.72);
}

.terminal-summary button.is-active {
background: #151515;
color: #efe8d8;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
Expand Down Expand Up @@ -883,6 +904,12 @@ pre {
}

@media (max-width: 720px) {
html,
body {
width: 100%;
overflow-x: hidden;
}

body {
background-size: 100% 30px;
}
Expand Down Expand Up @@ -912,15 +939,19 @@ pre {
}

.markdown-document {
padding-inline: 16px;
width: calc(100vw - 32px);
max-width: calc(100vw - 32px);
padding-inline: 0;
margin-inline: 16px;
overflow: hidden;
}

.hero {
padding: 30px 0 34px;
}

.hero h1 {
font-size: 40px;
font-size: 35px;
line-height: 1.18;
}

Expand All @@ -929,8 +960,16 @@ pre {
font-size: 16px;
}

.hero-actions {
display: grid;
grid-template-columns: 1fr;
}

.hero-actions .button {
flex: 1 1 180px;
min-width: 0;
padding-inline: 10px;
white-space: normal;
text-align: center;
}

.terminal-card {
Expand Down
99 changes: 84 additions & 15 deletions plugins/push-md/docs/landing/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
var inputRowEl = inputEl ? inputEl.closest( '.terminal-input-row' ) : null;
var cwdEl = document.getElementById( 'landing-terminal-cwd' );
var titleEl = document.getElementById( 'landing-terminal-title' );
var checkoutDir = 'site';
var remoteUrl = 'https://example.com/wp-json/git/v1/md.git';
var tabButtons = document.querySelectorAll( '[data-terminal-demo]' );
var checkoutDir = 'my-site';
var remoteUrl = 'https://pushmd.blog/wp-json/git/v1/md.git';
var cwd = '~';
var history = [];
var historyIndex = 0;
Expand All @@ -42,19 +43,33 @@
var revisionNumber = 184;
var diffRemoveLine = 'Old CTA copy';
var diffAddLine = 'Keep WordPress in charge';
var files = {
var initialFiles = {
'AGENTS.md': '# WordPress content guidelines\n\n- Keep block markup valid.\n- Pull before editing stale content.\n- Let WordPress roles decide who can publish.\n',
'README.md': '# Push MD demo remote\n\nThis read-only repository is exported from pushmd.blog so you can clone WordPress-shaped Markdown immediately.\n',
'page/home.md': '# Home\n\nOld CTA copy\n',
'post/hello-world.md': '# Hello World\n\nHello from WordPress.\n',
'wp_template_part/header.html': '<!-- wp:site-title /-->\n<!-- wp:navigation /-->\n',
'wp_global_styles/theme.json': '{\n "version": 3,\n "styles": {\n "color": {\n "background": "#faf8f1"\n }\n }\n}\n'
};
var files = cloneInitialFiles();
var pendingFiles = {};

if ( ! outputEl || ! inputEl || ! inputGhostEl || ! inputRowEl || ! cwdEl || ! titleEl ) {
return;
}

function cloneInitialFiles() {
var clone = {};
var filePath;

for ( filePath in initialFiles ) {
if ( Object.prototype.hasOwnProperty.call( initialFiles, filePath ) ) {
clone[filePath] = initialFiles[filePath];
}
}
return clone;
}

function appendLine( text, className ) {
var line = document.createElement( 'div' );
line.className = 'terminal-line';
Expand Down Expand Up @@ -105,19 +120,58 @@
}
}

function bootTranscript() {
function resetDemoState() {
cwd = '~';
history = [];
historyIndex = 0;
dirtyPath = '';
aheadMessage = '';
revisionNumber = 184;
diffRemoveLine = 'Old CTA copy';
diffAddLine = 'Keep WordPress in charge';
files = cloneInitialFiles();
pendingFiles = {};
updatePrompt();
updateInputGhost();
}

function bootTranscript( demo ) {
outputEl.textContent = '';
appendLine( 'Push MD command emulator', 'terminal-success' );
appendLine( 'This public demo mirrors commands you can run with any Git client.', 'terminal-muted' );
appendLine( 'The public remote is pullable now. Pushes need your own authenticated WordPress site.', 'terminal-muted' );
appendLine( '' );
runCommand( 'git clone ' + remoteUrl + ' ' + checkoutDir, { silentHistory: true } );
runCommand( 'cd ' + checkoutDir, { silentHistory: true } );
runCommand( 'codex "Update page/home.md"', { silentHistory: true } );
runCommand( 'git diff -- page/home.md', { silentHistory: true } );
runCommand( 'git commit -am "Update home page"', { silentHistory: true } );
runCommand( 'git push origin trunk', { silentHistory: true } );

if ( demo === 'roles' ) {
runCommand( 'git clone ' + remoteUrl + ' ' + checkoutDir, { silentHistory: true } );
runCommand( 'cd ' + checkoutDir, { silentHistory: true } );
runCommand( 'codex "Update page/home.md"', { silentHistory: true } );
runCommand( 'git commit -am "Update home page"', { silentHistory: true } );
runCommand( 'git push origin trunk', { silentHistory: true } );
} else if ( demo === 'pull' ) {
runCommand( 'git clone ' + remoteUrl + ' ' + checkoutDir, { silentHistory: true } );
runCommand( 'cd ' + checkoutDir, { silentHistory: true } );
runCommand( 'git pull', { silentHistory: true } );
runCommand( 'git status', { silentHistory: true } );
} else {
runCommand( 'git clone ' + remoteUrl + ' ' + checkoutDir, { silentHistory: true } );
runCommand( 'cd ' + checkoutDir, { silentHistory: true } );
runCommand( 'tree', { silentHistory: true } );
runCommand( 'cat AGENTS.md', { silentHistory: true } );
}
appendLine( '' );
appendLine( 'Try: git status, git pull, ls, cat AGENTS.md, codex "Update page/home.md", help', 'terminal-muted' );
appendLine( 'Try: git status, git pull, ls, cat README.md, codex "Update page/home.md", help', 'terminal-muted' );
}

function activateDemo( demo ) {
tabButtons.forEach(
function ( button ) {
var isActive = button.getAttribute( 'data-terminal-demo' ) === demo;
button.classList.toggle( 'is-active', isActive );
button.setAttribute( 'aria-pressed', isActive ? 'true' : 'false' );
}
);
resetDemoState();
bootTranscript( demo );
}

function runCommand( command, options ) {
Expand Down Expand Up @@ -269,6 +323,12 @@
appendLine( 'Everything up-to-date', 'terminal-muted' );
return;
}
if ( remoteUrl.indexOf( 'pushmd.blog' ) !== -1 ) {
appendLine( 'remote: public Push MD demo is read-only', 'terminal-error' );
appendLine( 'remote: install Push MD on your WordPress site to accept authenticated pushes', 'terminal-muted' );
appendLine( 'error: failed to push some refs to origin', 'terminal-error' );
return;
}

revisionNumber++;
appendLine( 'Enumerating objects: 5, done.' );
Expand Down Expand Up @@ -327,6 +387,7 @@
function printTree() {
appendLine( '.' );
appendLine( '|-- AGENTS.md' );
appendLine( '|-- README.md' );
appendLine( '|-- page/' );
appendLine( '| `-- home.md' );
appendLine( '|-- post/' );
Expand Down Expand Up @@ -491,10 +552,18 @@
updateInputGhost();
}
);
tabButtons.forEach(
function ( button ) {
button.addEventListener(
'click',
function () {
activateDemo( button.getAttribute( 'data-terminal-demo' ) || 'markdown' );
}
);
}
);

updatePrompt();
updateInputGhost();
bootTranscript();
activateDemo( 'markdown' );
}

function markCopied( button ) {
Expand Down
1 change: 1 addition & 0 deletions plugins/push-md/docs/landing/wp-json/git/v1/md.git/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/heads/trunk
4 changes: 4 additions & 0 deletions plugins/push-md/docs/landing/wp-json/git/v1/md.git/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4bfb0399fb165468daeaf69cf49d569249c5a2dc refs/heads/trunk
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xKÊÉOR0±`°QÔÕU(/°*Î,IÕ-É,ÉIUÐ×յらç%–e¦'–dæçAÄÎ(2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# pack-refs with: peeled fully-peeled sorted
4bfb0399fb165468daeaf69cf49d569249c5a2dc refs/heads/trunk
Loading