Search code examples
jekyllgithub-actionsgithub-pageseleventy

Eleventy/11ty deployment via github actions build failure using liquid template language


When trying to deploy an Eleventy blog via github pages, a seperate workflow is auto added named pages build and deployment.

However the issue arises with the build with jekyll process step, as my blog uses liquid templating language and syntaxes conflict. For example, a file about.html in the root directory uses _includes\about.liquid and the build process issues the following error:

Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences: "author.liquid" Valid syntax: {% include file.ext param='value' param2='value' %} in src/about.html

The build.yml file:

name: Build Eleventy

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-20.04

    strategy:
      matrix:
        node-version: [14.x]

    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Install dependencies & build
        run: |
          npm ci
          npm run build
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          publish_dir: ./_site
          github_token: ${{ secrets.GITHUB_TOKEN }}

This workflow gets a clean pass but its the other auto added one that's causing trouble.

The resources I've followed to deploy 11ty sites using Github Actions avoids the pages build and deployment auto workflow since all of them are posted before the new workflow was added by github.

My question is, am I missing anything? Any new plugins perhaps for Jekyll compatibility to deploy perhaps? Can I disable the workflow and thus follow the legacy codes to deploy?


Solution

  • Since you're not using Jekyll to build your site, you can disable building with Jekyll by adding an empty .nojekyll file to the root of your repository.

    In your case, this file would be on the main branch and should prevent GitHub from trying to build with Jekyll.