~adnano/adnano.co

ref: 4783f9fe192c637cdec61d4a06cf69ec7343ad11 adnano.co/content/2021-02-21-kiln-sourcehut-pages.gmi -rw-r--r-- 1.3 KiB
4783f9feAdnan Maolood Fix content titles 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: Publish your Kiln site on Sourcehut pages
---

Sourcehut recently announced free static hosting for Gemini and the web via Sourcehut pages.

=> https://sourcehut.org/blog/2021-02-18-sourcehut-pages/ Sourcehut pages announcement

To publish your Kiln site to Sourcehut pages automatically, you'll need to add the following build manifest in the file ".build.yml" in the root of your site repository:

```
image: alpine/edge
oauth: pages.sr.ht/PAGES:RW
packages:
  - kiln
environment:
  site: example.com
sources:
  - https://git.sr.ht/~$username/$site
tasks:
  - build: |
      cd $site
      kiln --html
  - package: |
      cd $site
      tar -C dst -cvz . > ../site.tar.gz
      tar -C html -cvz . > ../html.tar.gz
  - upload: |
      acurl -f https://pages.sr.ht/publish/$site \
        -Fcontent=@site.tar.gz \
        -Fprotocol=GEMINI
      acurl -f https://pages.sr.ht/publish/$site \
        -Fcontent=@html.tar.gz \
        -Fprotocol=HTTPS
```

This build manifest builds Gemini and HTML versions of your site and uploads both to Sourcehut pages. It will run automatically whenever you push a commit to your site repository, assuming that it is hosted on Sourcehut. Be sure to point your domain name towards Sourcehut pages' servers.

=> https://srht.site Sourcehut pages documentation