Embed pdf in Github pages

Hello, I was wondering if anyone knows a way to embed (i.e. display on that exact page) a pdf file that I’ve added to my github repo (in like a folder called _pdfs in the main directory). I’d like to avoid just having a link that the viewer can click on which opens in another page, or prompts a download.

I’m pretty new to html and working with github pages, so I’ll be happy to get any advice.

In case it matters, I’m using minimal mistakes as a template for my GHpages.

2 Likes

I had this exact requirement and found that using HMTL object worked in a single line of code.
Source: jekyll - Inserting my pdf in my blogs - Stack Overflow

<object data="../assets/path/to/document.pdf" width="1000" height="1000" type='application/pdf'></object>

1 Like