You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,3 +54,54 @@ include /partials/common/header.pug
54
54
//- Relative path
55
55
include common/header.pug
56
56
```
57
+
58
+
### Helper functions
59
+
60
+
Add a DADI Web configuration setting for `helpers`, pointing to a directory containing helper files. Each `.js` helper file will be added as a property to template locals for use within templates.
61
+
62
+
#### Configuration
63
+
64
+
```
65
+
engines: {
66
+
pug: {
67
+
paths: {
68
+
helpers: 'test/workspace/helpers'
69
+
}
70
+
}
71
+
}
72
+
```
73
+
74
+
#### Directory structure
75
+
76
+
```
77
+
helpers/
78
+
|_ trim.js
79
+
pages/
80
+
|_ partials/
81
+
|_ |_ common/
82
+
|_ |_ |_ header.pug
83
+
|_ |_ contact-info.pug
84
+
|_ home.pug
85
+
```
86
+
87
+
#### Locals
88
+
89
+
The function is added to the template locals, along with data objects:
0 commit comments