clayh53 / tufte-jekyll

Minimal Jekyll blog styled to resemble the look and layout of Edward Tufte's books
MIT License
620 stars 206 forks source link

Github Build failed: custom liquid tags #56

Closed judepayne closed 4 years ago

judepayne commented 7 years ago

Hi, first of all, thanks for your theme. It's beautiful. I am a long standing fan of Tufte as you must be! I am not a Ruby programmer and am stuck getting the theme to build, not locally which works fine but when I push the changes to GitHub. Then I get an email back saying:

The page build failed with the following error:

The tag `math` on line 26 in `_posts/2015-10-03-Edge-Cases.md` is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error.

If I remove that file, the custom liquid tags (that you have detailed in your readme) will cause the build to fail one after the other. As mentioned, my local build based on jekyll 3.1.3 and kramdown 1.13.1 works just fine. This is similar to another issue raised here where the problem was with the local build rather than the remote GitHub pages build. Mine is the opposite. any tips would be appreciated! thanks

clayh53 commented 7 years ago

Hi Judy,

The issue is because of the custom tags. Github (for security reasons) does not build a Jekyll site that contains custom Liquid tags. See this:

https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/

So the procedure for any Jekyll site with custom tags (which is probably most of them, actually) is to do the build on your local computer as you have been doing, then push the completely built static site to a special branch on your Git repo. This branch is called gh-pages, not the master branch. This allows one Github account to host multiple websites as well, since each site is in its own repo on a gh-pages branch.

It all seems sort of murky at first, but the jekyllrb.com site has a good discussion on all this. In particular, you will want to read the project pages part here :

http://jekyllrb.com/docs/github-pages/#project-pages

You will also need to be aware of the thing called baseurl. Basically, when the project is built locally, the baseurl defaults to the root of the folder you are working in. But you must specify a baseurl when you do the build that you are going to push to the gh-pages branch on github so the links and files will work properly.

Here is the Jekyll chief maintainer's explanation of baseurl:

https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/

It will all work. It just requires a little plumbing.

-Clay On Dec 6, 2016, at 7:25 AM, Jude Payne notifications@github.com wrote:

Hi, first of all, thanks for your theme. It's beautiful. I am a long standing fan of Tufte as you must be! I am not a Ruby programmer and am stuck getting the theme to build, not locally which works fine but when I push the changes to GitHub. Then I get an email back saying:

The page build failed with the following error:

The tag math on line 26 in _posts/2015-10-03-Edge-Cases.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error. If I remove that file, the custom liquid tags (that you have detailed in your readme) will cause the build to fail one after the other. As mentioned, my local build based on jekyll 3.1.3 and kramdown 1.13.1 works just fine. This is similar to another issue raised here where the problem was with the local build rather than the remote GitHub pages build. Mine is the opposite. any tips would be appreciated! thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

judepayne commented 7 years ago

Thanks Clay - makes sense.

One final question I have is how practically speaking do you switch back and forth between your master and gh-pages branches and push all to GitHub to have just the site files on the go-pages branches and everything else on master?

Thanks Jude

On 6 Dec 2016, at 13:37, Clay H notifications@github.com wrote:

Hi Judy,

The issue is because of the custom tags. Github (for security reasons) does not build a Jekyll site that contains custom Liquid tags. See this:

https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/

So the procedure for any Jekyll site with custom tags (which is probably most of them, actually) is to do the build on your local computer as you have been doing, then push the completely built static site to a special branch on your Git repo. This branch is called gh-pages, not the master branch. This allows one Github account to host multiple websites as well, since each site is in its own repo on a gh-pages branch.

It all seems sort of murky at first, but the jekyllrb.com site has a good discussion on all this. In particular, you will want to read the project pages part here :

http://jekyllrb.com/docs/github-pages/#project-pages

You will also need to be aware of the thing called baseurl. Basically, when the project is built locally, the baseurl defaults to the root of the folder you are working in. But you must specify a baseurl when you do the build that you are going to push to the gh-pages branch on github so the links and files will work properly.

Here is the Jekyll chief maintainer's explanation of baseurl:

https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/

It will all work. It just requires a little plumbing.

-Clay On Dec 6, 2016, at 7:25 AM, Jude Payne notifications@github.com wrote:

Hi, first of all, thanks for your theme. It's beautiful. I am a long standing fan of Tufte as you must be! I am not a Ruby programmer and am stuck getting the theme to build, not locally which works fine but when I push the changes to GitHub. Then I get an email back saying:

The page build failed with the following error:

The tag math on line 26 in _posts/2015-10-03-Edge-Cases.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error. If I remove that file, the custom liquid tags (that you have detailed in your readme) will cause the build to fail one after the other. As mentioned, my local build based on jekyll 3.1.3 and kramdown 1.13.1 works just fine. This is similar to another issue raised here where the problem was with the local build rather than the remote GitHub pages build. Mine is the opposite. any tips would be appreciated! thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

clayh53 commented 7 years ago

Just switch to the gh-pages branch and push the commit. This may help:

https://gist.github.com/chrisjacob/833223

On Dec 6, 2016, at 12:38 PM, Jude Payne notifications@github.com wrote:

Thanks Clay - makes sense.

One final question I have is how practically speaking do you switch back and forth between your master and gh-pages branches and push all to GitHub to have just the site files on the go-pages branches and everything else on master?

Thanks Jude

On 6 Dec 2016, at 13:37, Clay H notifications@github.com wrote:

Hi Judy,

The issue is because of the custom tags. Github (for security reasons) does not build a Jekyll site that contains custom Liquid tags. See this:

https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/

So the procedure for any Jekyll site with custom tags (which is probably most of them, actually) is to do the build on your local computer as you have been doing, then push the completely built static site to a special branch on your Git repo. This branch is called gh-pages, not the master branch. This allows one Github account to host multiple websites as well, since each site is in its own repo on a gh-pages branch.

