A WordPress plugin to create Blockbase child themes

Overview

Create Blockbase Theme

A WordPress plugin to create Blockbase child themes

Find out more about Blockbase at blockbasetheme.com

Step 1 – Setup

Install and activate Blockbase (or a Blockbase child theme if you want your new theme based on it instead), and the Create Blockbase Theme plugin.

Step 2 – Style Customizations

Make changes to your site design using the Customizer and Site Editor.

Step 3 – Templates

Edit your templates using the Site Editor. For some things you might need to edit the template files again later.

Step 4 – Export

In the WordPress Admin Dashboard, under Appearance there will be a new page called “Create Blockbase Theme”.

You can add the details for the theme here. These details will be used in the style.css file. When you click the “Create Blockbase Theme” button, a zip file will be downloaded which will contain all the files for your theme.

Comments
  • Added a 'save' option

    Added a 'save' option

    Added a 'Save Theme' option to save the theme.json and template changes to local theme folder and clear user changes.

    Addresses: #45 and enables a development workflow.

    image

    To Test:

    • Start with a theme activated. (I have done most testing with Archeo but ANY theme [parent or child, Blockbase or not] should work fine.)
    • Make sure you begin with NO user changes to the theme (such as color, font or template changes)
    • Make changes to the theme using the FSE (or the Customizer). A good test for this is to change the color values of the theme colors.
    • Make changes to a template part (for instance add a simple paragraph block)
    • Make a change to a template (another simple change you can easily see)
    • Create a brand-new template and template part.
    • Use the Plugin to 'Overwrite'.
    • Load the site (view). Note that it still looks the same (global style changes and template changes are still in tact)
    • Attempt to "Reset to Defaults" the Global Styles using the FSE (nothing changes)
    * Attempt to "Clear Customizations" from the template part you previously edited. Note that it is no longer an option. * Observe the changes made to theme.json file in the theme in the filesystem. Note that the Global Styles changes made in the FSE are now represented in the theme.json file in `/wp-content/themes/SLUG/theme.json` * Note the changes made to templates in the theme filesystem, as well as additional templates/parts added based on the templates created with the FSE

    This change also clears user settings when a theme is 'saved' addressing #50

    opened by pbking 14
  • Downloads empty zip file

    Downloads empty zip file

    Hi,

    When I go to Appearance > Create Blockbase Theme, fill in the fields and click the Create Blockbase Theme button, it downloads a .zip file succesfully, but the file is 0 bytes. When I try to unzip it, I get a .zip.cpgz file, which I'm unable to open.

    I have the following installed:

    WordPress 5.82 Blockbase 1.4.3 Gutenberg 11.9.0 (no other plugins)

    Thanks, Troy

    opened by troytempleman 14
  • Fonts for non universal themes

    Fonts for non universal themes

    Thinking about updating the plugin to include non universal themes, the problem with choosing fonts for the theme comes to mind. Here's an idea:

    On the form we can include the option to add a specific font, then generate a functions.php file that enqueues that. We would have to add that same font to the theme.json file we are generating too.

    How many fonts can a user choose for a theme? How do we handle different weights/styles? Do we include the font files or do we use google fonts links?

    enhancement 
    opened by MaggieCabrera 12
  • Add/standalone themes

    Add/standalone themes

    This work borrows very heavily from @MaggieCabrera 's work in #32.

    This works exporting any parent theme as a standalone theme.

    To test attempt to export ALL THREE kinds of themes:

    • GRANDCHILD : Activate a Blockbase CHILD theme (such as Geologist). After making changes export the theme. It should be a BLOCKBASE child theme with all of the theme.json values from the activated theme as well as any changes you have made. The child theme's /assets/theme.css resource should be included. Templates and template parts from the active theme should also be included.
    • CHILD : Activate Blockbase. After making changes export the theme (selecting 'Child them of the current active theme' from the Create Block Theme page). The exported theme.json should ONLY include changes made by the user. The /assets/theme.css file should be empty and only changes made to templates and template-parts should be included. Repeat the process with a non-Blockbase Block theme (such as TwentyTwentyTwo).
    • STANDALONE : Activate Blockbase. After making changes export the theme (selecting 'Standalone theme' from the Create Block Theme page). The exported theme.json should include ALL of the settings from Blockbase as well as any changes you made. The /assets/theme.css file should include the contents of Blockbase's /assets/ponyfill.css file. That /assets/theme.css file should be automatically loaded (in both the view and editor). Likewise any fonts selected (as defined in the theme.json) should be loaded (accomplished by the bare-bones functions.php file included in the generated theme. Repeat the process with a non-Blockbase Block theme (such as TwentyTwentyTwo)

    Note: This does NOT YET export any of the theme's PATTERNS. As such any of the templates that leverage those patterns will not work.

    opened by pbking 10
  • Filter templates and JSON from result when using Blockbase as base theme

    Filter templates and JSON from result when using Blockbase as base theme

    When the base theme is BLOCKBASE:

    only export theme.json settings modified by the user do not export any block templates/parts except those modified by the user

    NOTE: When exporting with a CHILD theme as the base then UNMODIFIED templates/parts that originated in Blockbase are still exported. This is a bug.

    opened by pbking 9
  • Save a theme variation

    Save a theme variation

    This new option saves the users global styles changes into a variation instead of a child theme or a new clone of the theme. I opted in for the easiest way to do this, saving the file locally with a generic file name and downloading the zip file, but it's up for discussion if we want to do it this way:

    • Should we ask the user for a variation name?
    • Should the exported ZIP file only include the variation or the whole theme included like in this case?
    • Is the wording on the new option clear for what the feature does?
    Screenshot 2022-07-26 at 10 17 22

    Closes #89

    enhancement 
    opened by MaggieCabrera 8
  • Embed Google fonts and local font files in theme

    Embed Google fonts and local font files in theme

    What?

    This PR adds 2 sections to the plugin that enables the user to:

    • Embed Google Font assets and font face definitions to the active theme.
    • Embed local Font assets and font face definitions to the active theme.

    Why?

    The objective is to add a simple way to embed font assets in a block theme that after that you can export with the other plugin options.

    How?

    These new section work this way:

    Embed Google fonts:

    1. Gets a list of the available Google fonts from Google fonts API. If the API is not working it uses the stored JSON file as a fallback resource.
    2. When the user selects a font, all available variants are loaded to generate the preview.
    3. After the user selects the desired variants, and clicks the "Add fonts to the theme" button, the font files are written to the theme assets and the font face definitions are added to the theme's theme.json file.

    Embed local font files:

    The font file selected by the user is added to the theme assets/fonts folder and the font face definitions are added to the theme's theme.json file.

    Screenshots

    Adding Google Font:

    Screencast from 22-09-22 16:57:49.webm

    Adding local font asset:

    Screencast from 29-09-22 15:20:03.webm

    opened by matiasbenedetto 6
  • Create boilerplate theme

    Create boilerplate theme

    Sorry if this question is naive!

    What do you think about adding a fifth option to the plugin — create a new boilerplate theme from scratch, maybe based on block-canvas or something like it?

    When I meet folks that are new to block theming, the first thing they always ask is for a reference point — a starter, boilerplate block theme. Also the name of this plugin implies it could create a "new" theme, to me, maybe disconnected from the currently active one. (This is the perspective of someone who has used "create-react-app" before coming to WordPress, and using that utility results in a blank application, granted there's more tooling and overhead involved there because of webpack...)

    This might make more sense as a CLI or maybe even in Gutenberg itself, but wanted to ask in any case.

    opened by jffng 6
  • Refactor w/ boilerplate & encapsulate logic

    Refactor w/ boilerplate & encapsulate logic

    This PR continues the work in #39 and refactors that work in a number of ways:

    The plugin is refactored to use the structure from here. (I may not have done that correctly, but I hope it's a good start...)

    Logic has been broken into smaller functions where possible.

    • EXPORTING a PARENT theme: Activate a parent theme (Blockbase and TTT are two examples I've experimented with). Make changes using FSE to templates and global styles. Select the "Export" option. Note that the zip file contains everything in the original theme but theme.json, templates and parts have user changes integrated.
    • CREATING CHILD: Activate a parent theme (Blockbase/TTT) and make changes. Select the "Create child..." option. Note that the zip file contains ONLY the theme.json file with the changes you made as well as templates/parts folders containing modifications you made
    • CLONING a PARENT: (This used to be called the "Standalone" option). Activate a parent theme. Make changes. Select the "Clone" option. Note that the zip contains everything available from an EXPORT option but with new metadata in style.css NOTE: The resulting theme will NOT have namespaced values changed. This is a limitation noted in the instructions.
    • EXPORTING a CHILD theme: Activate a child theme (Geologist is an example I experimented with). make changes and select the "Export" option. You will see the theme exported with the changes to theme.json and templates integrated.
    • CREATING A SIBLING theme: This one is still a work-in-progress. GOAL: Activate a child theme and make changes. Choose the "Create Sibling..." option. Note that the zip contains everything that the currently activated theme provided as well as the user changes, but with a different style.css metadata creating a new child theme with the same parent as the currently activated theme, with all of the customizations from the currently activated theme as well as from the user. NOTE: The resulting theme will NOT have namespaced values changed. This is a limitation noted in the instructions.
    opened by pbking 6
  • Generate themes from any block theme

    Generate themes from any block theme

    This PR refactors the plugin so that it can be used with any block theme, not just Blockbase. These are the cases that it covers:

    • If the active theme is a classic theme: it will show an error.
    • If the active theme is a block theme child of another theme: the generated theme will be a child theme of the parent of the active theme, copying the template files and settings of the active theme plus the user changes on templates and Global Styles. I've tested this scenario using Geologist.
    • If the active theme is a standalone block theme: the form will show two options for the new theme. I've tested this one with Remote and Blockbase.
      • We can generate a child theme of the active theme. The new theme will only contain the user changes in templates and Global Styles, the rest is inherited from the parent.
      • We can generate a standalone based on the active theme. The new theme will be a copy of the active theme plus the customizations made by the user.
    opened by MaggieCabrera 6
  • Add function to gather CSS to be exported for themes

    Add function to gather CSS to be exported for themes

    This change will export CSS for the new theme.

    When building a BLOCKBASE CHILD theme no CSS should be exported. When building a BLOCKBASE GRANDCHILD (for instance using Geologist as the source theme) then the SOURCE THEME's CSS should be exported.

    Additionally this will export any CSS in the styles.css file into the child's /assets/theme.css class.

    Evaluated with Blockbase and Geologist.

    NOTE: This code will also export STANDALONE themes (from Blockbase) which would include blockbase's ponyfill.css. However the plugin doesn't yet export standalone themes so this portion isn't testable yet.

    opened by pbking 5
  • Remove Font Family option does not remove fonts from /assets/

    Remove Font Family option does not remove fonts from /assets/

    When you click Remove Font Family (or Remove for individual), the fonts are not removed from the /assets/ directory. While they are no longer listed on the Manage Theme Fonts screen, this is not expected behavior. Imagine a user adding/removing 100 fonts, and having those files accumulate in the /assets/ directory.

    [Feature] Font Management 
    opened by bgardner 1
  • Ability to save template changes

    Ability to save template changes

    Original Tweet suggestion from @ciorici: https://twitter.com/ciorici/status/1603366366609920000?s=20&t=QTFjskYeDw6_26_QmjsGDA

    update-template-file

    The ability to customize template parts is already available as a feature of Site Editing. However, for theme builders it would expedite workflows to have the ability to overwrite template parts directly within the Site Editor.

    Alongside the “Clear customizations” it would be possible to add another option for “Overwrite with new customizations”. This would be a destructive action and immediately overwrite the entire template part in the theme.

    enhancement 
    opened by colorful-tones 2
  • Remove absolute URLs from images in block markup

    Remove absolute URLs from images in block markup

    It would be great if this plugin could remove absolute image URLs from images in block markup, either on export or via a separate button somewhere.

    Currently, any images that are inserted into a template need to have their URLs manually changed to be relative to the theme directory in order for them to be successfully used outside of the build context (i.e. the local environment or dev environment where the site is being built).

    For example, changing an image URL like this:

    <!-- wp:cover {"url":"https://localsite.com/wp-content/uploads/2022/12/imagefile.png"...
    

    To this:

    <!-- wp:cover {"url":"<?php echo esc_url( get_stylesheet_directory_uri() ) . '/assets/images/imagefile.png'; ?>"...
    

    The above solution would require the template file to be converted from HTML to PHP. It would be good to hear if there's a better way!

    enhancement 
    opened by mikachan 0
  • Errors for

    Errors for "Create child of..." and "Clone..." options in new installation

    I currently face the following behaviour with version 1.3.8 of the plugin:

    1. Create a new WordPress installation (with Local, see specs below)
    2. Install the Create Block Them plugin
    3. Appearance > Create Block Theme > Create child of Twenty Twenty-Three

    This results in the below screen. The same happens with the Clone Twenty Twenty-Three option.

    Screenshot 2022-12-01 at 02 00 25 Screenshot 2022-12-01 at 02 00 50 Screenshot 2022-12-01 at 02 01 04

    WordPress specs:

    • WordPress: v6.1.1
    • PHP: v8.1.9
    • MySQL: v8.0.16
    • Local: v6.5.2

    What could be the reason for this error?

    bug 
    opened by weibeld 1
  • Creating a style variation enhancements

    Creating a style variation enhancements

    1. Write the name the user enters in the form to the style variation file as the title attribute

    Currently, when creating a global styles variation using the option in the plugin, the title attribute for the new style variation file is not set. This could be taken from the name field and written to the style variation JSON.

    1. Consider only writing the saved JSON in the database to the style variation file

    Additionally, the entire theme.json is read, and then the updated styles are added to the JSON object. Then that entire object is written to the style variation file. However, it is possible to just write the JSON object stored in the database for that new style variation.

    opened by jonathanbossenger 1
Releases(v1.3.8)
  • v1.3.8(Nov 18, 2022)

    • Fixes the spelling of definition
    • Fixing readme contributors
    • Add contributor username to readme
    • Update GitHub action to avoid deprecation warning
    • Update Google Fonts JSON data from API
    • Update Google Fonts JSON data from API
    • Check permission before running functions that need file write permissions
    • Allow previewing system font
    Source code(tar.gz)
    Source code(zip)
  • v1.3.7(Oct 26, 2022)

  • v1.3.6(Oct 26, 2022)

  • v1.3.5(Oct 26, 2022)

  • v1.3.4(Oct 26, 2022)

  • v1.3.3(Oct 26, 2022)

  • v1.3.2(Oct 26, 2022)

  • v1.3.1(Oct 26, 2022)

  • v1.3.0(Oct 26, 2022)

    • Updating google fonts data
    • Force https to load Google fonts preview
    • Add the ability to select/unselect all google font variants
    • Merge branch 'trunk' into try/manage-fonts
    • Update google fonts JSON data automatically using a repo action
    • Merge branch 'trunk' into release-action
    • Merge branch 'trunk' into try/manage-fonts
    • Merge branch 'try/manage-fonts' into release-action
    • Manage theme fonts
    • Automate release: build, version bump, changelog, deploy to wp.org
    • Automate release
    Source code(tar.gz)
    Source code(zip)
  • v1.2.3(Oct 6, 2022)

    What's Changed

    • Check for nonce index by @ramonjd in https://github.com/WordPress/create-block-theme/pull/120
    • Validating mime type of font file on server side by @matiasbenedetto in https://github.com/WordPress/create-block-theme/pull/119
    • adding translation domain by @matiasbenedetto in https://github.com/WordPress/create-block-theme/pull/121
    • Bump version and changelog by @jffng in https://github.com/WordPress/create-block-theme/pull/122

    New Contributors

    • @ramonjd made their first contribution in https://github.com/WordPress/create-block-theme/pull/120

    Full Changelog: https://github.com/WordPress/create-block-theme/compare/v1.2.2...v.1.2.3

    Source code(tar.gz)
    Source code(zip)
  • v1.2.2(Oct 5, 2022)

  • v1.2.0(Oct 3, 2022)

    = 1.2.0 = Embed Google fonts and local font files in theme (#113) Change button text (#112) Add check and directory creation for template and parts folders. (#110) Change theme.json schema of blank theme if Gutenberg isn't installed. (#107)

    Source code(tar.gz)
    Source code(zip)
  • v.1.2.1(Oct 3, 2022)

  • v1.1.3(Aug 30, 2022)

    = 1.1.3 = update links, screenshots of the new changes (#97) Add $schema and use Gutenberg classes (#99) Update readme to include latest features (#100) Generate $schema URL in the same way as core. (#105)

    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Jul 29, 2022)

    = 1.1.2 = Save a theme variation (https://github.com/WordPress/create-block-theme/pull/90) Make UI string 'Create Block Theme' can be translatable (https://github.com/WordPress/create-block-theme/pull/92)

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Jul 29, 2022)

    = 1.1.1 = Save a theme variation (https://github.com/WordPress/create-block-theme/pull/90) Make UI string 'Create Block Theme' can be translatable (https://github.com/WordPress/create-block-theme/pull/92)

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Jul 29, 2022)

  • v1.0.1(Jul 27, 2022)

    = 1.0.1 = Add option to create blank theme. (#70) Improve form instructions (#76) Form cleanup and Theme name check (#77) Get the correct merged theme.json data (#88)

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jul 27, 2022)

Owner
Automattic
We are passionate about making the web a better place.
Automattic
A better way to create WordPress themes.

Runway Framework for WordPress Visit the Runway website: RunwayWP.com A better way to create WordPress themes. Runway was built for creating WordPress

Parallelus 214 Nov 18, 2022
Create WordPress themes with beautiful OOP code and the Twig Template Engine

By Jared Novack (@jarednova), Lukas Gächter (@lgaechter), Pascal Knecht (@pascalknecht), Maciej Palmowski (@palmiak_fp), Coby Tamayo (@cobytamayo), Up

Timber 5.2k Jan 5, 2023
A WordPress package for updating custom plugins and themes based on an API response from a custom update server.

WordPress Update Handler A WordPress package for updating custom plugins and themes based on an JSON REST API response from a custom update server. Ch

WP Forge 7 Oct 5, 2022
Classy is a framework for building WordPress themes, based on Blade template engine

Classy is a framework for building WordPress themes, based on Blade template engine. It's fast with beautiful architecture that allows you to write le

DigitalKwarts 75 Nov 23, 2022
A custom update API for WordPress plugins and themes

A custom update API for WordPress plugins and themes. Intended to be used in conjunction with my plugin-update-checker library.

Yahnis Elsts 717 Dec 31, 2022
This WP plugin will update GitHub, Bitbucket, GitLab, and Gitea hosted plugins and themes

Transition from GitHub Updater 9.x to Git Updater 10.x Due to the renaming of the plugin folders and files, after the initial update, the plugin will

Andy Fragen 3k Jan 5, 2023
WordPress plugin to make it easier to create block patterns.

=== Templets === Contributors: mkaz Tags: block patterns, patterns Requires at least: 5.8 Tested up to: 5.8 Requires PHP: 7.3 Stable tag: 0.2.0 Licens

Marcus Kazmierczak 9 Jan 3, 2023
The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone.

Pronamic WordPress Basecone The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone. Table of contents Au

Pronamic 1 Oct 19, 2021
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. ?? Demo (coming so

Waren Gonzaga 3 Nov 15, 2021
WordPress plugin that lets you use Discourse as the community engine for a WordPress blog

WP Discourse Note: the wp-discourse plugin requires >= PHP-5.4.0. The WP Discourse plugin acts as an interface between your WordPress site and your Di

Discourse 497 Dec 10, 2022
Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library.

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library. Import Jamendo playlists with tracks in WordPress posts.

Pierre Saikali 3 Dec 7, 2022
This WordPress Plugin Boilerplate is meant for you to develop your own plugin on.

WordPress Plugin Boilerplate This plugin boilerplate is meant for you to develop your own plugin on. Support & collaboration Features OOP plugin core

richardev 2 May 10, 2022
This is code to create a new user as admin use for Wordpress FrontEnd Developer to prevent any scaming from clients

theme-setup This is code to create a new user as admin use for Wordpress FrontEnd Developer to prevent any scaming from clients How to use Just copy c

Abdul Razzaq 1 Nov 27, 2021
Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Joan 9 Oct 10, 2022
A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.

WP Bootstrap Navwalker This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test t

WP Bootstrap 3.3k Jan 5, 2023
A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities.

Awesome WordPress A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities. Inspired by bayand

Dropndot Limited 91 Dec 26, 2022
Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.

Twenty Twenty-Two Welcome to the development repository for the default theme that will launch with WordPress 5.9. About Twenty Twenty-Two is designed

null 414 Nov 28, 2022
Easy handle APlayer on WordPress. A shortcode for WordPress to using APlayer.

Description Easy handle APlayer on WordPress. A shortcode for WordPress to using APlayer. Support [audio] tag, compatible with AMP. Requirement WordPr

Karl Chen 24 Nov 3, 2022
WordPress & TypeScript. Simple starter template for WordPress projects

WordPress & TypeScript. Simple starter template for WordPress projects that want to use TypeScript in combination with @wordpress/scripts

Make it WorkPress 11 Sep 27, 2022