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
+31-10Lines changed: 31 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ module.exports = function (eleventyConfig) {
35
35
};
36
36
```
37
37
38
-
###Front Matter
38
+
## Front Matter
39
39
40
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
41
@@ -68,7 +68,7 @@ Hello everyone!
68
68
> [!WARNING]
69
69
> 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).
70
70
71
-
#### Data Cascade
71
+
### Data Cascade
72
72
73
73
Data specified using AsciiDoc style front matter override YAML (or front matter in other Eleventy supported formats).
74
74
@@ -87,9 +87,36 @@ In the above case, front matter data will have `{ layout: layout-b.njk }`.
87
87
88
88
In the case of `title`, [the AsciiDoc document title](https://docs.asciidoctor.org/asciidoc/latest/document/title/) (including `title` and `doctitle` attributes) takes precedence over front matter.
89
89
90
-
### Customize with Options
90
+
## Options
91
+
92
+
You can pass options as the second argument in `addPlugin()`.
93
+
94
+
### Options for this plugin
95
+
96
+
####`eleventyAttributesPrefix`
97
+
98
+
Default value is `eleventy-`.
99
+
100
+
This config can be used to change the prefix string for [AsciiDoc style front matter](#front-matter).
101
+
102
+
####`resolveDocumentTitle`
103
+
104
+
Default value is `false`.
105
+
106
+
If enabled, the title will be resolved from the heading of the first section in the document. Otherwise, the title will be the Level 0 heading.
107
+
108
+
```adoc
109
+
== A second level heading
110
+
111
+
This text is written in AsciiDoc format.
112
+
```
113
+
114
+
With `resolveDocumentTitle: true`, the above document will have a title (in page data). `A second level heading`.
115
+
116
+
### Options for Asciidoctor.js
117
+
118
+
All properties other than [the ones specific to the plugin](#options-for-this-plugin) will be passed to Asciidoctor.js.
91
119
92
-
You can pass options to `convert()` of Asciidoctor.js as second argument in `addPlugin()`.
93
120
These are the [available options](https://docs.asciidoctor.org/asciidoctor.js/latest/processor/convert-options/).
94
121
95
122
```js
@@ -144,12 +171,6 @@ module.exports = function (eleventyConfig) {
144
171
145
172
Refer to [Asciidoctor.js documentation](https://docs.asciidoctor.org/asciidoctor.js/latest/extend/extensions/) to know more about extensions.
146
173
147
-
####`eleventyAttributesPrefix`
148
-
149
-
Default value is `eleventy-`.
150
-
151
-
This config can be used to change the prefix string for [AsciiDoc style front matter](#front-matter).
152
-
153
174
### CSS Styles
154
175
155
176
The plugin does not include any CSS styles. It is up to you to style the content.
0 commit comments