Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend xref macro to support referencing a page by page ID #69

Open
mojavelinux opened this issue Dec 11, 2017 · 0 comments
Open

Extend xref macro to support referencing a page by page ID #69

mojavelinux opened this issue Dec 11, 2017 · 0 comments

Comments

@mojavelinux
Copy link
Contributor

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.

@mojavelinux mojavelinux changed the title Extend xref macro to support page references by page ID Extend xref macro to support referencing a page by page ID Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant