Pug Template Studio

What Pug Template Studio does

Pug Template Studio is a browser-based previewer for Pug template projects. Drop in a folder or a .zip and it reads every template you have, works out which variables each one accepts, and gives you a generated form to fill them in. The rendered output updates as you type.

Nothing is uploaded. The Pug compiler runs in a Web Worker inside your own browser, so your projects — including client work and unreleased email campaigns — never leave the machine. There is no account and no server.

It exists because a Pug template that is missing a variable does not fail. Pug compiles locals into function parameters, so an absent one is simply undefined: #{expirationDelay} renders as an empty string, and href=resetLink drops the attribute entirely, leaving a dead button. No error, no warning. An email missing its most important variable renders as a plausible-looking email with a broken call to action. Required-ness therefore cannot be discovered by rendering — it has to be determined statically, which is what the variables panel is for.

Features

Questions

Are my templates uploaded anywhere?
No. The compiler runs in a Web Worker in your browser and there is no backend to upload to. Your files stay on your machine, including when you export a .zip.
Do I need an account?
No. There is nothing to sign up for and nothing to install — open the page and drop in a project.
Which Pug features are supported?
The real Pug compiler runs, so extends, include, mixins, conditionals, iteration and inline JavaScript all behave as they do in your build. Filesystem lookups for extends and include are served from an in-memory copy of the project you loaded.
Can I preview the same template in several languages?
Yes. Variables can be given a different value per language, and the export can emit every template in every language in a single .zip.
What is it built for?
Transactional email templates in particular, where a silently missing variable produces a plausible-looking email with a broken call to action — but it works for any Pug project.
Advertisement

Other languages

Privacy policy