0.0
A long-lived project that still receives updates
Allows that some documents, or pages to have a pdf version pre generated.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Make pdf Jekyll plugin.

Table of Contents
  • Installation
  • How the PDF is created.

This is a Jekyll plugin to enable the creation of PDFs along side the usual html documents.

Installation

Add to your site Gemfile :

# …
group :jekyll_plugins do
    gem 'make_pdf-jekyll'
    # … Other plugins may be here.
end

Then edit your Jekyll configuration.

Warning
The schema here is still in experimental phase. Expect changes until version 1.0 reached.
  1. _config

# …
destination: «some-path» (1)
# …
plugins:
    - make_pdf/jekyll
    # … Other plugins.

make-pdf:
    writer: Chrome                              # Requires `Chrome-headless-render-pdf` to be installed and on the path.

    # Bellow are the default settings :
    write-by-default: false                     # If set to true enables the generation
    source: file:                               # Where to get the sources.
    input-base-path: «some-relative-path»       # base path common to all input files.
    output-base-path: «some-path»               # base path where the pdf are stored.
    input-scheme: «http|file»                   # How to access the input HTML.
    output-dir: «some-path»                     # Path where to store pdf files.

    # Chrome-headless-render-pdf options :
    no-margins: true                            # Do not use margins.
    include-background:          sudo dnf install rubygem-{irb,rake,rbs,rexml,typeprof,test-unit} ruby-bundled-gems               # Include background.
    landscape: false                            # Don't use landscape.
    display-header-footer: false                # No header or footer.
    # There are more options for chrome.
  1. This is a limitation, I will update this in the future.

To each document that you want PDFs to be generated add the key make-pdf: true to it’s front-matter. If the option write-by-default is set to true, you can disable the PDF generation with make-pdf: false as well.

How the PDF is created.

The option 'writer' defines the strategy used to generate the PDFs. The only working option at the moment is 'Chrome', that uses 'Chrome-headless-render-pdf' to create the PDF. This may not work correctly, depending on how the asset files are specified in the output 'html' files.

You can also use your 'published' version, by setting both source: and base-source: configurations. Use source: http:// and base-source: «baseurl» to point the headless chrome to the correct URL.