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

Error: Unknown tag 'toc' #1438

Closed
3 tasks done
DriesSmit opened this issue May 20, 2023 · 25 comments
Closed
3 tasks done

Error: Unknown tag 'toc' #1438

DriesSmit opened this issue May 20, 2023 · 25 comments
Labels

Comments

@DriesSmit
Copy link

DriesSmit commented May 20, 2023

Acknowledge the following

  • I carefully read and followed the Getting Started guide.
  • I read through FAQ and searched through the past issues, none of which addressed my issue.
  • The issue I am raising is a potential bug in al-folio and not just a usage question.
    [For usage questions, please post in the Discussions instead of raising an issue.]

Describe the bug
I forked the repo as instructed. But the build then fails with the following message:

Warning:  github-pages can't satisfy your Gemfile's dependencies.
  Logging at level: debug
Configuration file: /github/workspace/./_config.yml
      GitHub Pages: github-pages v228
      GitHub Pages: jekyll v3.9.3
             Theme: jekyll-theme-primer
      Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0
         Requiring: jekyll-github-metadata
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
  Liquid Exception: Liquid syntax error (line 42): Unknown tag 'toc' in /_layouts/post.html
/usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block.rb:38:in `unknown_tag': Liquid syntax error (line 42): Unknown tag 'toc' (Liquid::SyntaxError)
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/tags/if.rb:38:in `unknown_tag'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block.rb:68:in `block in parse_body'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block_body.rb:32:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block.rb:58:in `parse_body'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/tags/if.rb:30:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/tag.rb:10:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/block_body.rb:34:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/document.rb:10:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/document.rb:5:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/template.rb:130:in `parse'
	from /usr/local/bundle/gems/liquid-4.0.4/lib/liquid/template.rb:[11](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:12)4:in `parse'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/liquid_renderer/file.rb:13:in `block in parse'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/liquid_renderer/file.rb:[12](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:13):in `parse'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:121:in `render_liquid'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:195:in `render_layout'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:158:in `place_in_layouts'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:88:in `render_document'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:62:in `run'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:479:in `render_regenerated'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:464:in `block (2 levels) in render_docs'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:463:in `each'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:463:in `block in render_docs'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:462:in `each_value'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:462:in `render_docs'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:191:in `render'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:71:in `process'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/command.rb:28:in `process_site'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:65:in `build'
	from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:36:in `process'
	from /usr/local/bundle/gems/github-pages-228/bin/github-pages:70:in `block (3 levels) in <top (required)>'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	from /usr/local/bundle/gems/github-pages-228/bin/github-pages:6:in `<top (required)>'
	from /usr/local/bundle/bin/github-pages:23:in `load'
	from /usr/local/bundle/bin/github-pages:23:in `<main>'
         Requiring: jekyll-seo-tag
         Requiring: jekyll-feed
         Requiring: jekyll-sitemap
         Requiring: jemoji
         Requiring: jekyll-coffeescript
         Requiring: jekyll-commonmark-ghpages
         Requiring: jekyll-gist
         Requiring: jekyll-github-metadata
         Requiring: jekyll-paginate
         Requiring: jekyll-relative-links
         Requiring: jekyll-optional-front-matter
         Requiring: jekyll-readme-index
         Requiring: jekyll-default-layout
         Requiring: jekyll-titles-from-headings
   GitHub Metadata: Initializing...
            Source: /github/workspace/.
       Destination: /github/workspace/./_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       EntryFilter: excluded /bin
       EntryFilter: excluded /Gemfile
           Reading: _posts/2022-12-10-giscus-comments.md
           Reading: _posts/2023-04-24-videos.md
           Reading: _posts/2015-07-15-code.md
           Reading: _posts/2023-04-25-audios.md
           Reading: _posts/2015-03-15-formatting-and-links.md
           Reading: _posts/2021-07-04-diagrams.md
           Reading: _posts/2023-03-21-tables.md
           Reading: _posts/2020-09-28-twitter.md
           Reading: _posts/2015-05-15-images.md
           Reading: _posts/2022-02-01-redirect.md
           Reading: _posts/2018-12-22-distill.md
           Reading: _posts/2023-04-25-sidebar-table-of-contents.md
           Reading: _posts/2023-05-12-custom-blockquotes.md
           Reading: _posts/2015-10-20-disqus-comments.md
           Reading: _posts/2015-10-20-math.md
           Reading: _posts/2020-09-28-github-metadata.md
           Reading: _posts/2023-03-20-table-of-contents.md
           Reading: _news/announcement_1.md
           Reading: _news/announcement_3.md
           Reading: _news/announcement_2.md
           Reading: _projects/2_project.md
           Reading: _projects/4_project.md
           Reading: _projects/1_project.md
           Reading: _projects/3_project.md
           Reading: _projects/6_project.md
           Reading: _projects/5_project.md
        Generating: JekyllOptionalFrontMatter::Generator finished in 0.000254303 seconds.
        Generating: JekyllReadmeIndex::Generator finished in 0.0014189[13](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:14) seconds.
       Jekyll Feed: Generating feed for posts
        Generating: JekyllFeed::Generator finished in 0.000706406 seconds.
        Generating: Jekyll::JekyllSitemap finished in 0.00101051 seconds.
        Generating: Jekyll::Paginate::Pagination finished in 6.2e-06 seconds.
        Generating: JekyllRelativeLinks::Generator finished in 0.000563406 seconds.
        Generating: JekyllDefaultLayout::Generator finished in 0.000363103 seconds.
        Generating: JekyllTitlesFromHeadings::Generator finished in 2.3101e-05 seconds.
         Rendering: _posts/20[15](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:16)-03-15-formatting-and-links.md
  Pre-Render Hooks: _posts/[20](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:21)15-03-15-formatting-and-links.md
  Rendering Markup: _posts/2015-03-15-formatting-and-links.md
         Requiring: kramdown-parser-gfm
  Rendering Layout: _posts/2015-03-15-formatting-and-links.md
     Layout source: site
