-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Edit Site: Add theme exporter. #21958
Conversation
Size Change: +61.2 kB (6%) 🔍 Total Size: 877 kB
ℹ️ View Unchanged
|
*/ | ||
import getBaseThemeZip from './get-base-theme-zip'; | ||
|
||
export default function ThemeExporter( { ids, templatePartIds } ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably allow this to be disabled somehow and account for permissions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disabled somehow
Through the editor settings, bootstrapped on the server? So that it can be both filtered and toggled with a store action?
account for permissions
Shouldn't anyone who can edit templates also be able to export them?
the bundle size increase here is not small. I believe this is better served by an export on the server instead of a JS based export. |
Agreed, I'll move it to the server once #21959 lands. |
Some more (potentially relevant) changes here: #21980 😅 |
@epiqueras why does it need a base theme to be set up? |
Are you talking about https://github.com/WordPress/gutenberg/blob/0426dd2d20357cfecb1d326961e71d619a276010/packages/edit-site/src/components/header/theme-exporter/get-base-theme-zip/content.js? For all the content a theme ZIP file needs besides the templates. E.g., the entry PHP file. |
Yes, I don't think we should include anything there (no style css, no theme supports until we can support theme.json, etc) yet. |
👍 |
One thing that came up when discussing this in the |
I tried to test this but am receiving errors: wp db reset --yes go to gutenberg settings > enable Full Site Editing > save When visiting the base_url/home of my website, I receive: while johannes is being used: When i visit: http://my.site/wp-admin/admin.php?page=gutenberg-edit-site ; I receive the same error uncaught argumentcounterror as above. |
Try enabling the demo block templates experiment. |
nope, a similar issue:
|
@skorasaurus Are you sure you're testing this branch? At the time of the most recent commit here, |
Was once I ran a couple git clean commands and |
0426dd2
to
32af450
Compare
Closed in favor of #22922, which creates the ZIP file on the server to avoid the bundle size increase. |
Closes #19260
Description
This PR adds a theme exporter button to the site editor header's "More" dropdown.
The exporter uses @melchoyce's Johannes theme as the base for the theme zip file and adds the site editor's templates and template parts.
How to test this?
Try exporting templates/parts with different modifications and verify that the exported files match what you have on the editor.
Screenshots
Types of Changes
New Feature: The site editor now has a theme exporter button for exporting customized templates and template parts in a theme zip file.
Checklist: