Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jekyll-pdf-thumbnail

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jekyll-pdf-thumbnail

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Jekyll PDF thumbnails generator

A Jekyll plugin to generate thumbnails for your PDF files

Usage

  1. Add the following to your site's Gemfile:
gem 'jekyll-pdf-thumbnail'
  1. Add the following to your site's config file:
plugins:
  - jekyll-pdf-thumbnail
  1. Use it in your .md files and liquid templates. Example markdown file:
    ---
    title: Homepage
    layout: null
    pdf_file: /assets/sample_1.pdf
    ---
    # {{ page.title }}

    {% assign other_pdf = 'sample_2.pdf' %}

    - This is a link to [{{page.pdf_file}}]({{page.pdf_file | absolute_url}})
    - This is a preview of ![sample_1.pdf]({{ page.pdf_file| pdf_thumbnail }})
    - This is a link to [sample_2.pdf]({{other_pdf | absolute_url }})
    - This is a preview of ![sample_2.pdf]({{ other_pdf | pdf_thumbnail }})
    - 50% resize: {{page.pdf_file | pdf_thumbnail: resize:'50%' }}
    - 25% resize: {{page.pdf_file | pdf_thumbnail: resize:'25%' }}
    - 25% resize, 50% quality: {{page.pdf_file | pdf_thumbnail: resize:'25%', quality:'50'}}
  • The format of the resize parameter is the image geometry as defined in the ImageMagick manual.
  • The format of the quality parameter is a number between 1 and 100 as defined in the Image Magick manual. Currently, only png thumbnails are supported. According to the manual:

    ... the quality value sets the zlib compression level (quality / 10) and filter-type (quality % 10). The default PNG "quality" is 75, which means compression level 7 with adaptive PNG filtering, unless the image has a color map, in which case it means compression level 7 with no PNG filtering.

Developing this extension

  • Setup: Clone the extension and execute bundle install to install the dependencies
  • Run tests: bundle exec rspec
  • Releasing a new version
    • Update jekyll-pdf-thumbnail.gemspec with new version and metadata.
    • Commit your changes.
    • Create a new git tag: git tag -a vx.y.z -m "Version x.y.z"
    • Push all the changes to github: git push origin && git push origin --tags
    • Build the Gem: gem build
    • Upload the new gem: gem push jekyll-pdf-thumbnail-x.y.z.gem

FAQs

Package last updated on 25 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc