Quick Start Guide¶
This guide will get you up and running with Jekyll Pandoc Exports in 5 minutes.
Prerequisites¶
- Jekyll site already set up
- Pandoc and LaTeX installed (Installation Guide)
Step 1: Add the Plugin¶
Add to your Gemfile:
Enable in _config.yml:
Install:
Step 2: Configure Basic Settings¶
Add to your _config.yml:
pandoc_exports:
enabled: true
output_dir: 'downloads'
collections: ['pages', 'posts']
inject_downloads: true
Step 3: Mark Pages for Export¶
Add front matter to any page:
---
title: My Important Document
docx: true # Generate Word document
pdf: true # Generate PDF
---
# My Important Document
This content will be exported to both DOCX and PDF formats.
## Features
- Professional formatting
- Automatic download links
- Consistent styling
Step 4: Build Your Site¶
Step 5: Check Results¶
Your site now has:
- Generated files:
_site/downloads/my-important-document.docxand.pdf - Download links: Automatically injected into the page
- Accessible URLs:
/downloads/my-important-document.docx
Example Output¶
The plugin automatically adds download links to your pages:
<div class="pandoc-downloads no-print">
<p><strong>Download Options:</strong></p>
<ul>
<li><a href="/downloads/my-document.docx">Word Document (.docx)</a></li>
<li><a href="/downloads/my-document.pdf">PDF Document (.pdf)</a></li>
</ul>
</div>
Advanced Configuration¶
Custom Output Directory¶
Per-Page PDF Options¶
Template Customization¶
pandoc_exports:
template:
header: '<div class="export-header">Company Name</div>'
footer: '<div class="export-footer">Confidential</div>'
css: '.export-header { font-weight: bold; text-align: center; }'
CLI Usage¶
Convert individual files:
# Convert single file
jekyll-pandoc-exports --file page.html
# PDF only
jekyll-pandoc-exports --file page.html --format pdf
# Custom output directory
jekyll-pandoc-exports --file page.html --output /tmp/exports
Troubleshooting¶
No Files Generated¶
- Check that pages have
docx: trueorpdf: truein front matter - Verify Pandoc is installed:
pandoc --version - Check Jekyll build output for errors
Download Links Not Appearing¶
- Ensure
inject_downloads: truein configuration - Check that files were actually generated
- Verify CSS isn't hiding
.pandoc-downloadsclass
PDF Generation Fails¶
- Install LaTeX:
sudo apt-get install texlive-latex-base - Enable Unicode cleanup:
unicode_cleanup: true - Check for special characters in content