{ "name": "Jekyll-pdf", "tagline": "Create PDFs from Jekyll pages & documents.", "body": "# Jekyll PDF\r\n\r\nDynamically generate PDFs from Jekyll pages, posts & documents.\r\n\r\n[![Build Status](https://travis-ci.org/abeMedia/jekyll-pdf.svg?branch=master)](https://travis-ci.org/abeMedia/jekyll-pdf)\r\n[![Dependency Status](https://gemnasium.com/badges/github.com/abeMedia/jekyll-pdf.svg)](https://gemnasium.com/github.com/abeMedia/jekyll-pdf)\r\n\r\n## Usage\r\n\r\nAdd `gem \"jekyll-pdf\"` to your `Gemfile` and run `bundle`, then add `jekyll-pdf` to your `_config.yml` like so:\r\n\r\n```yaml\r\ngems:\r\n - jekyll-pdf\r\n```\r\n\r\nNow add `pdf: true` to any page's or document's front-matter, that you'd like to create a PDF version of.\r\n\r\nTo activate **Jekyll PDF** for multiple pages or entire collections you can use Jekyll's [front-matter defaults](https://jekyllrb.com/docs/configuration/#front-matter-defaults). The following example will create PDFs for each post in your blog.\r\n\r\n```yaml\r\ndefaults:\r\n -\r\n scope:\r\n path: \"\"\r\n type: \"posts\"\r\n values:\r\n pdf: true\r\n```\r\n\r\nLink to the PDF using the `{{ page.pdf_url }}` liquid variable.\r\n\r\n\r\n## Configuration\r\n\r\n**Jekyll PDF** supports any configuration parameters [wkhtmltopdf](http://wkhtmltopdf.org/) does. For a full list of configuration parameters it supports see http://wkhtmltopdf.org/usage/wkhtmltopdf.txt\r\n\r\n```yaml\r\npdf:\r\n cache: false | directory | default: .asset-cache\r\n page_size: A4, Letter, etc. | default: A4\r\n layout: layout | default: pdf\r\n```\r\n\r\nAll configuration parameters (with exception of `cache`) can be overridden from your page's or it's PDF layout's front-matter.\r\n\r\n### Cache Folder\r\n\r\nIf Jekyll Assets is installed, Jekyll PDF will automatically use the same cache folder as Jekyll Assets (unless specified otherwise).\r\n\r\n## Layouts\r\n\r\n**Jekyll PDF** will check for your current layout suffixed with `_pdf` e.g. if you're using a layout called `post`, it will look for `_layouts/post_pdf.html`, falling back to your default PDF layout (usually `_layouts/pdf.html`). \r\n\r\nTo override this behaviour, add the `pdf_layout` variable to your page's YAML front-matter. For example:\r\n\r\n```yaml\r\npdf_layout: my_custom_pdf_layout\r\n```\r\n\r\n## Partials (Header, Footer & Cover Page)\r\n\r\nWe'll automatically look for all partials in `_includes` directory, e.g. `header_html: pdf_header.html` will tell Jekyll PDF use `_includes/pdf_header.html`. \r\n\r\nPlease note that wkhtmltopdf requires all partials to be valid HTML documents for example:\r\n\r\n```html\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n Page {{ page.pdf.page }} of {{ page.pdf.topage }}\r\n\r\n\r\n```\r\n\r\n### Supported header & footer variables\r\n\r\n| Liquid | Description |\r\n|--------------------------------|-------------------------------------------------------------|\r\n| `{{ page.pdf.page }}` | Replaced by the number of the pages currently being printed |\r\n| `{{ page.pdf.topage }}` | Replaced by the number of the last page to be printed |\r\n| `{{ page.pdf.section }}` | Replaced by the content of the current h1 tag |\r\n| `{{ page.pdf.subsection }}` | Replaced by the content of the current h2 tag |\r\n| `{{ page.pdf.subsubsection }}` | Replaced by the content of the current h3 tag |\r\n\r\n\r\n## Troubleshooting\r\n\r\n### Images aren't displaying in the PDF\r\n\r\nIf your images aren't displaying in the PDF, this is most likely due to the fact that wkhtmltopdf doesn't know where to look. Try prefixing your image URLs with `file://{{ site.dest }}`. \r\nFor asset URLs in CSS files we recommend creating a separate CSS file overriding the URLs with the prefix mentioned above.\r\n\r\n---\r\n\r\n## To Do\r\n\r\n- Remove PDFKit Dependency\r\n- Write tests (rspec)\r\n- Package default PDF layout file in Gem\r\n- Support layouts in partials", "note": "Don't delete this file! It's used internally to help with page regeneration." }