MCPcopy
hub / github.com/harttle/liquidjs / LiquidOptions

Interface LiquidOptions

src/liquid-options.ts:14–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12type OutputEscapeOption = 'escape' | 'json' | OutputEscape
13
14export interface LiquidOptions {
15 /** A directory or an array of directories from where to resolve layout and include templates, and the filename passed to `.renderFile()`. If it's an array, the files are looked up in the order they occur in the array. Defaults to `["."]` */
16 root?: string | string[];
17 /** A directory or an array of directories from where to resolve included templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */
18 partials?: string | string[];
19 /** A directory or an array of directories from where to resolve layout templates. If it's an array, the files are looked up in the order they occur in the array. Defaults to `root` */
20 layouts?: string | string[];
21 /** Allow refer to layouts/partials by relative pathname. To avoid arbitrary filesystem read, paths been referenced also need to be within corresponding root, partials, layouts. Defaults to `true`. */
22 relativeReference?: boolean;
23 /** Use jekyll style include, pass parameters to `include` variable of current scope. Defaults to `false`. */
24 jekyllInclude?: boolean;
25 /** Use jekyll style where filter, enables array item match. Defaults to `false`. */
26 jekyllWhere?: boolean;
27 /** Add a extname (if filepath doesn't include one) before template file lookup. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`. */
28 extname?: string;
29 /** Whether or not to cache resolved templates. Defaults to `false`. */
30 cache?: boolean | number | LiquidCache;
31 /** Use JavaScript Truthiness. Defaults to `false`. */
32 jsTruthy?: boolean;
33 /** If set, treat the `filepath` parameter in `{%include filepath %}` and `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */
34 dynamicPartials?: boolean;
35 /** Whether or not to assert filter existence. If set to `false`, undefined filters will be skipped. Otherwise, undefined filters will cause an exception. Defaults to `false`. */
36 strictFilters?: boolean;
37 /** Whether or not to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */
38 strictVariables?: boolean;
39 /** Catch all errors instead of exit upon one. Please note that render errors won't be reached when parse fails. */
40 catchAllErrors?: boolean;
41 /** Hide scope variables from prototypes, useful when you're passing a not sanitized object into LiquidJS or need to hide prototypes from templates. */
42 ownPropertyOnly?: boolean;
43 /** Modifies the behavior of `strictVariables`. If set, a single undefined variable will *not* cause an exception in the context of the `if`/`elsif`/`unless` tag and the `default` filter. Instead, it will evaluate to `false` and `null`, respectively. Irrelevant if `strictVariables` is not set. Defaults to `false`. **/
44 lenientIf?: boolean;
45 /** JavaScript timezone name or timezoneOffset for `date` filter, default to local time. That means if you're in Australia (UTC+10), it'll default to `-600` or `Australia/Lindeman` */
46 timezoneOffset?: number | string;
47 /** Default date format to use if the date filter doesn't include a format. Defaults to `%A, %B %-e, %Y at %-l:%M %P %z`. */
48 dateFormat?: string;
49 /** Default locale, will be used by date filter. Defaults to system locale. */
50 locale?: string;
51 /** Strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */
52 trimTagRight?: boolean;
53 /** Similar to `trimTagRight`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
54 trimTagLeft?: boolean;
55 /** Strip blank characters (including ` `, `\t`, and `\r`) from the right of values (`{{ }}`) until `\n` (inclusive). Defaults to `false`. */
56 trimOutputRight?: boolean;
57 /** Similar to `trimOutputRight`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
58 trimOutputLeft?: boolean;
59 /** The left delimiter for liquid tags. **/
60 tagDelimiterLeft?: string;
61 /** The right delimiter for liquid tags. **/
62 tagDelimiterRight?: string;
63 /** The left delimiter for liquid outputs. **/
64 outputDelimiterLeft?: string;
65 /** The right delimiter for liquid outputs. **/
66 outputDelimiterRight?: string;
67 /** Whether input strings to date filter preserve the given timezone **/
68 preserveTimezones?: boolean;
69 /** Whether `trim*Left`/`trim*Right` is greedy. When set to `true`, all consecutive blank characters including `\n` will be trimmed regardless of line breaks. Defaults to `true`. */
70 greedy?: boolean;
71 /** `fs` is used to override the default file-system module with a custom implementation. */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…