Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquid syntax error: Unknown tag 'pdf' on build #7

Closed
guslipkin opened this issue Jan 2, 2022 · 8 comments
Closed

Liquid syntax error: Unknown tag 'pdf' on build #7

guslipkin opened this issue Jan 2, 2022 · 8 comments

Comments

@guslipkin
Copy link

guslipkin commented Jan 2, 2022

Hello. I was really excited to find and implement this and was able to do so pretty quickly, but for a few small errors.

If I tried to install with gem install jekyll-pdf-embed I would get an error that

Liquid Exception: Liquid syntax error (line 1): Unknown tag 'pdf' in [my file name]

When I changed to using

group :jekyll_plugins do
  gem "jekyll-pdf-embed"
end

bundle

it works locally just fine. However, when I upload to GitHub and go to deploy, neither method works and I get the same error.

@MihajloNesic
Copy link
Owner

Hello @guslipkin. Thank you for using this plugin.

GitHub does not support all plugins. According to the docs:

GitHub Pages cannot build sites using unsupported plugins. If you want to use unsupported plugins, generate your site locally and then push your site's static files to GitHub Enterprise.

See #1 for more detailed explanation

There is a workaround. You can use jekyll-deploy-action to deploy your Jekyll site with any plugin. Here is my implementation.

@MihajloNesic MihajloNesic pinned this issue Sep 27, 2022
@liver121888
Copy link

liver121888 commented Dec 6, 2022

Hi, I met with the same problem, but the error remained after I followed the instruction.
https://github.com/liver121888/liver121888.github.io
I additionally added the exclude: [vendor] in my file to solve the issue described in
jekyll/jekyll#2938
Am I missing something? I am new to Jekyll and Ruby.

@MihajloNesic
Copy link
Owner

Hi @liver121888,
I'm not sure why your deployment is not working. I've created another repo to test the deployment of Jekyll website with jekyll-pdf-embed plugin and everything works as expected -> https://github.com/MihajloNesic/jekyll-pdf-embed-starter

@liver121888
Copy link

Ok, this is very weird.
Initially, I included the below in the markdown post.
{% pdf "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" %}.
Then the build fails.
But I looked up the HTML generated locally and past the entire HTML into the markdown post, and it works.

<style> .pdf-embed-wrap-87f43424-063f-4e2e-8f19-5bdf01cb7be0 { display:flex; flex-direction: column; width: 100%; height: 650px; } .pdf-embed-container-87f43424-063f-4e2e-8f19-5bdf01cb7be0 { height: 100%; } .pdf-link-87f43424-063f-4e2e-8f19-5bdf01cb7be0 { background-color: white; text-align: center; border-style: solid; } .pdf-embed-container-87f43424-063f-4e2e-8f19-5bdf01cb7be0 iframe { width: 100%; height: 100%; } </style>
<div class="pdf-embed-wrap-87f43424-063f-4e2e-8f19-5bdf01cb7be0"> <div class="pdf-link-87f43424-063f-4e2e-8f19-5bdf01cb7be0"> <a href="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" target="_blank">View PDF</a> </div> <div class="pdf-embed-container-87f43424-063f-4e2e-8f19-5bdf01cb7be0"> <iframe src="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" frameborder="0" allowfullscreen=""></iframe> </div> </div>

Will this information help you understand the problem?
Any help is appreciated.

@liver121888
Copy link

Also, if I want to link to a pdf that's in another repository, the link seems not working.
https://github.com/liver121888/NTUBME-2021-MechatronicsIV-FinalProject/blob/master/MechatronicsIV.pdf
It will show: GitHub refuses to establish the connection.
image

@liver121888
Copy link

My workaround for this problem is to publish that repo as a site under my github.io. Hope this helps those who want to access files in a different repo.

@MihajloNesic
Copy link
Owner

MihajloNesic commented Dec 9, 2022

@liver121888
The different repo "issue" is because that repo is private. Because it is private, it is not accessible without authorizing yourself to GitHub, which you can't really do if you want to embed a PDF file.

As for the other issue, it is regarding your deployment, and not this plugin

@MihajloNesic
Copy link
Owner

I am locking this conversation because the purpose of it is to show what the issue with GitHub is and how to deploy your Jekyll site with this plugin, and not fixing other people's code. Thank you

Repository owner locked as resolved and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants