Each resource in the sitemap of a Middleman site has a page ID, whether implicit or explicit. The page ID can be used to create a reference to a resource. In a template context, the url_for helper is used for this purpose. Extend the AsciiDoc xref macro to support create page references by page ID in an AsciiDoc document, effectively emulating the behavior of the url_for helper.
This extended behavior needs to be distinguished from a normal inter-document xref. This can either by done by:
a) requiring the page ID to be prefixed with /, or
b) requiring a normal inter-document xref to be prefixed with ./.
Here's an example of a page reference under proposal a).
xref:/about#[]
Here's an example of a page reference under proposal b)
xref:about#[]
Another idea is to require the extension, .adoc, to make a normal inter-document xref. This works since the page ID does not include the extension.
Each resource in the sitemap of a Middleman site has a page ID, whether implicit or explicit. The page ID can be used to create a reference to a resource. In a template context, the
url_for
helper is used for this purpose. Extend the AsciiDoc xref macro to support create page references by page ID in an AsciiDoc document, effectively emulating the behavior of theurl_for
helper.This extended behavior needs to be distinguished from a normal inter-document xref. This can either by done by:
a) requiring the page ID to be prefixed with
/
, or b) requiring a normal inter-document xref to be prefixed with./
.Here's an example of a page reference under proposal a).
Here's an example of a page reference under proposal b)
Another idea is to require the extension,
.adoc
, to make a normal inter-document xref. This works since the page ID does not include the extension.