Skip to content

Commit

Permalink
Add rewrites for .html; switch to caddy (#148)
Browse files Browse the repository at this point in the history
This might seem like a drastic change, but it's really not a big
deal, since we aren't using advanced configs anyways.

Caddy's configuration language is much saner for our use-case, and
it even opens the door to api-based config.
  • Loading branch information
dontlaugh committed Feb 27, 2023
1 parent a6fb419 commit a12436b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .buildkite/container.sh
@@ -1,7 +1,8 @@
#!/bin/sh

c=$(buildah from docker.io/nginx:1.23.3-alpine)
buildah add $c raku-doc-website.tar.gz /usr/share/nginx/html
c=$(buildah from docker.io/caddy:latest)
buildah add $c raku-doc-website.tar.gz /usr/share/caddy
buildah add $c Caddyfile /etc/caddy/Caddyfile
buildah commit --rm $c quay.io/colemanx/raku-doc-website:latest
buildah push quay.io/colemanx/raku-doc-website:latest

21 changes: 21 additions & 0 deletions Caddyfile
@@ -0,0 +1,21 @@
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.


:80 {
# Set this path to your site's directory.
@htmlext {
path_regexp static (/.*)\.(html?)$
}

root * /usr/share/caddy
try_files {path}.html {path}


# Enable the static file server.
file_server
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

0 comments on commit a12436b

Please sign in to comment.