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 tag error: bibliography not a recognized Liquid tag #163

Closed
moxpower opened this issue Sep 8, 2016 · 8 comments
Closed

Liquid tag error: bibliography not a recognized Liquid tag #163

moxpower opened this issue Sep 8, 2016 · 8 comments

Comments

@moxpower
Copy link

moxpower commented Sep 8, 2016

Hi! I have a similar error to Issue #142.
When I serve locally via bundle exec jekyll serve everything works fine. On github, (I run Jekyll on master) I get this exception:

bibliographyon line 3 in_pages/Bibliography.md` is not a recognized Liquid tag

What's the problem for jekyll-scholar?

From my Gemfile.lock:

jekyll-scholar (5.8.2)
      bibtex-ruby (~> 4.0, >= 4.0.13)
      citeproc-ruby (~> 1.0)
      csl-styles (~> 1.0)
      jekyll (~> 3.0)

From my _config.yaml:

# Plugins
gems:
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-scholar
  - jekyll-gist
  - jekyll-feed
  - jemoji

# mimic GitHub Pages with --safe
whitelist:
  - jekyll-paginate
  - jekyll-sitemap
  - jekyll-scholar
  - jekyll-gist
  - jekyll-feed
  - jemoji

# Reading Files
include:
  - .htaccess
  - _pages
  - Gemfile
exclude:
  - "*.sublime-project"
  - ...

And my Gemfile:

source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!

gem "github-pages", group: :jekyll_plugins

# If you want to use Jekyll native, uncomment the line below.
# To upgrade, run `bundle update`.

# gem "jekyll"
gem "jekyll-scholar"

gem "wdm", "~> 0.1.0" if Gem.win_platform?

# If you have any plugins, put them here!
group :jekyll_plugins do
  # gem "jekyll-archives"
  gem "jekyll-scholar"
end

Do I need to restart sth because I changed the _config.yaml? Or is it because I run on master? Your help is appreciated :)

@inukshuk
Copy link
Owner

inukshuk commented Sep 8, 2016

@moxpower
Copy link
Author

moxpower commented Sep 9, 2016

Hey, thanks for your answer! Just to understand if I understood this correctly:

  • I have the Jekyll local build, that I see when I execute bundle exec jekyll serve
  • I push this to a new branch, lets say develop
  • This develop branch should have a place, let's say _site/ where all static files are stored
  • I push only the _site/ folder on my master branch

Now, github accesses the external plugins like Jekyll-scholar through the develop branch?

@inukshuk
Copy link
Owner

inukshuk commented Sep 11, 2016

No. GitHub will not access any external plugins at all for security reasons. Therefore, the solution is to generate your site locally (which is what you do when you run jekyll serve or jekyll build anyway) and push only the generated site (i.e., the contents of _site) to the GitHub branch used for GitHub pages (this used to be the gh_pages branch, don't know if they use master now).

So the basic idea is quite simple: you have two branches, one contains everything you need to run jekyll the other one contains only the generated _site folder. You work only in the former branch, the latter branch contains only the product generated by jekyll. The tricky part is how to set this up so that it is easy to maintain: ideally you would write a script which commits the _site folder to the GitHub pages branch; then you can 'deploy' your site by running that script (you could also set up hooks to automatically do this on every commit).

@moxpower
Copy link
Author

Thank you, Sylvester! This helped me a lot. I did not know that _site folder was created automatically. Thanks for explaining this to me!

@anupamjamatia
Copy link

gh_pages branch

I am not able to upload the _site content in the github. Can you please help me out. Locally I have compiled jekyll for bibtex in publication and it is running fine in local machine http://127.0.0.1:4000/
but while uploaded the _site i am getting

The tag bibliography on line 3 in publication.md is not a recognized Liquid tag.

Please help me out

@WeilinDeng
Copy link

WeilinDeng commented Mar 11, 2020

No. GitHub will not access any external plugins at all for security reasons. Therefore, the solution is to generate your site locally (which is what you do when you run jekyll serve or jekyll build anyway) and push only the generated site (i.e., the contents of _site) to the GitHub branch used for GitHub pages (this used to be the gh_pages branch, don't know if they use master now).

So the basic idea is quite simple: you have two branches, one contains everything you need to run jekyll the other one contains only the generated _site folder. You work only in the former branch, the latter branch contains only the product generated by jekyll. The tricky part is how to set this up so that it is easy to maintain: ideally you would write a script which commits the _site folder to the GitHub pages branch; then you can 'deploy' your site by running that script (you could also set up hooks to automatically do this on every commit).

Hi @inukshuk, can you please elaborate your answer a little bit? I have the same issue.

The page build failed for the master branch with the following error:
The tag bibliography on line 3 in _pages/publications.md is not a recognized Liquid tag.

I run ./bin/deploy in terminal to create a new branch gh-pages in the same repository.

Would you please explain how to setup in detail so that the page can be successfully built? (Consider I am basically a beginner to Github.) Thanks!

Hi @moxpower, can you please elaborate how you fix the issue? Thanks.

@inukshuk
Copy link
Owner

I don't know how up-to-date this is, but here's an example of using a separate branch to manage pages with external plugins.

@inukshuk
Copy link
Owner

inukshuk commented Mar 11, 2020

You need to generate the site locally (or using a GitHub action or similar CI server), then you push only the generated site to your GitHub pages repo/branch -- the generated site is the fully-built, static HTML page; it won't have any bibliography tag anymore (or any other liquid tags for that matter). So you appear to be pushing the sources to your pages branch, not the built page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants