Hugo (build) does not work

Hi all,

i’m quite new to hugo so I hope to describe my error as good as i can.
I’ve a site with the hugo-theme-codex imported with git submodule. hugo server -D renders the page like it should. When I’m building the page with hugo shows only the raw html and the links are not navigable.

My Setup:

  • Arch Linux - Kernel 5.12.6-arch1-1
  • hugo version v0.83.1-5AFE0A57+extended linux/amd64 BuildDate=2021-05-02T14:38:05Z VendorInfo=gohugoio
  • hugo-extended
  • go version go1.16.4 linux/amd64

My Repo:

Thanks for your help!
Cheers

I suspect that you trying to open the files with a web browser instead of serving them with a web server (Apache, NGINX, etc).

No, i try to Build a Docker-Image with copying the builded files from public/* to the nginx serving path /usr/share/nginx/html
This is my Dockerfile:

FROM ubuntu as build

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

    
ARG HUGO_VERSION="0.83.1"

RUN wget --quiet "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" && \
    tar xzf hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz && \
    rm -r hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz && \
    mv hugo /usr/bin

COPY ./ /site
WORKDIR /site
RUN git submodule update --init --recursive --remote
RUN hugo

#Copy static files to Nginx
FROM nginx:alpine
COPY --from=build /site/public /usr/share/nginx/html

WORKDIR /usr/share/nginx/html

What URL do you visit to see your published site?

When i run the docker run -p 9000:80 imagename then on localhost:9000. Right now the site is published under https://fr.r4o.ch

When I visit https://fr.r4o.ch/ this is what I see in the browser console:

Indeed this is causing the site not to work. Did totally miss this! Thank you to hinting me to the right direction. Now i have to check what’s wrong with my deployment pipeline.
By chance do you know drone.io?

kind: pipeline
type: docker
name: build

steps:
- name: build_container
  image: plugins/docker
  settings:
    username:
      from_secret: REGISTRY_USER
    password:
      from_secret: REGISTRY_PASSWORD
    storage_driver: vfs
    registry: docker.r4o.ch
    repo: docker.r4o.ch/fr/fr
    auto_tag: true

image_pull_secrets:
- dockerconfig

would help me a thon, if not i’m happy with your precious help @jmooring ! Thank you so much!

Sorry, no.

Finde out, that on my server i was trying over and over publishing with an old image…
checking with docker images would have me saved a lot of time and yours as well.
Thank you for your help, very apreciated!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.