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

Create a Jekyll data file with topic information and use it for topic links #3

Open
dagoss opened this issue Mar 19, 2016 · 0 comments

Comments

@dagoss
Copy link
Owner

dagoss commented Mar 19, 2016

Jekyll can work with JSON, YAML, and CSV files natively. Most configuration of Jekyll is done with yaml, so that's probably the preferred tool here.

The plugin should generate a data file of my-map.ditamap named my-map.yml with a structure like this:

uniqe-id-for-topic1:
  - title: "The Title of the Topic 1"
  - url: "relative/path/to/topic1/"
uniqe-id-for-topic2:
  - title: "The Title of the Topic 2"
  - url: "relative/path/to/topic2/"

Instead of using hrefs to topics in the output, mustache templates should be used instead. So a link to one of the topics above would appear as:

<a href="{{ site.data.my-map.unique-id-for-topic1.url }}">site.data.my-map.unique-id-for-topic1.title</a>

This would allow URLs to be further processed by Jekyll before pushing content. It might also be useful in the future to have more data about topics in the data file (such as keywords, shortdesc, and other metadata).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant