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 Exception: Liquid syntax error (line 42): Unknown tag 'toc' in /_layouts/post.html #1398

Closed
rodrigor opened this issue May 6, 2023 · 31 comments
Labels

Comments

@rodrigor
Copy link

rodrigor commented May 6, 2023

Acknowledge the following

Describe the bug
the theme doesn't build into GitHub pages.

The error:
Liquid Exception: Liquid syntax error (line 42): Unknown tag 'toc' in /_layouts/post.html

Screenshots
CleanShot 2023-05-06 at 12 09 49

Additional context

@rodrigor rodrigor added the bug label May 6, 2023
@ZahraBenslimane
Copy link

I have the same issue :/

@d-kozak
Copy link

d-kozak commented May 7, 2023

I am experiencing it as well.

@ZahraBenslimane
Copy link

I had this error the first time I forked the template. I was able to deploy the page by just changing the branch in settings >pages >Build and deployment
image

@edwinabot
Copy link

@ZahraBenslimane, I was able to replicate what you did, thanks. There is one caveat, though. It was possible only after running the deploy pipeline that I had the gh-pages branch working.

So you must first run the deploy pipeline for your desired branch
image

And later on, you'll see the pages-build-deployment pipeline passing
image

I don't know much about the different actions used here, but there's a link between the two pipelines... maybe a build cache @rodrigor ???

@gubazoltan
Copy link

@edwinabot, could you please explain what do you mean by deploy pipeline? I could not find such a workflow.

@george-gca
Copy link
Collaborator

@gubazoltan he meant the deploy action, which is defined here and used by Github pipelines to build your website.

@rishikeshF
Copy link

I am facing the same issue, has anyone found a solution to this ? @edwinabot mentioned about running 'deploy pipeline' and @george-gca referenced to the deploy action page script, but it is just a script and it is already present as it is in my repo as well. Has anyone resolved this ? or could someone clarify what needs to be done in simple steps, am not able to deploy my site.

@george-gca
Copy link
Collaborator

Does the error occur when running locally? Tomorrow I will try to replicate the error, or at least understand it better.

@tjvitchutripop
Copy link

I also ran into this error but was able to get my website deployed by switching my Build and Deployment source from "Deploy from a branch" to "GitHub Actions," and then performing the configuration for Jekyll (there should be a button that pops up below once you switch to GitHub Actions that will create the jekyll.yml for you).

@gubazoltan
Copy link

I managed to get around this problem without changing anything in the GemFile (as far as I remember).
What I did was that I used GitHub Pages and used the "Deploy Jekyll site to Pages" action to build the site.

@rishikeshF
Copy link

@tjvitchutripop your method didn't work for me. The build just failed.
@gubazoltan where did you find the 'Deploy Jekyll site to Pages' option ?

@rishikeshF
Copy link

rishikeshF commented May 23, 2023

Does the error occur when running locally? Tomorrow I will try to replicate the error, or at least understand it better.

@george-gca No, it works fine on local. I get this error when I try to deploy it on server.

@gubazoltan
Copy link

gubazoltan commented May 23, 2023

@rishikeshF Sorry, probably I misinterpreted the name and this is why you didn't find the action I quoted. I am not sure which one is that I am actually using but on this link you can find my workflow file that I am using to build my website. I believe that if you put this file into your workflow folder then it will also show up in the Actions option of the repository.

I hope it works.

@R3gardless
Copy link

@rishikeshF You can simply add jekyll.yml from "your repository" Setting > Pages > Build and deployment Source > Github Actions > Jekyll configure

liquidhiter added a commit to liquidhiter/liquidhiter_archieve that referenced this issue May 29, 2023
@george-gca
Copy link
Collaborator

george-gca commented Jun 22, 2023

The gh-pages branch solution is documented here, under the To enable automatic deployment section.

@eguar11011
Copy link

I had the same error and switched to the gh-page branch and now the page looks like this:
imagen
https://eguar11011.github.io/eguar1101.github.io/

how can i get the template format?

@george-gca
Copy link
Collaborator

george-gca commented Jun 27, 2023

This is probably due to your browser history session.

Press Shift + F5 on Chrome or Ctrl + F5 on Firefox to reload the page ignoring cached content, clean your browser history, or simply try it in a private session. PR #1478 is going to address this issue as soon as it is finished, to force reload of styles after changes.

Here is looking fine:

image

@eguar11011
Copy link

@george-gca Yes, it looks good now. I changed Build and deployment in source to Github Actions and it worked. Of course add the jekyll.yml

ferrispnugraha added a commit to ferrispnugraha/ferrispnugraha.github.io that referenced this issue Sep 2, 2023
blamster19 added a commit to blamster19/blamster19.github.io that referenced this issue Sep 10, 2023
Switch from deployment to branch to GH Actions according to tips (alshedivat/al-folio#1398).
liquidhiter added a commit to liquidhiter/liquidhiter_archieve that referenced this issue Dec 29, 2023
@daiqing98
Copy link

d and Deployment source from "Deploy from a branch" to "

Thanks a lot

@kevinli-webbertech
Copy link

kevinli-webbertech commented Jun 13, 2024

I have a .md file, and had a complaint for some shell expression in ``` block,

"
To use retry middleware with Faraday v2.0+, install faraday-retry gem
Liquid Exception: Liquid syntax error (line 74): Variable '{{1..3}' was not properly terminated with regexp: /}}/ in blog/md/ref/linux/linux_shell.md
/usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block_body.rb:136:in `raise_missing_variable_terminator': Liquid syntax error (line 74): Variable '{{1..3}' was not properly terminated with regexp: /\}\}/ (Liquid::SyntaxError)
"

The .md file contains shell expression,

{{1..3},{7..9}}

Might not be the same issue?

@george-gca
Copy link
Collaborator

This is a completely different issue.

@kevinli-webbertech
Copy link

This is a completely different issue.

Thanks @george-gca! I will file another ticket.

@HaochenZ11
Copy link

I have the same error after following the setup instructions strictly but @ZahraBenslimane method did not work. When I try to set gh-pages as the deploy source branch it says the folder is invalid and reverts back to deploying from main branch.
image

@george-gca
Copy link
Collaborator

I see you created a .github/workflows/jekyll.yml file in your repository. This is messing up your build. See this answer.

@HaochenZ11
Copy link

@george-gca sorry forgot to mention I only created that after the original method didn't work because it was suggested in another comment. I've deleted it and the same problem persists, I cannot select gh-pages as the deploy source branch.

@george-gca
Copy link
Collaborator

george-gca commented Jun 29, 2024

Have you made step 2 of our recommended approach?

In this new repository, go to Settings -> Actions -> General -> Workflow permissions and give Read and write permissions to GitHub Actions.

What other changes have you made to your repo besides the ones mentioned in the recommended approach? These should be the only ones needed.

@HaochenZ11
Copy link

Yes those steps were made already and no other changes to the repo were made. The deploy branch save button disappeared for awhile but after going through and reselecting all the settings and choosing another branch first then going back to selecting gh-pages it seems to be working now.

@george-gca
Copy link
Collaborator

Maybe it was a matter of waiting the build action to finish.

@Sustainability4
Copy link

image
@george-gca, I switched the repository to gh-pages in github pages and could deploy the website but the theme page is not coming up

@george-gca
Copy link
Collaborator

Note that this issue is already closed. For this check our FAQ.

@Manav1712
Copy link

@george-gca I am getting the same error. I followed all the steps mentioned to a t, didn't change anything. My code is still not able to fetch the stylesheet

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

No branches or pull requests