Skip to content

Commit

Permalink
Use hugo 0.110.0. (#46)
Browse files Browse the repository at this point in the history
* Use hugo 0.110.0.

Nothing much included in recent versions, mostly bug-fixes and build/CI improvements. The binary name has changed so thats updated in our Dockerfile.

* Fix watch script.

This repo doesnt use a src/ directory, everything is just in the repo root.

* Hard-code MIME type for RSS feed.
  • Loading branch information
jholdstock authored Mar 23, 2023
1 parent a031a5c commit 26ff895
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Build
run: docker build -t decred/dcrblog:$(date +%s) .
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# builder image
FROM alpine:latest

ENV HUGO_VERSION 0.94.2
ENV HUGO_VERSION 0.110.0

LABEL description="gohugo build"
LABEL version="1.0"
Expand All @@ -11,8 +11,8 @@ WORKDIR /tmp

RUN apk update && apk upgrade
RUN apk add --no-cache bash wget libc6-compat g++
RUN wget -q https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
RUN tar xz -C /usr/local/bin -f hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
RUN wget -q https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_linux-amd64.tar.gz
RUN tar xz -C /usr/local/bin -f hugo_extended_"$HUGO_VERSION"_linux-amd64.tar.gz

WORKDIR /root

Expand All @@ -25,7 +25,7 @@ RUN rm -rf public resources
RUN hugo --buildFuture

# Serve image (stable nginx version)
FROM nginx:1.20
FROM nginx:1.22

LABEL description="dcrblog server"
LABEL version="1.0"
Expand Down
6 changes: 3 additions & 3 deletions bin/watch.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash

set -e

# Remove old hugo output before building
rm -rf src/public src/resources
rm -rf public resources

# Serve site
# --buildFuture include content with publishdate in the future
# --buildDrafts include content marked as draft
# --disableFastRender enables full re-renders on changes
# --source filesystem path to read files relative from
# --baseURL hostname (and path) to the root
hugo server \
--buildFuture \
--buildDrafts \
--disableFastRender \
--source src \
--baseURL http://localhost:1313
7 changes: 6 additions & 1 deletion conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ server {
location / {
root /usr/share/nginx/html;
index index.html index.htm;

# Hard-code MIME type for RSS feed.
location = /index.xml {
types { } default_type application/rss+xml;
}
}

#error_page 404 /404.html;
Expand All @@ -48,5 +53,5 @@ server {
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/rss+xml text/javascript;
}

0 comments on commit 26ff895

Please sign in to comment.