Instead of loading the PDF directly from GitHub, include it in the GitHub Pages branches as a static file. This can be done simply by placing the file somewhere in the source tree :
Each other directory and file, with the exception of those listed above, such as folders cssand images, favicon.icoetc., will be copied verbatim to the generated site. There are many sites already using Jekyll if you are interested to see how they are laid out.
So put the PDF somewhere that makes sense, for example, in pdfs/foo.pdf.
To link to this PDF work both locally and on GitHub pages, Jekyll recommends the following (note especially point 2):
Jekyll, gh-pages GitHub. , URL, GitHub , URL-. URL- GitHub (username.imtqy.com/project-name/), Jekyll .
_config.yml baseurl /project-name - .
JS CSS : {{ site.baseurl }}/path/to/css.css - ( "path" ).
: {{ site.baseurl }}{{ post.url }} - , .
, , / jekyll serve, --baseurl, localhost:4000 ( /project-name ): jekyll serve --baseurl ''
, PDF {{ site.baseurl }}/pdfs/foo.pdf.