@adobe/helix-shared-config 1.7.21 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/package.json +12 -9
- package/src/config-wrapper.js +0 -6
- package/src/index.js +0 -12
- package/src/Condition.js +0 -573
- package/src/ConfigValidator.js +0 -95
- package/src/DataEmbedValidator.js +0 -51
- package/src/DynamicRedirect.js +0 -125
- package/src/HelixConfig.js +0 -133
- package/src/MarkupConfig.js +0 -35
- package/src/Origin.js +0 -159
- package/src/Performance.js +0 -80
- package/src/Redirect.js +0 -64
- package/src/RedirectConfig.js +0 -64
- package/src/RedirectRuleHandler.js +0 -46
- package/src/Static.js +0 -119
- package/src/Strain.js +0 -332
- package/src/Strains.js +0 -68
- package/src/schemas/conditions.schema.json +0 -140
- package/src/schemas/config.description.md +0 -7
- package/src/schemas/config.example.1.json +0 -26
- package/src/schemas/config.schema.json +0 -44
- package/src/schemas/data-embed-response.schema.json +0 -40
- package/src/schemas/giturl.schema.json +0 -62
- package/src/schemas/markup.schema.json +0 -22
- package/src/schemas/markupconfig.schema.json +0 -38
- package/src/schemas/markupmapping.description.md +0 -242
- package/src/schemas/markupmapping.schema.json +0 -122
- package/src/schemas/origin.description.md +0 -5
- package/src/schemas/origin.schema.json +0 -86
- package/src/schemas/performance.schema.json +0 -210
- package/src/schemas/proxystrain.description.md +0 -20
- package/src/schemas/proxystrain.schema.json +0 -87
- package/src/schemas/redirect.schema.json +0 -34
- package/src/schemas/redirectrule.schema.json +0 -46
- package/src/schemas/redirects.description.md +0 -1
- package/src/schemas/redirects.schema.json +0 -41
- package/src/schemas/row.schema.json +0 -23
- package/src/schemas/runtimestrain.schema.json +0 -144
- package/src/schemas/sheet.schema.json +0 -57
- package/src/schemas/staticgiturl.schema.json +0 -80
- package/src/schemas/strains.schema.json +0 -39
- package/src/schemas/vanity.schema.json +0 -38
- package/src/schemas/version-lock.description.md +0 -3
- package/src/schemas/version-lock.schema.json +0 -35
- package/src/schemas/workbook.schema.json +0 -49
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2018 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/shared/config",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Configuration",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "A Configuration File for Project Helix.",
|
|
19
|
-
"additionalProperties": false,
|
|
20
|
-
"properties": {
|
|
21
|
-
"definitions": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"description": "A container for referencable objects that can be re-used elsewhere in the configuration."
|
|
24
|
-
},
|
|
25
|
-
"version": {
|
|
26
|
-
"type":["string", "number"],
|
|
27
|
-
"enum": ["1", 1],
|
|
28
|
-
"default": 1,
|
|
29
|
-
"description": "The helix-config file format version"
|
|
30
|
-
},
|
|
31
|
-
"strains": {
|
|
32
|
-
"$ref": "https://ns.adobe.com/helix/shared/strains"
|
|
33
|
-
},
|
|
34
|
-
"preflight": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"format": "uri",
|
|
37
|
-
"pattern": "^https://adobeioruntime\\.net/|^https://[^.]*\\.anywhere\\.run/",
|
|
38
|
-
"description": "The URL of a preflight check that should be performed before assigning a strain to a request. The headers returned by this preflight request can be used in strain conditions."
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"required": [
|
|
42
|
-
"strains"
|
|
43
|
-
]
|
|
44
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2021 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/data-embed/response",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Response",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "The Helix Data Embed Response format",
|
|
19
|
-
"allOf": [
|
|
20
|
-
{
|
|
21
|
-
"oneOf": [
|
|
22
|
-
{ "$ref": "https://ns.adobe.com/helix/data-embed/sheet" },
|
|
23
|
-
{ "$ref": "https://ns.adobe.com/helix/data-embed/workbook" }
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
":version": {
|
|
28
|
-
"type": "number",
|
|
29
|
-
"enum": [3],
|
|
30
|
-
"default": 3,
|
|
31
|
-
"description": "The workbook response format version"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"required": [
|
|
36
|
-
":version",
|
|
37
|
-
":type"
|
|
38
|
-
],
|
|
39
|
-
"minProperties": 4
|
|
40
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2018 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/shared/giturl",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Git URL",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "Representation of the fragments of a Git URL",
|
|
19
|
-
"additionalProperties": false,
|
|
20
|
-
"properties": {
|
|
21
|
-
"protocol": {
|
|
22
|
-
"description": "The protocol to access the Git repository",
|
|
23
|
-
"enum": ["https", "http", "ssh"],
|
|
24
|
-
"type":"string"
|
|
25
|
-
},
|
|
26
|
-
"hostname": {
|
|
27
|
-
"description": "The hostname without port",
|
|
28
|
-
"type":"string",
|
|
29
|
-
"format": "hostname"
|
|
30
|
-
},
|
|
31
|
-
"host": {
|
|
32
|
-
"description": "The hostname with port",
|
|
33
|
-
"type":"string"
|
|
34
|
-
},
|
|
35
|
-
"port": {
|
|
36
|
-
"description": "The port to access the Git Repository",
|
|
37
|
-
"type":["integer", "string"]
|
|
38
|
-
},
|
|
39
|
-
"owner": {
|
|
40
|
-
"description": "The owner or username that the repository belongs to",
|
|
41
|
-
"type":"string"
|
|
42
|
-
},
|
|
43
|
-
"path": {
|
|
44
|
-
"description": "The path within the repository",
|
|
45
|
-
"type":"string"
|
|
46
|
-
},
|
|
47
|
-
"repo": {
|
|
48
|
-
"description": "The repository name",
|
|
49
|
-
"type":"string"
|
|
50
|
-
},
|
|
51
|
-
"ref": {
|
|
52
|
-
"description": "The branch, tag, or sha of the tree in the repository to use",
|
|
53
|
-
"default": "master",
|
|
54
|
-
"type":"string"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"required": [
|
|
58
|
-
"owner",
|
|
59
|
-
"repo",
|
|
60
|
-
"ref"
|
|
61
|
-
]
|
|
62
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2019 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/shared/markup",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Markup Configuration",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "A container for markup mappings. Each markup mapping is a named key.",
|
|
19
|
-
"additionalProperties": {
|
|
20
|
-
"$ref": "https://ns.adobe.com/helix/shared/markupmapping"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2019 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/shared/markupconfig",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Configuration",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "A Markup Configuration File for Project Helix.",
|
|
19
|
-
"additionalProperties": false,
|
|
20
|
-
"properties": {
|
|
21
|
-
"definitions": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"description": "A container for referencable objects that can be re-used elsewhere in the configuration."
|
|
24
|
-
},
|
|
25
|
-
"version": {
|
|
26
|
-
"type":["string", "number"],
|
|
27
|
-
"enum": ["1", 1],
|
|
28
|
-
"default": 1,
|
|
29
|
-
"description": "The helix-config file format version"
|
|
30
|
-
},
|
|
31
|
-
"markup": {
|
|
32
|
-
"$ref": "https://ns.adobe.com/helix/shared/markup"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"required": [
|
|
36
|
-
"markup"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
A markup mapping defines how Helix should generate markup for certain Markdown or DOM patterns.
|
|
2
|
-
|
|
3
|
-
A configuration consits of a mandatory `match` expression, which is a matching expression that works differently depending on the value of the `type` attribute.
|
|
4
|
-
|
|
5
|
-
- If `type=html`, then `match` is a CSS selector that operates on the generated HTML
|
|
6
|
-
- If `type=markdown`, then `match` is a CSS selector that operates on the source Markdown
|
|
7
|
-
- If `type=url`, then `match` is a URL path expression
|
|
8
|
-
- If `type=content`, then `match` is a content intelligence expression that selects sections based on the order of their children
|
|
9
|
-
|
|
10
|
-
Furthermore, a configuration can have any number of actions (including none at all), for example:
|
|
11
|
-
|
|
12
|
-
- `wrap`: adds more HTML elements around the generated HTML
|
|
13
|
-
- `replace`: replaces the generated HTML with the provided markup
|
|
14
|
-
- `classnames` adds `class` attribute values into the generated HTML element
|
|
15
|
-
- `attribute` adds other attributes and values into the generated HTML element
|
|
16
|
-
|
|
17
|
-
## Referencing AST values
|
|
18
|
-
|
|
19
|
-
In the `wrap` and `replace` expressions you can use pattern expressions like `wrap: pre.zupp[data-embed="${url}"]` inside the Emmet syntax, allowing you to reference properties of the matched MDAST or DOM node.
|
|
20
|
-
|
|
21
|
-
## Examples
|
|
22
|
-
|
|
23
|
-
### On the DOM tree
|
|
24
|
-
|
|
25
|
-
The most intuitive usage for most developers will be directly operating on the resulting DOM tree.
|
|
26
|
-
The `match` method just takes a regular CSS selector and then applies the desired markup on the resulting element.
|
|
27
|
-
|
|
28
|
-
#### Adding a class
|
|
29
|
-
|
|
30
|
-
`index.md`
|
|
31
|
-
```markdown
|
|
32
|
-
# Lorem ipsum dolor sit amet
|
|
33
|
-
|
|
34
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
35
|
-
|
|
36
|
-

|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
`helix-markup.yaml`
|
|
40
|
-
```yaml
|
|
41
|
-
version: 1
|
|
42
|
-
markup:
|
|
43
|
-
foo:
|
|
44
|
-
match: p
|
|
45
|
-
classnames:
|
|
46
|
-
- foo
|
|
47
|
-
type: html
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
`index.html`
|
|
51
|
-
```html
|
|
52
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
53
|
-
<p class="foo">consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
54
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### Adding an attribute
|
|
58
|
-
|
|
59
|
-
`index.md`
|
|
60
|
-
```markdown
|
|
61
|
-
# Lorem ipsum dolor sit amet
|
|
62
|
-
|
|
63
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
64
|
-
|
|
65
|
-

|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
`helix-markup.yaml`
|
|
69
|
-
```yaml
|
|
70
|
-
version: 1
|
|
71
|
-
markup:
|
|
72
|
-
foo:
|
|
73
|
-
match: p
|
|
74
|
-
attribute:
|
|
75
|
-
bar: baz
|
|
76
|
-
type: html
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
`index.html`
|
|
80
|
-
```html
|
|
81
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
82
|
-
<p bar="baz">consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
83
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
#### Wrapping with another element
|
|
87
|
-
|
|
88
|
-
`index.md`
|
|
89
|
-
```markdown
|
|
90
|
-
# Lorem ipsum dolor sit amet
|
|
91
|
-
|
|
92
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
93
|
-
|
|
94
|
-

|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
`helix-markup.yaml`
|
|
98
|
-
```yaml
|
|
99
|
-
version: 1
|
|
100
|
-
markup:
|
|
101
|
-
foo:
|
|
102
|
-
match: p
|
|
103
|
-
wrap: section.qux
|
|
104
|
-
type: html
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
`index.html`
|
|
108
|
-
```html
|
|
109
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
110
|
-
<section class="qux">
|
|
111
|
-
<p>consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
112
|
-
</section>
|
|
113
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### On the Markdown abstract tree
|
|
117
|
-
|
|
118
|
-
As an alternative, it is also possible to directly operate on the Markdown abstract syntax tree before it is converted to HTML. This is especially useful if you are heavily modifying the markup via the `*.pre.js` and need to already annotate your tree before processing. The `match` property takes a CSS like selector, but instead of DOM elements, you are targeting [MDAST nodes](https://github.com/syntax-tree/mdast#nodes).
|
|
119
|
-
|
|
120
|
-
#### Adding a class
|
|
121
|
-
|
|
122
|
-
`index.md`
|
|
123
|
-
```markdown
|
|
124
|
-
# Lorem ipsum dolor sit amet
|
|
125
|
-
|
|
126
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
127
|
-
|
|
128
|
-

|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
`helix-markup.yaml`
|
|
132
|
-
```yaml
|
|
133
|
-
version: 1
|
|
134
|
-
markup:
|
|
135
|
-
foo:
|
|
136
|
-
match: paragraph
|
|
137
|
-
classnames:
|
|
138
|
-
- foo
|
|
139
|
-
type: markdown
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
`index.html`
|
|
143
|
-
```html
|
|
144
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
145
|
-
<p class="foo">consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
146
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
#### Adding an attribute
|
|
150
|
-
|
|
151
|
-
`index.md`
|
|
152
|
-
```markdown
|
|
153
|
-
# Lorem ipsum dolor sit amet
|
|
154
|
-
|
|
155
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
156
|
-
|
|
157
|
-

|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
`helix-markup.yaml`
|
|
161
|
-
```yaml
|
|
162
|
-
version: 1
|
|
163
|
-
markup:
|
|
164
|
-
foo:
|
|
165
|
-
match: paragraph
|
|
166
|
-
attribute:
|
|
167
|
-
bar: baz
|
|
168
|
-
type: markdown
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
`index.html`
|
|
172
|
-
```html
|
|
173
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
174
|
-
<p bar="baz">consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
175
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
#### Wrapping with another element
|
|
179
|
-
|
|
180
|
-
`index.md`
|
|
181
|
-
```markdown
|
|
182
|
-
# Lorem ipsum dolor sit amet
|
|
183
|
-
|
|
184
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
185
|
-
|
|
186
|
-

|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
`helix-markup.yaml`
|
|
190
|
-
```yaml
|
|
191
|
-
version: 1
|
|
192
|
-
markup:
|
|
193
|
-
foo:
|
|
194
|
-
match: paragraph
|
|
195
|
-
wrap: section.qux
|
|
196
|
-
type: markdown
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
`index.html`
|
|
200
|
-
```html
|
|
201
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
202
|
-
<section class="qux">
|
|
203
|
-
<p>consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
204
|
-
</section>
|
|
205
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Mixed
|
|
209
|
-
|
|
210
|
-
For the sake of completeness, we provide here an example of mixed rules
|
|
211
|
-
|
|
212
|
-
`index.md`
|
|
213
|
-
```markdown
|
|
214
|
-
# Lorem ipsum dolor sit amet
|
|
215
|
-
|
|
216
|
-
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
|
|
217
|
-
|
|
218
|
-

|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
`helix-markup.yaml`
|
|
222
|
-
```yaml
|
|
223
|
-
version: 1
|
|
224
|
-
markup:
|
|
225
|
-
foo:
|
|
226
|
-
match: paragraph
|
|
227
|
-
classnames:
|
|
228
|
-
- foo
|
|
229
|
-
type: markdown
|
|
230
|
-
bar:
|
|
231
|
-
match: p
|
|
232
|
-
attribute:
|
|
233
|
-
bar: baz
|
|
234
|
-
type: html
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
`index.html`
|
|
238
|
-
```html
|
|
239
|
-
<h1>Lorem ipsum dolor sit amet</h1>
|
|
240
|
-
<p class="foo" bar="baz">consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
|
241
|
-
<img src="http://dolor.sit/amet.jpeg" alt="Lorem ipsum"/>
|
|
242
|
-
```
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2019 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/shared/markupmapping",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Markup Mapping",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "",
|
|
19
|
-
"required": [
|
|
20
|
-
"match"
|
|
21
|
-
],
|
|
22
|
-
"additionalProperties": false,
|
|
23
|
-
"properties": {
|
|
24
|
-
"name": {
|
|
25
|
-
"type": "string",
|
|
26
|
-
"description": "The (optional) name of the mapping. The name is normative only, and can be used for debugging purposes. It does not affect either matching nor the markup output."
|
|
27
|
-
},
|
|
28
|
-
"match": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"anyOf": [
|
|
31
|
-
{
|
|
32
|
-
"type": "string",
|
|
33
|
-
"title": "DOM Match Expression",
|
|
34
|
-
"description": "A CSS selector expression selecting the DOM nodes that should get processed",
|
|
35
|
-
"examples": [
|
|
36
|
-
"p",
|
|
37
|
-
"p>img",
|
|
38
|
-
"h1+p"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "string",
|
|
43
|
-
"title": "MDAST Match Expression",
|
|
44
|
-
"description": "A CSS selector expression selecting the Markdown nodes that should get processed",
|
|
45
|
-
"examples": [
|
|
46
|
-
"paragraph",
|
|
47
|
-
"paragraph>image",
|
|
48
|
-
"heading+paragraph"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"type": "string",
|
|
53
|
-
"title": "URL Pattern Match Expression",
|
|
54
|
-
"description": "An [Express-like](https://expressjs.com/en/guide/routing.html) path expression for selecting URL patterns that will apply the changes to the `body` element.",
|
|
55
|
-
"examples": [
|
|
56
|
-
"/about",
|
|
57
|
-
"/authors/:name",
|
|
58
|
-
"/posts/(\\d\\d\\d\\d)/(\\d\\d)/:title"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"type": "string",
|
|
63
|
-
"title": "Content Intelligence Match Expression",
|
|
64
|
-
"description": "Use a [Content Intelligence](https://github.com/adobe/helix-pipeline/blob/master/README.md#infer-content-types-with-utilstypes) expression for selecting sections in MDAST that have the specified order of children.",
|
|
65
|
-
"examples": [
|
|
66
|
-
"^heading",
|
|
67
|
-
"paragraph$",
|
|
68
|
-
"heading image+",
|
|
69
|
-
"heading? image",
|
|
70
|
-
"heading paragraph* image",
|
|
71
|
-
"(paragraph|list)",
|
|
72
|
-
"^heading (image paragraph)+$"
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
"type": {
|
|
78
|
-
"type": "string",
|
|
79
|
-
"enum": ["html", "markdown", "url", "content"],
|
|
80
|
-
"default": "html",
|
|
81
|
-
"meta:enum": {
|
|
82
|
-
"html": "Match against the generated DOM tree",
|
|
83
|
-
"markdown": "Match against the source MDAST tree",
|
|
84
|
-
"url": "Match against the request URL",
|
|
85
|
-
"content": "Use content intelligence matching for sections"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"wrap": {
|
|
89
|
-
"type": "string",
|
|
90
|
-
"description": "Add the following HTML tags around the generated HTML. This attribute is using [Emmet](https://emmet.io) notation.",
|
|
91
|
-
"examples": [
|
|
92
|
-
"div>ul>li",
|
|
93
|
-
"div+p+bq",
|
|
94
|
-
"div+div>p>span+em"
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
"replace": {
|
|
98
|
-
"type": "string",
|
|
99
|
-
"description": "Add the following HTML tags instead of the generated HTML. This attribute is using [Emmet](https://emmet.io) notation.",
|
|
100
|
-
"examples": [
|
|
101
|
-
"div>ul>li",
|
|
102
|
-
"div+p+bq",
|
|
103
|
-
"div+div>p>span+em"
|
|
104
|
-
]
|
|
105
|
-
},
|
|
106
|
-
"classnames": {
|
|
107
|
-
"type": "array",
|
|
108
|
-
"description": "Add the following class names to the `class` attribute of the generated HTML",
|
|
109
|
-
"items": {
|
|
110
|
-
"type": "string"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"attribute": {
|
|
114
|
-
"type": "object",
|
|
115
|
-
"description": "create new attributes for each key value pair below this property",
|
|
116
|
-
"additionalProperties": {
|
|
117
|
-
"type": "string",
|
|
118
|
-
"description": "The property value"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Representation of a origin host for a proxy strain.
|
|
2
|
-
|
|
3
|
-
As proxy strains deliver content from another web server, the `origin` property can be used to specify the source of this third-party content to be served. In the simplest case, the `origin` property can be a simple URL, but for advanced configuration, all the properties in this schema are available.
|
|
4
|
-
|
|
5
|
-
The properties in this schema are largely identical with the properties defined in the [Fastly Backend API](https://docs.fastly.com/api/config#backend).
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta:license": [
|
|
3
|
-
"Copyright 2018 Adobe. All rights reserved.",
|
|
4
|
-
"This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
|
|
5
|
-
"you may not use this file except in compliance with the License. You may obtain a copy",
|
|
6
|
-
"of the License at http://www.apache.org/licenses/LICENSE-2.0",
|
|
7
|
-
"",
|
|
8
|
-
"Unless required by applicable law or agreed to in writing, software distributed under",
|
|
9
|
-
"the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
|
|
10
|
-
"OF ANY KIND, either express or implied. See the License for the specific language",
|
|
11
|
-
"governing permissions and limitations under the License."
|
|
12
|
-
],
|
|
13
|
-
"$id": "https://ns.adobe.com/helix/shared/origin",
|
|
14
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
15
|
-
"title": "Origin",
|
|
16
|
-
"type": "object",
|
|
17
|
-
"meta:status": "stabilizing",
|
|
18
|
-
"description": "Representation of a origin host for a proxy strain.",
|
|
19
|
-
"additionalProperties": false,
|
|
20
|
-
"properties": {
|
|
21
|
-
"hostname": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"format": "hostname",
|
|
24
|
-
"description": "The hostname of the backend."
|
|
25
|
-
},
|
|
26
|
-
"port": {
|
|
27
|
-
"type": "integer",
|
|
28
|
-
"description": "The port number."
|
|
29
|
-
},
|
|
30
|
-
"error_threshold": {
|
|
31
|
-
"type": "integer",
|
|
32
|
-
"description": ""
|
|
33
|
-
},
|
|
34
|
-
"first_byte_timeout": {
|
|
35
|
-
"type": "integer",
|
|
36
|
-
"description": "How long to wait for the first bytes in milliseconds."
|
|
37
|
-
},
|
|
38
|
-
"weight": {
|
|
39
|
-
"type": "integer",
|
|
40
|
-
"description": "Weight used to load balance this backend against others."
|
|
41
|
-
},
|
|
42
|
-
"address": {
|
|
43
|
-
"type": "string",
|
|
44
|
-
"format": "hostname",
|
|
45
|
-
"description": "An hostname, IPv4, or IPv6 address for the backend."
|
|
46
|
-
},
|
|
47
|
-
"connect_timeout": {
|
|
48
|
-
"type": "string",
|
|
49
|
-
"description": "How long to wait for a timeout in milliseconds."
|
|
50
|
-
},
|
|
51
|
-
"name": {
|
|
52
|
-
"type": "string",
|
|
53
|
-
"description": "The name of the backend."
|
|
54
|
-
},
|
|
55
|
-
"between_bytes_timeout": {
|
|
56
|
-
"type": "integer",
|
|
57
|
-
"description": "How long to wait between bytes in milliseconds."
|
|
58
|
-
},
|
|
59
|
-
"shield": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"description": "The shield POP designated to reduce inbound load on this origin by serving the cached data to the rest of the network."
|
|
62
|
-
},
|
|
63
|
-
"ssl_cert_hostname": {
|
|
64
|
-
"type": "string",
|
|
65
|
-
"format": "hostname",
|
|
66
|
-
"description": "Overrides ssl_hostname, but only for cert verification. Does not affect SNI at all."
|
|
67
|
-
},
|
|
68
|
-
"max_conn": {
|
|
69
|
-
"type": "integer",
|
|
70
|
-
"description": "Maximum number of connections."
|
|
71
|
-
},
|
|
72
|
-
"use_ssl": {
|
|
73
|
-
"type": "boolean",
|
|
74
|
-
"description": "Whether or not to use SSL to reach the backend."
|
|
75
|
-
},
|
|
76
|
-
"path": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"description": "The base path to make requests again. For example, if your `origin` is `http://www.example.com/foo` and a request is made to your site using the URL `/bar`, a backend request to `http://www.example.com/foo/bar` will be made."
|
|
79
|
-
},
|
|
80
|
-
"override_host": {
|
|
81
|
-
"type": "string",
|
|
82
|
-
"format": "hostname",
|
|
83
|
-
"description": "The hostname to override the [Host header](https://docs.fastly.com/guides/basic-configuration/specifying-an-override-host).\nBy default, proxy strains use the `Host` header that was used to make the request to Helix's CDN, which is ideal for migration use cases where the existing backend expects to serve traffic to a hostname that has now been taken over by Helix. In cases where Helix is aggregating content from multiple hosts, and the backend won't serve any content to the domain name Helix is using, set the `override_host` property to an accepted `Host` header value."
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|