No commit activity in last 3 years
No release in over 3 years
Jekyll plugin to render documents in additional ways
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 12.0
~> 0.50

Runtime

~> 4.0
 Project Readme

Jekyll plugin to render documents in additional ways

This plugin allows to automatically generate an extra page for each document in specified collection(s). Additionally generated pages can be assigned a different layout and/or extra frontmatter variables, and will be placed under specified path.

Use cases

  • You want to keep documentation for your desktop app available via app’s main site (as usual), while reusing the same pages in context of app’s built-in web-based help, similar to e.g. what Xcode does.

    In this scenario you’d likely want to have your in-app documentation provide the same content, but in a slightly different layout (for example, excluding some page elements).

  • You want to output machine-readable JSON for each document.

Configuration

Specify the following in your _config.yml:

duplicate_documents:
  in_collection: <your collection name>
  under_url_prefix: <path to render documents under>
  format: <html or json>

  # These two are optional
  with_layout: <layout name>
  with_frontmatter:
    <variable>: <value>
    ...

Notes and limitations

  • Does not work with AsciiDoc or other pre-processed formats. Issue.

  • In case of JSON, you must still use a layout to build your structure. Specify layout: nil in your layout. Use jsonify filter to escape values or convert Ruby structures to JSON.

  • Currently, no nesting in extra frontmatter is allowed. Issue.

  • If any frontmatter specified clashes with page’s original frontmatter, frontmatter from jekyll-duplicate configuration will prevail.

Caution

Pages with duplicate content are discouraged by search engines.

You may, for example, want to make sure that extra pages, if they’re HTML, are not linked to from the “main site” and do not get indexed.

Contributing

PRs are welcome.

Release process

  • Update version number in .gemspec and commit your change.

  • Run ./develop/release to publish new gem version, tag the repo and push to GitHub.