通过github动作使用液体模板语言来建立失败的高架部署

发布于 2025-02-04 21:17:29 字数 1615 浏览 5 评论 0原文

当尝试通过GitHub页面部署高度博客时,自动添加了单独的工作流,名为build and build and exployment

但是,由于我的博客使用液体模板语言和语法冲突,因此与jekyll 过程步骤一起构建构建。例如,root Directory中的文件about.html使用_includes \ about.liquid和构建过程发出以下错误:

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

build.yml 文件:

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 }}

此工作流程获得干净的通行证,但其另一个自动添加了引起麻烦的自动。

我遵循的资源使用github操作部署了11个站点,避免了页面构建和部署自动工作流,因为所有这些都已发布在 github 添加了新的工作流程。

我的问题是,我错过了什么吗?也许有任何新的插件可以使Jekyll兼容可以部署?我可以禁用工作流程,从而遵循传统代码进行部署吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海夜未眠 2025-02-11 21:17:29

由于您不使用jekyll来构建网站,因此可以通过添加一个空的.nojekyll file to to repository

在您的情况下,此文件将在main分支上,并应防止GitHub尝试使用Jekyll构建。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文