It all seems sort of murky at first, but the jekyllrb.com site has a good discussion on all this. In particular, you will want to read the project pages part here :

http://jekyllrb.com/docs/github-pages/#project-pages

You will also need to be aware of the thing called baseurl. Basically, when the project is built locally, the baseurl defaults to the root of the folder you are working in. But you must specify a baseurl when you do the build that you are going to push to the gh-pages branch on github so the links and files will work properly.

Here is the Jekyll chief maintainer's explanation of baseurl:

https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/

It will all work. It just requires a little plumbing.

-Clay On Dec 6, 2016, at 7:25 AM, Jude Payne notifications@github.com wrote:

Hi, first of all, thanks for your theme. It's beautiful. I am a long standing fan of Tufte as you must be! I am not a Ruby programmer and am stuck getting the theme to build, not locally which works fine but when I push the changes to GitHub. Then I get an email back saying:

The page build failed with the following error:

The tag math on line 26 in _posts/2015-10-03-Edge-Cases.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error. If I remove that file, the custom liquid tags (that you have detailed in your readme) will cause the build to fail one after the other. As mentioned, my local build based on jekyll 3.1.3 and kramdown 1.13.1 works just fine. This is similar to another issue raised here where the problem was with the local build rather than the remote GitHub pages build. Mine is the opposite. any tips would be appreciated! thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

clayh53 commented 7 years ago

Also, take a look at the UploadtoGithub rakefile. This file basically does all the fiddling around you need to push the built site to the gh-pages branch. this section does the work:

Dir.mktmpdir do |tmp|
    system "mv _site/* #{tmp}"
    system "git checkout -B gh-pages"
    system "rm -rf *"
    system "mv #{tmp}/* ."
    message = "Site updated at #{Time.now.utc}"
    system "git add ."
    system "git commit -am #{message.shellescape}"
    system "git push origin gh-pages --force"
    system "git checkout master"
judepayne commented 7 years ago

Thanks so much! Everything is working now. The old double clone .. would have taken me a while to get that :)

On 6 Dec 2016, at 18:31, Clay H notifications@github.com wrote:

Just switch to the gh-pages branch and push the commit. This may help:

https://gist.github.com/chrisjacob/833223

On Dec 6, 2016, at 12:38 PM, Jude Payne notifications@github.com wrote:

Thanks Clay - makes sense.

One final question I have is how practically speaking do you switch back and forth between your master and gh-pages branches and push all to GitHub to have just the site files on the go-pages branches and everything else on master?

Thanks Jude

On 6 Dec 2016, at 13:37, Clay H notifications@github.com wrote:

Hi Judy,

The issue is because of the custom tags. Github (for security reasons) does not build a Jekyll site that contains custom Liquid tags. See this:

https://help.github.com/articles/adding-jekyll-plugins-to-a-github-pages-site/

So the procedure for any Jekyll site with custom tags (which is probably most of them, actually) is to do the build on your local computer as you have been doing, then push the completely built static site to a special branch on your Git repo. This branch is called gh-pages, not the master branch. This allows one Github account to host multiple websites as well, since each site is in its own repo on a gh-pages branch.

It all seems sort of murky at first, but the jekyllrb.com site has a good discussion on all this. In particular, you will want to read the project pages part here :

http://jekyllrb.com/docs/github-pages/#project-pages

You will also need to be aware of the thing called baseurl. Basically, when the project is built locally, the baseurl defaults to the root of the folder you are working in. But you must specify a baseurl when you do the build that you are going to push to the gh-pages branch on github so the links and files will work properly.

Here is the Jekyll chief maintainer's explanation of baseurl:

https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/

It will all work. It just requires a little plumbing.

-Clay On Dec 6, 2016, at 7:25 AM, Jude Payne notifications@github.com wrote:

Hi, first of all, thanks for your theme. It's beautiful. I am a long standing fan of Tufte as you must be! I am not a Ruby programmer and am stuck getting the theme to build, not locally which works fine but when I push the changes to GitHub. Then I get an email back saying:

The page build failed with the following error:

The tag math on line 26 in _posts/2015-10-03-Edge-Cases.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error. If I remove that file, the custom liquid tags (that you have detailed in your readme) will cause the build to fail one after the other. As mentioned, my local build based on jekyll 3.1.3 and kramdown 1.13.1 works just fine. This is similar to another issue raised here where the problem was with the local build rather than the remote GitHub pages build. Mine is the opposite. any tips would be appreciated! thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clayh53/tufte-jekyll/issues/56#issuecomment-265231735, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIoMDBUnOrFUzcQ4hmkIBu7ZWI6RrO3ks5rFanlgaJpZM4LFWeW.

shoaibkhanz commented 5 years ago

I get the same error, Your site is having problems building: The tag math on line 26 in _posts/2015-10-03-Edge-Cases.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error/.

even though I am building my website locally and pushing it to the gh-pages branch. What is it that I am missing, I am a novice when it comes to Jekyll but I have been able to push another theme but this one seems to be causing issues. any guidance will be highly appreciated. Mathjax is important to me as I am creating a blog on ML.

RJ722 commented 5 years ago

@shoaibkhanz I know it's a little late and you might have either figured out how to do it or just settled for another blog, but I'm just leaving a note here for future users:

The gh-pages branch which would be uploaded to GitHub shall contain nothing except for the contents of _site directory which you generate by building your blog locally (this directory is not tracked by git). If you find the process to build -> copy the directory -> changing branch cumbersome, you can just type in rake and it shall automatically do this for you.

clayh53 commented 4 years ago

I have removed the math tag from the repo and now use $$ .. $$ pairs that Kramdown understands.