github-pages [22](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:23)8 | Error:  Liquid syntax error (line [42](https://github.com/DriesSmit/DriesSmit.github.io/actions/runs/5031144714/jobs/9024025334#step:4:43)): Unknown tag 'toc'

I tried the other solutions where I first set the branch in Pages to None. However it still fails to build. What is the recommended thnk to do here? Thank you for your time.

To Reproduce
I forked the repo and I am using an Ubuntu machine.

@DriesSmit DriesSmit added the bug label May 20, 2023
@kshiteesh
Copy link

I have the same issue

@george-gca
Copy link
Collaborator

Does it work when you try it locally?

@dtrocellier
Copy link

I have also the same issue

@KhalidAlnujaidi
Copy link

Solution:

Setting of you the repository -> pages -> deploy from: select gh-pages branch , not the master brach.

This solution taken from someone from closed threads and it worked for me :)

@george-gca
Copy link
Collaborator

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

@george-gca
Copy link
Collaborator

@DriesSmit is it working now?

@awsaf49
Copy link

awsaf49 commented Jul 3, 2023

I faced the same issue and resolved using gh-pages

@ClonedOne
Copy link

I am adding a comment here because, despite being linked in the README, this is not a complete solution. I am facing the same issue. The deploy process is failing during the build phase. the gh-pages branch is not generated. Therefore there is no way to select it as the branch from which to deploy.

@george-gca
Copy link
Collaborator

@ClonedOne trying to use as-is from the repo, changing only the name of the url in _config.yml, it doesn't work for you?

@Chiil
Copy link

Chiil commented Dec 12, 2023

I have the same problem. It fails in the build and hence does not create the gh-pages. Changing the url does not help. Can this bug be reopened @george-gca ?

@george-gca
Copy link
Collaborator

@Chiil have you tried a fresh start? Because if it fails from the very beginning it is an issue in the template itself, but if it was working before then it stopped, then the bug was introduced later, and it would be easier to debug. I always recommend from the beginning trying to deploy it as is, then adding some changes.

@Chiil
Copy link

Chiil commented Dec 14, 2023

Yes, I did, I forked the repository, pushed only one commit that changes the url and that is it. My repo is at https://github.com/Chiil/chiil.github.io

@george-gca
Copy link
Collaborator

Ok I just tried a fresh install with another user, and everything worked just fine. Here is the step-by-step I did (will update the README file soon):

1 - Start by clicking in

Use this template -> Create a new repository

Created a public repo with name <your-github-username>.github.io

2 - Go to

Settings -> Actions -> General -> Workflow permissions

and give Read and write permissions to GitHub Actions

3 - In _config.yml, set url to https://<your-github-username>.github.io and leave baseurl empty.

4 - Finally, go to

Settings -> Pages -> Build and deployment

make sure that Source is Deploy from a branch and set the branch to gh-pages (NOT to master)

5 - Wait until the GitHub actions finish, then simply navigate to https://<your-github-username>.github.io in your browser

@george-gca
Copy link
Collaborator

Just realized that your username has capital letters. I hope that I'm wrong in this, but maybe this might be affecting it.

@Chiil
Copy link

Chiil commented Dec 14, 2023

It works now! I have noticed that the essential difference is whether to do "Use this template" vs doing "Fork". What is different that if I fork, the Github Actions is already set (correctly though), whereas when I use "Use this template" I can set it to read and write and things go OK. I am not sure whether I understand the difference. The capital letter made no difference.

@ClonedOne
Copy link

Sorry, have been out for a while and didn't check this. I ended up solving the issue by changing the "Build and deployment" setting to "Github Actions" and then accepting the default Jekyll configuration proposed by Github by clicking on the button below.

@mainulhossain123
Copy link

Hello, I deployed the code with gh-pages but am facing the same issue still.

@danbischof
Copy link

Same.

@george-gca
Copy link
Collaborator

We need more information @danbischof. Is it a fresh install? Created from template or a fork?

@MPenaR
Copy link

MPenaR commented Jan 19, 2024

Fresh install and I face the same issue.

Actually the error in build is thrown as soon as point 2.

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

Failing in the initial commit.

@max870701
Copy link

max870701 commented Feb 19, 2024

Ok I just tried a fresh install with another user, and everything worked just fine. Here is the step-by-step I did (will update the README file soon):

1 - Start by clicking in

Use this template -> Create a new repository

Created a public repo with name <your-github-username>.github.io

2 - Go to

Settings -> Actions -> General -> Workflow permissions

and give Read and write permissions to GitHub Actions

3 - In _config.yml, set url to https://<your-github-username>.github.io and leave baseurl empty.

4 - Finally, go to

Settings -> Pages -> Build and deployment

make sure that Source is Deploy from a branch and set the branch to gh-pages (NOT to master)

5 - Wait until the GitHub actions finish, then simply navigate to https://<your-github-username>.github.io in your browser

Note:
In step 1, select the option Include all branches.
Proceed to step 2.
Complete step 4 first.
Follow step 3 and then commit the updated master branch to your repository.
Click on the Actions section in your Github repository and wait for the process to complete.
Go to https://<your-github-username>.github.io.

@george-gca
Copy link
Collaborator

Note:
In step 1, select the option Include all branches.

This is not needed since it will copy a lot of branches that you'll probably never use, and only pollute your repository with unnecessary code.

@marsggbo
Copy link

Here is my solution:

  1. use this template to create a new repo, instead of fork!!! instead of fork!!!
  2. In this new repository, go to Settings -> Actions -> General -> Workflow permissions and give Read and write permissions to GitHub Actions.
  3. Open file _config.yml, set url to https://.github.io and leave baseurl empty (do NOT delete it).
  4. You may probably find that gh-pages is not created. You can go to Settings -> Pages -> Build and deployment, choose 'Github Action`
    image
  5. Wait step 4 finishes, you will find gh-pages branch is created. Then, you website is deployed after the Action finishes.

@edx-h
Copy link

edx-h commented May 8, 2024

Ok I just tried a fresh install with another user, and everything worked just fine. Here is the step-by-step I did (will update the README file soon):
1 - Start by clicking in

Use this template -> Create a new repository

Created a public repo with name <your-github-username>.github.io
2 - Go to

Settings -> Actions -> General -> Workflow permissions

and give Read and write permissions to GitHub Actions
3 - In _config.yml, set url to https://<your-github-username>.github.io and leave baseurl empty.
4 - Finally, go to

Settings -> Pages -> Build and deployment

make sure that Source is Deploy from a branch and set the branch to gh-pages (NOT to master)
5 - Wait until the GitHub actions finish, then simply navigate to https://<your-github-username>.github.io in your browser

Note: In step 1, select the option Include all branches. Proceed to step 2. Complete step 4 first. Follow step 3 and then commit the updated master branch to your repository. Click on the Actions section in your Github repository and wait for the process to complete. Go to https://<your-github-username>.github.io.

This works for me. Thanks very much. @max870701

@lingium
Copy link

lingium commented Aug 22, 2024

This works for me. Thanks @marsggbo

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