Creating Theme Packages
This guide describes step by step the workflow of setting up and publish a new theme. It assumes you're familiar with Visual Code Studio and working on a system with a Bash shell or similar — like macOS or Linux.
The Local Package
It's a good practice to start developing a new package outside of the Automad packages directory. Therefore change to some directory outside of Automad where you want to develop your new theme. Let's assume you want to put your package into a directory called
dev
within your home folder.cd ~/dev
Create new skeleton theme in your
dev
directory using Composer.composer create-project automad/theme-skeleton my-theme
Change to the new theme directory and edit the
composer.json
andtheme.json
files. VS Code is used here as the editor. At least change the vendor and theme name.cd my-theme code composer.json
Also edit the name in
theme.json
.code theme.json
Now change to your Automad root directory. For example
~/Sites/automad-site
.cd ~/Sites/automad-site
Edit the
composer.json
file of the Automad installation.code composer.json
Add the following snippet to Automad's composer file (note the path to your package).
{ ... "repositories": [ { "type": "path", "url": "~/dev/my-theme" } ], ... }
Still in the Automad directory run the following Composer command.
composer require my-vendor/my-theme:@dev
Now let's create a repository for your theme.
Create a Git Repository
When developing is done, it's time to publish your work.
Init new Git repository and commit files.
cd ~/dev/my-theme git init git add . git commit -m "First commit"
Create a first release tag for your finished theme following the semantic versioning scheme.
git tag -a 1.0.0 -m "my version 1.0.0"
Create a new repository on GitHub.
Now, add its URL as a remote to your local repository and push changes. When creating a repository, the URL will be printed on the GitHub page.
git remote add origin /remote/URL/of/your/new/repo git push -u origin master
Register Your Package
Now it's time to submit your theme package to Packagist. After succseffuly registering it, it will automatically show up in the package browser.