garage-unix-socket/doc/book/connect/websites.md

2.7 KiB

+++ title = "Websites (Hugo, Jekyll, Publii...)" weight = 10 +++

Garage is also suitable to host static websites. While they can be deployed with traditional CLI tools, some static website generators have integrated options to ease your workflow.

Name Status Note
Hugo Publishing logic is integrated in the tool
Publii Require a correctly configured s3 vhost endpoint
Generic Static Site Generator Works for Jekyll, Zola, Gatsby, Pelican, etc.

Hugo

Add to your config.toml the following section:

[[deployment.targets]]
 URL = "s3://<bucket>?endpoint=<endpoint>&disableSSL=<bool>&s3ForcePathStyle=true&region=garage"

For example:

[[deployment.targets]]
 URL = "s3://my-blog?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true&region=garage"

Then inform hugo of your credentials:

export AWS_ACCESS_KEY_ID=GKxxx
export AWS_SECRET_ACCESS_KEY=xxx

And finally build and deploy your website:

hugo
hugo deploy

External links:

Publii

A screenshot of Publii's GUI

Deploying a website to Garage from Publii is natively supported. First, make sure that your Garage administrator allowed and configured Garage to support vhost access style. We also suppose that your bucket ("my-bucket") and key is already created and configured.

Then, from the left menu, click on server. Choose "S3" as the protocol. In the configuration window, enter:

Now, each time you want to publish your website from Publii, just hit the bottom left button "Sync your website"!

Generic Static Site Generator

Some tools do not support sending to a S3 backend but output a compiled folder on your system. We can then use any CLI tool to upload this content to our S3 target.

First, start by configuring minio client.

Then build your website (example for jekyll):

jekyll build

And copy its output folder (_site for Jekyll) on S3:

mc mirror --overwrite _site garage/my-site