Basic Coding
The following are the "override" directive coding rules.
name
Specifies the setting identifier to override.
Type
Scalar (String)
Value
identifier | Specify the identifier. |
Example
overrides:
- name: mobile pages
device
Specifies the device condition to override. If this condition is not specified, the directive will be ignored.
Type
Scalar (String)
Value
pc | Override when PC. |
mobile | Override when mobile. |
tablet | Override when tablet. |
Example
overrides:
- device: mobile
path
Specifies the URL path condition to override. If this condition is not specified, the directive will be ignored.
Type
Scalar (String)
Value
path | Specify the URL path. You can use regular expressions. |
Example
overrides:
- path: .
if
Specifies the configuration condition to override. If this condition is not specified, the directive will be ignored.
Type
Scalar (Numeric)
Value
1 | Enable the configuration. |
Example
overrides:
- if: 1
node
Specifies the type of directives to use for content optimization. If this condition is not specified, the directive will be ignored.
Type
Scalar (String)
Value
lua | Use the "lua" directive. |
Example
overrides:
- node:
- lua
applied
Specifies the directive selected in node. If this condition is not specified, the directive will be ignored.
Type
Sequence (Mapping)
Value
Specify the selected directive in node. Refer to each "directive" for more information.
Example
overrides:
- applied:
lua:
fcache:
enable: 0
exptime: 60
header_filter:
- cmd: wp remove header
body_filter:
- cmd: wp shorten url
patch
When the PST configuration file is output by the "pst config ai" command, the differences from the default directives are output to this key. This does not affect PST configuration, as it displays the differences.
Type
Sequence (Mapping)
Value
The patch output is based on the "jsonpatch" format.
Example
overrides:
- patch:
- op: remove
path: /lua/body_filter/2/args/scripts/24
- op: replace
path: /lua/body_filter/2/args/scripts/10/type
value: 'js [ jQuery is found in body ]'
- op: add
path: /lua/body_filter/2/args/scripts/1/method
value: webfont