TemplateEnginePug by dreerr

Pug/Jade templates for the TemplateEngineFactory

TemplateEnginePug

License: MIT ProcessWire 3

A ProcessWire module adding Pug to the TemplateEngineFactory.

Requirements


  • ProcessWire 3.0 or newer
  • TemplateEngineFactory 2.0 or newer
  • PHP 7.0 or newer
  • Composer

The 1.x version of this module is available on the 1.x branch. Use this version if you still use TemplateEngineFactory 1.x.

Installation


Execute the following command in the root directory of your ProcessWire installation:

composer require dreerr/template-engine-pug:^2.0

This will install the TemplateEnginePug and TemplateEngineFactory modules in one step. Afterwards, don't forget to enable Pug as engine in the TemplateEngineFactory module's configuration.

Configuration


The module offers the following configuration:

  • Template files suffix The suffix of the Pug template files, defaults to pug.
  • Provide ProcessWire API variables in templates API variables ($pages, $input, $config...) are accessible in Pug.
  • Output indented HTML If checked, the output is rendered as indented HTML.
  • Debug Output When an error occurs at render time, you will get a complete stack trace including line and offset in the original pug source file.
  • Enable Profiler When set to true, it will output on render a timeline you can inspect in your browser to see wich token/node take longer to lex/parse/compile/render.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #519
    In the 519th issue of ProcessWire Weekly we'll check out a new third party module called RockForms, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 20 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits