If your GitHub Pages code contains a Liquid logic tag that is not properly closed, your GitHub Pages site will not build.

If your GitHub Pages site fails to build because of an improperly closed Liquid logic tag, you'll get an email with this message:

Subject: Page build failed

The page build failed with the following error:

The tag `capture` in `index.html` was not properly closed with `{% endcapture %}`.

Troubleshooting improperly closed tag errors

Tip: We strongly recommend running Jekyll locally so you can easily debug and fix build errors before pushing to GitHub. To learn more about troubleshooting options, see "Troubleshooting GitHub Pages builds."

  • Check the Liquid tags in the file referenced in the build failure email. All logic tags (those that are wrapped in '{% %}') must have a matching closing tag.

Example

Here's an example of a correctly formatted set of tags:

{% capture example_variable %}

<p>I am an example being captured.</p>

{% endcapture %}

In this example, the opening {%capture%} tag is properly closed with an {% endcapture %} tag.

Once you've fixed any improperly closed tags, you will need to commit your changes and push to GitHub Pages repository again to trigger another build on the server.

Further reading