💾 Archived View for srht.site › quickstart.gmi captured on 2023-09-28 at 15:30:44. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

SourceHut pages quick start

The steps for publishing your capsule are:

Once you’re live, we’ll look at ways to automate the process.

Your personal access token

You can generate your personal access token via meta.sr.ht:

OAuth 2.0 personal access tokens

Write it down for later reference.

Building your tarball

Here's a simple example. Let's say you write this file to index.gmi:

# My sourcehut capsule

Welcome to my cool sourcehut capsule!

You can create a tarball for it like so:

$ tar -cvz index.gmi > site.tar.gz

Add any number of files other than index.gmi to expand this.

Using a static capsule generator

Here's another example of a capsule using gssg:

$ gssg
$ tar -C public -cvz . > site.tar.gz

gssg

You can use any tool, just so long as it outputs static content.

Uploading your tarball

Once you have a tarball, upload it to pages.sr.ht:

$ curl --oauth2-bearer "access token" \
    -Fcontent=@site.tar.gz \
    -Fprotocol=GEMINI \
    https://pages.sr.ht/publish/username.srht.site

Substitute “access token” with your personal access token, and username with your sr.ht username.

Want to use your own domain name? Review the extra steps here.

Once you run this command, your capsule should now be live at gemini://username.srht.site!

Next: Automating deployments

Automating deployments