Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mihajlonesic/jekyll-pdf-embed
:page_facing_up: :pushpin: Jekyll plugin for embedding PDF and PowerPoint files to any page or post
https://github.com/mihajlonesic/jekyll-pdf-embed
embed gem jekyll pdf plugin ruby
Last synced: 2 months ago
JSON representation
:page_facing_up: :pushpin: Jekyll plugin for embedding PDF and PowerPoint files to any page or post
- Host: GitHub
- URL: https://github.com/mihajlonesic/jekyll-pdf-embed
- Owner: MihajloNesic
- License: gpl-3.0
- Created: 2019-09-08T11:31:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T11:44:02.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T18:24:03.166Z (8 months ago)
- Topics: embed, gem, jekyll, pdf, plugin, ruby
- Language: Ruby
- Homepage: https://mihajlonesic.gitlab.io/projects/jekyll-pdf-embed/
- Size: 32.2 KB
- Stars: 51
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jekyll PDF Embed
[![Gem Version](https://badge.fury.io/rb/jekyll-pdf-embed.svg)](https://badge.fury.io/rb/jekyll-pdf-embed) [![Ruby Gem](https://github.com/MihajloNesic/jekyll-pdf-embed/actions/workflows/gem-push.yml/badge.svg)](https://github.com/MihajloNesic/jekyll-pdf-embed/actions/workflows/gem-push.yml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)**Jekyll PDF Embed** is a ruby gem for [Jekyll](https://jekyllrb.com/) static site generator.
It allows user to easily embed external or local PDF files to any page or blog post.## Installation
### RubyGems
Add this line to your Gemfile:
```ruby
group :jekyll_plugins do
gem "jekyll-pdf-embed"
end
```And then execute:
```shell
$ bundle
```Alternatively install the gem yourself as:
```shell
$ gem install jekyll-pdf-embed
```and put this in your ``_config.yml``
```yaml
plugins:
- jekyll-pdf-embed
```### GitHub RubyGems registry
Install from the command line (you can put any version you want, check the latest):
```shell
$ gem install jekyll-pdf-embed --version "1.1.1" --source "https://rubygems.pkg.github.com/mihajlonesic"
```Alternatively, install via Gemfile:
```ruby
source "https://rubygems.pkg.github.com/mihajlonesic" do
gem "jekyll-pdf-embed", "1.1.1"
end
```## Usage
Your file **must** end with `.pdf`, `.ppt` or `.pptx`. Everyting else is forbidden.
### Basic
You can use external PDF files
```
{% pdf "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" %}
```or local
```
{% pdf "/files/pdf/sample.pdf" %}
```Use front matter
```
---
pdf_file: "/files/pdf/sample.pdf"
---{% pdf {{ page.pdf_file }} %}
```### Parameters
Use `no_link` to hide link to pdf file ('View PDF' header)
```
{% pdf "/files/pdf/sample.pdf" no_link %}
```Use `width` and/or `height` parameters to size the container. Default values are _width=100%_ and _height=500px_.
Order does not matter, and can be used in combination with _no_link_ parameter.
```
{% pdf "/files/pdf/sample.pdf" width=350px height=500px %}
```### Presentation
You can also embed PowerPoint presentations!
```
{% pdf "http://img.labnol.org/di/PowerPoint.ppt" %}
```Your file **must** end with `.pdf`, `.ppt` or `.pptx`. Everyting else is forbidden.
## Result
The embedded pdf output
[DEMO](https://mihajlonesic.gitlab.io/projects/jekyll-pdf-embed/#result)
[MORE EXAMPLES](https://mihajlonesic.gitlab.io/jpe-examples/)![](https://i.imgur.com/hdiVfm0.jpg)