From 6f62c4dff521902338e82f8099c136e658ccb8e6 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 11 Nov 2019 10:49:11 -0500 Subject: [PATCH] try to speed up builds --- README.md | 2 +- layouts/_default/video.html | 2 +- netlify.toml | 6 +++--- scripts/docker-build.sh | 2 +- scripts/docker-server.sh | 2 +- scripts/{netlify.sh => netlify-build.sh} | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) rename scripts/{netlify.sh => netlify-build.sh} (93%) diff --git a/README.md b/README.md index 0ca34dae..2cd3d622 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ I keep an ongoing list of [blog post ideas](https://github.com/jakejarvis/jarv.i This site runs a [custom version](https://github.com/jakejarvis/hugo-custom) of [Hugo Extended](https://github.com/gohugoio/hugo) with a few (very opinionated) changes. To ensure consistency, the [`Dockerfile`](Dockerfile) in this repository will pull my Hugo [fork](https://github.com/jakejarvis/hugo-custom) (forked from `v0.53-DEV`, [gohugo/hugo@`a28865c`](https://github.com/gohugoio/hugo/tree/a28865cfc3e296cf0ddd0bd6c1368fcdb2154d0f) and pre-built on [Docker Hub](https://hub.docker.com/r/jakejarvis/hugo-custom) and [GitHub Package Registry](https://github.com/jakejarvis/hugo-custom/packages)) and run a live testing server. -Run these commands on the root of this repository: +Run [`./scripts/docker-server.sh`](scripts/docker-server.sh) from the root of this repository, or execute these Docker commands: ```bash docker build -t jarv.is:develop -f Dockerfile . diff --git a/layouts/_default/video.html b/layouts/_default/video.html index 870d8e8c..eee69967 100644 --- a/layouts/_default/video.html +++ b/layouts/_default/video.html @@ -18,4 +18,4 @@ {{ .Content }} -{{ partial "footer.html" . }} +{{ partial "footer.html" . }} \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index cbd83d3c..0cd44b45 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,6 +1,6 @@ # netlify.sh downloads my custom Hugo fork and builds the site independently. [build] - command = "./scripts/netlify.sh" + command = "./scripts/netlify-build.sh" publish = "public" @@ -18,11 +18,11 @@ [[redirects]] from = "/feed" to = "/index.xml" - status = 200 + status = 301 [[redirects]] from = "/rss" to = "/index.xml" - status = 200 + status = 301 # Moved Y2K site to its own subdomain: [[redirects]] diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh index 72f641b6..15056283 100755 --- a/scripts/docker-build.sh +++ b/scripts/docker-build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Make sure you run this script from the root of the site repository... +# Make sure you run this script from the root of the site repository. echo "Pull latest Docker image..." docker pull jakejarvis/hugo-custom:latest diff --git a/scripts/docker-server.sh b/scripts/docker-server.sh index a2915941..885962db 100755 --- a/scripts/docker-server.sh +++ b/scripts/docker-server.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Make sure you run this script from the root of the site repository... +# Make sure you run this script from the root of the site repository. echo "Pull latest base image..." docker pull jakejarvis/hugo-custom:latest diff --git a/scripts/netlify.sh b/scripts/netlify-build.sh similarity index 93% rename from scripts/netlify.sh rename to scripts/netlify-build.sh index 93b77e17..8200bc03 100755 --- a/scripts/netlify.sh +++ b/scripts/netlify-build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# only designed to run on Netlify's build image: +# only designed to run on Netlify's build image # https://github.com/netlify/build-image set -euo pipefail @@ -30,7 +30,7 @@ curl -sS -L https://github.com/imagemin/optipng-bin/raw/master/vendor/linux/x64/ chmod +x $BINDIR/optipng # make sure everything's OK -echo "Is Hugo ready..?" +echo "Is Hugo ready?" $BINDIR/hugo-extended version # build Hugo site @@ -42,7 +42,7 @@ echo "Optimizing JPEGs..." find ./public -iname "*.jp*" -print0 | xargs -0 $BINDIR/jpegoptim --max=80 --strip-all --quiet echo "Optimizing PNGs..." find ./public -iname "*.png" -print0 | xargs -0 $BINDIR/pngquant --quality=50-70 --speed 3 --ext=.png --force -find ./public -iname "*.png" -print0 | xargs -0 $BINDIR/optipng -o3 -force -strip all -quiet -- +find ./public -iname "*.png" -print0 | xargs -0 $BINDIR/optipng -o1 -force -strip all -quiet -- # remove binaries (kinda unsafe, but doesn't really matter b/c it's docker) echo "Cleaning up binaries..."