'How to embed a local pdf file in mkdocs generated website on github-pages?
I have a private repository with some pdf files among others. The content is however, made publicly available using MkDocs (material) and github-pages. I want to embed these locally available pdf files on the website (created with MkDocs). So far I have tried this:
# Method-1
<object data="/path/to/file.pdf" type="application/pdf">
<embed src="/path/to/file.pdf" type="application/pdf" />
</object>
# Method-2
<a href="/path/to/file.pdf" class="image fit"><i class="fas fa-file-pdf"></i></a>
The /path/to/file.pdf, when shared from Google Drive (made publicly available), works. But, it does not work when I try to show the files kept within the docs folder in my github repository.
How can I show them from the repository itself (without having to copy and share the files from GDrive)?
For github pages:
- only the contents of the
docsfolder are pushed to thegh-pagesbranch and then GitHub Pages publishes these contents as the website.
Related Material
Stackoverflow:
GitHub Community:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
