Juniper - WordPress starter boilerplate + theme
OsomTheme is symbiosis of Bedrock boilerplate and Timber.
Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure. Timber allows you to use twig templating system in your WP project. With this approach you can create theme code with logic files separated from frontend.
- Easy WordPress configuration with environment specific files
- File structure which makes keeping and maintaining your project on a Git a lot easier
- Dependency management with Composer
- Twig templating system
- Bash console scripts to make creating project from the scratch much easier
- PHP >= 7.4
- Composer - Install
- Create local database as you would do for normal WP instance
- Map project main catalogue to domain on your localhost
- Start a new project:
and follow the instructions in the console. Type in details from step 1 and 2. .env file will be crated for you (all DB and site details sits there)
$ bash start.sh
- Fill correct domain details in .htaccess in main catalogue.
- Check if /web/ directory has .htaccess file with default WP entries.
- Run
in main project directory
$ bash work.sh
- Start coding your theme in /web/app/themes/osom-theme/ :)
To maintain project correctly we insist you to use composer.json in main catalogue.
If you want to add new plugin to your project you can use WPackagist - the only thing you need is plugin slug from the main WP repository.
You can update them with the same easy way by changing version in composer.json.
The main operations that we automate have been handled by below scripts: :
-
start.sh - used for the initial configuration of the project. Through this process, we areable to enter the basic data to the database, define the main URL and ACF key. After providing those information, the installer will generate an .env file, which in our case will contain all configuration data (as in wp-config.php in a vanilla WordPress installation).
-
work.sh - used every time you work on a project. It compiles the styles in real time by calling a parcel script to listen for file changes.
Other scripts worth mentioning are:
-
block.sh - a set of commands that will create a custom Gutenberg block for the user. Juniper utilizes the ACF Timber Blocks solution, which requires only one .twig file with the appropriate comment to create a block.
-
cpt.sh - here the name speaks for itself. After going through the configuration, a CPT will be created. Its editing will of course be possible later, because this command will generate a file in the theme directory.
-
taxonomy.sh - similarly to the antecedent case, the answer to questions posed by a series of commands allows you to expeditiously create a taxonomy assigned to a given type of post.