jpanther / congo

A powerful, lightweight theme for Hugo built with Tailwind CSS.
https://jpanther.github.io/congo/
MIT License
1.19k stars 313 forks source link

Images are not showing up at all while following congo @ 5c8ab32 #912

Closed Yawar5 closed 1 month ago

Yawar5 commented 1 month ago

Language

English

What's the issue?

Images are not showing up at all while following congo theme @ 5c8ab32. I have tried to move pictures also to static folder and it didn't work. Currently all images are in assets/img folder and I call them as follows in the code: pic

Theme version

congo @ 5c8ab32

Hugo version

stable 5c8ab32b

Relevant Hugo log output

2024-07-14 11:35:09.552 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/origin/main refs/remotes/origin/main [92ms]
MikiVanousek commented 1 month ago

The relevant error thrown when building is:

Error: error building site: render: failed to render pages: render of "section" failed: "/home/runner/work/website/website/themes/congo/layouts/_default/list.html:24:9": execute of template failed: template: _default/list.html:24:9: executing "main" at <.Content>: error calling Content: "/home/runner/work/website/website/content/posts/fifth-post/_index.md:1:1": "/home/runner/work/website/website/themes/congo/layouts/_default/_markup/render-image.html:25:7": execute of template failed: template: _default/_markup/render-image.html:25:7: executing "_default/_markup/render-image.html" at <partial "picture.html" (dict "img" . "alt" $altText "class" $class "x2" $x2 "lazy" $lazy "webp" $webp)>: error calling partial: "/home/runner/work/website/website/themes/congo/layouts/partials/picture.html:63:26": execute of template failed: template: partials/picture.html:63:26: executing "partials/picture.html" at <.Resize>: error calling Resize: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information

As explained in the link, you need to use the extended version of Hugo. On your computer, make sure to install the extended version, as explained in the hugo docs. For the GitHub build pipeline, add extended: true right after hugo-version: "latest", so the whole .github/workflows becomes

# .github/workflows/gh-pages.yml

name: GitHub Pages

on:
  push:
    branches:
      - main

jobs:
  build-deploy:
    runs-on: ubuntu-20.04
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          submodules: true
          fetch-depth: 0

      - 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
        if: ${{ github.ref == 'refs/heads/main' }}
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_branch: gh-pages
          publish_dir: ./public