klakegg / docker-hugo

Truly minimal Docker images for Hugo open-source static site generator.
https://hub.docker.com/r/klakegg/hugo/
MIT License
391 stars 71 forks source link

Docker fails on building a hugo theme "academic" #25

Closed sharif1093 closed 4 years ago

sharif1093 commented 4 years ago

Bug description

This error relates to a hugo theme, but since I get the error only in docker I am asking here.

When I run hugo on the template website of hugo/academic I get the following error:

Building sites … ERROR 2020/05/26 16:39:01 render of "page" failed: "/app/site/themes/academic/layouts/publication/single.html:14:10": execute of template failed: template: publication/single.html:14:10: executing "main" at <(.Params.publication_types) and (ne (index .Params.publication_types 0) "0")>: can't give argument to non-function .Params.publication_types

There are no errors outside of docker.

Steps to reproduce

Create a Dockerfile with the following content:

FROM klakegg/hugo:ext-ubuntu

RUN apt-get update && apt-get install -y bash git

# Setup Hugo envrionment
WORKDIR /app
RUN mkdir -p /app/site \
    && git clone https://github.com/sourcethemes/academic-kickstart.git /app/site \
    && cd site \
    && git submodule update --init --recursive \
    && cp -av /app/site/themes/academic/exampleSite/* /app/site

WORKDIR /app/site

Build the docker image with docker build -t test/hugo .

Run the docker image with docker run --rm test/hugo

Versions

hugo 0.71.1

sharif1093 commented 4 years ago

Never mind, the issue seems to be related to hugo version as stated in hugo-academic/1718 not docker.