@@ 30,17 30,15 @@ Keeping that in mind, let's get into setting up our static site!
1. Create a new account on [sourcehut](https://sourcehut.org) (or log in to an existing one)
2. Setup your billing to contribute monthly (tier amount is up to you)
-3. Create a new repo under the **git** section
- - **Important**: Name this repo : `yourusername.srht.site`
-4. Be sure to create a [personal access token](https://meta.sr.ht/oauth2/personal-token) (and keep this somewhere secure / safe)
-5. Connect this repo locally (as you would via any other git host)
-6. In this new local directory, place all your Jekyll files as you would with any other static hosting provider
+3. Create a new repo under the **git** section[^1]
+4. Connect this repo locally (as you would via any other git host)
+5. In this new local directory, place all your Jekyll files as you would with any other static hosting provider
## The sourcehut build file
In order to have your Jekyll site build and push the correct files live, you will need to use sourcehut's build system. This will run every time you push out a new change to your repo (new blog post, page content changes, styling updates).
-To make things easier, you can copy the build file below (remember to use your *own* information for usernames, etc):
+To make things easier, you can copy the build file below (remember to use your *own* information for usernames, git repo naming etc):
```
image: debian/stable
@@ 51,16 49,16 @@ packages:
environment:
site: yourusername.srht.site
sources:
- - https://git.sr.ht/~yourusername/yourusername.srht.site
+ - https://git.sr.ht/~yourusername/your-repo-name
tasks:
- install-bundler: |
sudo gem install bundler
- build: |
- cd yourusername.srht.site
+ cd your-repo-name
bundle install
bundle exec jekyll build
- package: |
- cd yourusername.srht.site/_site
+ cd your-repo-name/_site
tar -cvz . > ../../site.tar.gz
- upload: |
acurl -f https://pages.sr.ht/publish/$site -Fcontent=@site.tar.gz
@@ 93,4 91,10 @@ And that's it - custom domain set! If you run into any issues check out the [off
Hopefully this helps to streamline the process for others to host their static sites through sourcehut. Having open and healthy competition among host providers and `git` workflows is essential to avoiding vendor lock-in.
-Even low-effort support for open-source products (like where you host your static site or FOSS projects) can go a long way. Just some food for thought.>
\ No newline at end of file
+Even low-effort support for open-source products (like where you host your static site or FOSS projects) can go a long way. Just some food for thought.
+
+---
+
+## Footnotes
+
+[^1]: Thanks to [McSinyx](https://fosstodon.org/web/@cnx@nixnet.social) for pointing out that the repo used for creating your website can be named anything (instead of defaulting to your sourcehut username)<
\ No newline at end of file