HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.2k stars 2.9k forks source link

render of "page" failed: execute of template failed: template: event/single.html:5:3: executing "event/single.html" at <partial "site_head" .>: error calling partial #2240

Closed muammar closed 3 years ago

muammar commented 3 years ago

Describe the bug

I tried deploying starter-academic on GitHub pages, and I get the following error:

ERROR 2021/03/27 14:30:36 failed to render pages: render of "page" failed: execute of template failed: template: event/single.html:5:3: executing "event/single.html" at <partial "site_head" .>: error calling partial: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/wowchemy/wowchemy-hugo-modules/wowchemy@v0.0.0-20210306214515-1475a49114f4/layouts/partials/site_head.html:176:56": execute of template failed: template: partials/site_head.html:176:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
Total in 2223 ms
Error: Process completed with exit code 255.

The full log can be seen here: https://github.com/muammar/muammar.github.io/runs/2208698809?check_suite_focus=true

To Reproduce

Steps to reproduce the behavior:

  1. Push changes to GitHub.
  2. Wait for the job.
  3. Error: Process completed with exit code 255

Expected behavior

The website should build correctly as it does on my Macbook Pro.

Technical details:

.github/workflows/gh-pages.yml content:

name: github pages

on:
  push:
    branches:
      - master  # Set a branch to deploy

jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true  # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          # extended: true

      - name: Build
        run: hugo --minify

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./public

Any way of overcoming this issue? Thanks.

muammar commented 3 years ago

Humm. I fixed this with extended: true. However, the job finished correctly https://github.com/muammar/muammar.github.io/runs/2208915081 but the website is showing a huge 404: https://muammar.me/.

I have set a CNAME: https://github.com/muammar/muammar.github.io/blob/master/static/CNAME

Edit:

I see there is some information shown here: https://muammar.github.io/ but those are not my changes. It is just showing the example.

chrede88 commented 3 years ago

Two things: 1) Have you pointed GitHub Pages to your gh-pages branch? Looks like it's pointed at your master branch. 2) Here is a link to Github's docs on using custom domains: https://docs.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site

Also, try to keep this space clear of issues that aren't related to actual code issues. If you need help with setting up your site or other such things, join the wowchemy discord server: https://discord.gg/SdpgG7zM

muammar commented 3 years ago

Sorry for the noise here. You were right:

1) I had to change from main to gh-pages. 2) Then, I modified my .github/workflows/gh-pages.yml to build in root instead of public, and everything worked.

name: github pages

on:
  push:
    branches:
      - master  # Set a branch to deploy

jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true  # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true

      - name: Build
        run: hugo --minify

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./root

Thanks @Chrede88