Automad templates use their own syntax that is mixed with HTML and PHP. In order to make the development of themes more efficient, it is recommended to install an Automad plugin for your preferred code editor. Such plugins add syntax highlighting for the template language and, depending on the editor, snippets for autocompletion. The following editors are officially supported.
Visual Studio Code
There is an official Automad Template Language extension in the Visual Studio Marketplace. Search for Automad Template Language in the extensions panel of Visual Studio Code in order to install it. The extension provides syntax highlighting as well as snippets for the most common statements, such as comments, loops, conditionals and with statements.
Neovim
For Neovim, there is an official tree-sitter grammar that can be used together with nvim-treesitter. Setting it up basically requires three steps:
- Register the
automadparser in the parser configuration of nvim-treesitter. - Add
automadtogether withhtmlandphpto the list of installed parsers. - Copy the highlighting queries of the grammar into the
after/queriesdirectory of your Neovim configuration.
Please follow the instructions in the readme of the repository for the exact configuration. You can also check out this blog post for additional tips on setting up Neovim for Automad theme development.
Starter Kit
Besides editor support, the Starter Kit provides a complete development environment including a local development server, a file watcher and a build setup based on esbuild with support for TypeScript and Less. Use npm run dev to start developing and npm run build to create a production build of your theme.