Set up travis rubygems deploy & add PDFs to pages collection

This commit is contained in:
Adam Bouqdib 2016-09-20 03:30:14 +00:00
parent e239c2d259
commit 1e24af2285
4 changed files with 19 additions and 22 deletions

View File

@ -26,8 +26,8 @@ notifications:
# #
branches: deploy:
only: provider: rubygems
- master api_key: $RUBYGEMS_KEY
on:
# tags: true

View File

@ -1,17 +1,17 @@
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.version = "0.1.6a" spec.name = "jekyll-pdf"
spec.version = "0.1.6"
spec.summary = "A PDF generator for Jekyll"
spec.description = "A Jekyll plugin for generating PDFs from your pages, posts & documents."
spec.license = "GPL-3.0"
spec.homepage = "http://github.com/abemedia/jekyll-pdf/" spec.homepage = "http://github.com/abemedia/jekyll-pdf/"
spec.authors = ["Adam Bouqdib"] spec.authors = ["Adam Bouqdib"]
spec.email = ["adam@abemedia.co.uk"] spec.email = ["adam@abemedia.co.uk"]
spec.files = %W(Gemfile README.md LICENSE) + Dir["lib/**/*"]
spec.summary = "PDF generator for Jekyll" spec.files = `git ls-files`.split($/)
spec.name = "jekyll-pdf"
spec.license = "GPL-3.0"
spec.has_rdoc = false spec.has_rdoc = false
spec.require_paths = ["lib"] spec.require_paths = ["lib"]
spec.description = spec.description = <<-DESC
A Jekyll plugin, that allows you to create PDF versions of your pages & documents.
DESC
spec.add_runtime_dependency "wkhtmltopdf-installer", "~> 0.12" spec.add_runtime_dependency "wkhtmltopdf-installer", "~> 0.12"
spec.add_runtime_dependency "pdfkit", "~> 0.8" spec.add_runtime_dependency "pdfkit", "~> 0.8"

View File

@ -75,9 +75,6 @@ module Jekyll
File.open("#{path}.html", 'w') {|f| f.write(self.output) } if @settings["debug"] File.open("#{path}.html", 'w') {|f| f.write(self.output) } if @settings["debug"]
@settings.delete("debug") @settings.delete("debug")
# Trigger post-write so jekyll-assets builds assets required for the PDF
Jekyll::Hooks.trigger hook_owner, :post_write, self
# Build PDF file # Build PDF file
fix_relative_paths fix_relative_paths
kit = PDFKit.new(self.output, @settings) kit = PDFKit.new(self.output, @settings)

View File

@ -8,7 +8,7 @@ module Jekyll
# Loop through pages & documents and build PDFs # Loop through pages & documents and build PDFs
[site.pages, site.documents].each do |items| [site.pages, site.documents].each do |items|
items.each do |item| items.each do |item|
site.static_files << Document.new(site, site.source, item) if item.data['pdf'] site.pages << Document.new(site, site.source, item) if item.data['pdf']
end end
end end
end end