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
Copy file name to clipboardExpand all lines: README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,40 @@ module.exports = function (eleventyConfig) {
35
35
};
36
36
```
37
37
38
+
### Front Matter
39
+
40
+
You can use either [Eleventy style front matter](https://www.11ty.dev/docs/data-frontmatter/#front-matter-formats) or AsciiDoc document attributes to write front matter.
41
+
42
+
Any AsciiDoc document attributes that are prefixed with `eleventy-` ([configurable](#eleventyAttributesPrefix)) can be used as front matter.
43
+
44
+
> [!NOTE]
45
+
> Only document-scoped attributes or variables can be used for front matter. Attributes that are written after the document title (`= Document Title`) will not be considered for front matter.
46
+
47
+
```adoc
48
+
:eleventy-permalink: /hello-world/
49
+
:eleventy-layout: base.njk
50
+
51
+
= Hello World
52
+
53
+
Hello everyone!
54
+
```
55
+
56
+
The above AsciiDoc attribute front matter is the same as YAML based front matter below:
57
+
58
+
```adoc
59
+
---
60
+
permalink: /hello-world/
61
+
layout: base.njk
62
+
---
63
+
64
+
= Hello World
65
+
66
+
Hello everyone!
67
+
```
68
+
69
+
> [!WARNING]
70
+
> Asciidoctor.js converts all attribute names to lower case letters. Example `:eleventy-aTitle:` will be made available as `atitle` in front matter data (also as `eleventy-atitle` in document attributes).
71
+
38
72
### Customize with Options
39
73
40
74
You can pass options to `convert()` of Asciidoctor.js as second argument in `addPlugin()`.
@@ -92,6 +126,12 @@ module.exports = function (eleventyConfig) {
92
126
93
127
Refer to [Asciidoctor.js documentation](https://docs.asciidoctor.org/asciidoctor.js/latest/extend/extensions/) to know more about extensions.
94
128
129
+
####`eleventyAttributesPrefix`
130
+
131
+
Default value is `eleventy-`.
132
+
133
+
This config can be used to change the prefix string for [AsciiDoc style front matter](#front-matter).
134
+
95
135
### CSS Styles
96
136
97
137
The plugin does not include any CSS styles. It is up to you to style the content.
0 commit comments