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
Eleventy plugin to add support for AsciiDoc.
You don’t need to use to shortcodes.
You can directly use AsciiDoc files (.adoc), just like Markdown (.md).
Any AsciiDoc document attributes that are prefixed with eleventy- (configurable) can be used as front matter. The prefix, eleventy-, will be removed from variable names available in the templates.
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.
:eleventy-permalink: /hello-world/:eleventy-layout: base.njk= Hello World
Hello everyone!
The above AsciiDoc attribute front matter is the same as YAML based front matter below:
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).
Data Cascade
Data specified using AsciiDoc style front matter override YAML (or front matter in other Eleventy supported formats).
The base_dir of convert options is relative to the document.
This can be changed using the above options.
attributes.outdir
By default, attributes.outdir will be the path to the output directory (permalink) of the document.
This can be changed using the above options.
extension_registry (⚠️ deprecated)
The convert option extension_registrywill not work as intended from Asciidoctor.js v3.0 onwards.
The extension_registry needs a newly created registry for each conversion.
Use the configure_extension_registry function instead.
configure_extension_registry
The configure_extension_registry should be a function which accepts a registry (instance of Extensions.Registry).
During each file conversion, the function will be called with a new registry.
This registry instance can be used to register extensions.
consteleventyAsciidoc=require("eleventy-plugin-asciidoc");constmyExtension=require("./my-extension.js");module.exports=function(eleventyConfig){eleventyConfig.addPlugin(eleventyAsciidoc,{configure_extension_registry(registry){myExtension.register(registry);// Or, myExtension(registry) depending on how// you have programmed your extension.},});};