metablog 1 - Codeberg, ereaders, and Syncthing

· 5 min read
contents

don't let Android get locked down. otherwise it makes it harder to do neat stuff like this.

Hugo and hosting

setting up a website can't be hard, right?

in retrospec, this Hugo project (this blog) isn't that hard to set up. Hugo documentation is a little overwhelming imo, so I tried to find a theme (see the site footer) and only minimally mess with it. for a registrar, I went with Porkbun, since they've been lovely and refreshingly straightforward.

hosting was the most challenging part, and even that wasn't challenging - it was mostly just sussing out where to host. I wanted something simple to maintain, maybe free, and not based in the US (i.e. subject to US data laws). previously I'd used Vercel, but it was a little bit of a hassle.

so I wound up on Codeberg, which I knew of but never used, because I'd learned they have their own version of Github Pages, Codeberg Pages. after uploading my Hugo project to a new repo there and setting appropriate DNS records with the registrar, it took a bit to divine some specifics for Hugo, but through a combination of the docs and various forums, I eventually worked out the following .yaml and stuffed it inside .forgejo/workflows within my Hugo project. now an automatic Forgejo Action builds and redeploys my site upon each new commit:

name: hugo
on:
  push:
    branches:
      - main
  workflow_dispatch: # lets you run the workflow manually, needs to be within "on:"
  
jobs:
  publish:
    runs-on: codeberg-tiny
    steps:
      - name: checkout # naming steps is nice - it helps identify what part of the workflow is running
        uses: actions/checkout@v7
        with:
      # for Hugo this checks out any theme submodules you have
          submodules: true
          fetch-depth: 0
      - name: install hugo
      # update the run below for new hugo releases
        run: |
          wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.164.0/hugo_extended_0.164.0_linux-amd64.deb
          dpkg -i hugo.deb
      - name: build
        run: hugo --minify --baseURL "https://coincidentallycurious.com/" # your URL goes here!
      - name: deploy to codeberg pages
        uses: https://codeberg.org/git-pages/action@v2
        with:
          # again, your URL goes here:
          site: https://coincidentallycurious.com/
          # if you don't have your own domain, comment out the above, and for default codeberg.page subdomain use:
          # site: 'https://${{ forge.repository_owner }}.codeberg.page/${{ forge.repository_name }}/'
          server: codeberg.page
          token: ${{ forgejo.token }}
          source: public/ # for Hugo - it builds the .html and places it in the public folder, so reference that here

this works even if the repo is set to private! so that's nifty. it may only work up to 100MB though (but this site isn't huge - yet).

at the end of the day, I had a nice little static web blog running on a custom domain for only about ~$10!

Emacs + the dirvish package is also very nice for this workflow. it's very straightfoward to jump around directories and edit. I usually run this on my MacBook, and when I have an update to the site I do the typical git add . git commit -m "yay new commit" git push, which I also run in Emacs with eshell.

e-ink to the rescue

but I'm on a mission to reduce screen time with e-ink… er, screens. yes, that's technically not less "screen time", but e-ink screens don't need backlights to work, which is important for me because I suck at sleep, I like working on devices, I often do it in the evening, and screen blue light definitely impacts sleep. a non-backlit ereader with a small amber led light solves this problem for me - it's physiologically the same as reading a book with a reading light, so I think it's fair to say it's not "screen time".

the particular ereader I have, the Supernote Nomad, allows installing 3rd-party apps with a little finagling, which allows me to do things like cross-platform peer-to-peer file syncing with Syncthing. there was some drama with the development and stewardship of syncthing-android, which I used to use, so I found another app called BasicSync that is well-supported, avoids my trust issues, and utilizes the actual web GUI instead of the Android frontend, so it's a consistent setup experience across devices.

I now draft notes on the Nomad, and when I'm ready, I'll have it do this handy thing where it recognizes my handwriting and exports to a .txt. it's not so handy in the way that I can't customize the export folder for the .txt - it will only go to the Nomad's default EXPORT folder (yes, all caps), which is where other things get exported too! fortunately, it was easy to have Syncthing watch that folder but ignore everything except files with the words "blog" and ".txt". the ignore pattern in the configuration looks like this:

  !*blog*.txt
  **

first line says it's OK to include files with this pattern, second line excludes everything.

these files then get synced to my Mac for further editing before I finally push the changes to my Codeberg repo, thus triggering a rebuild of my site.

notably, .txt files don't get recognized as pages by Hugo in the /content/posts folder, so I can sync files from my Supernote directly to this folder without having to worry about drafts being accidentally published. it's sort of an alternative to specifying the draft status in the frontmatter.

I'll then edit the .txt with Emacs set to org-mode, then rename it to a .org file when it's finished and ready to publish.

"screen time"-free web blogging?

I have a couple other goodies running on the Supernote, namely the Termux terminal app and the Android build of Emacs, though it's noticeably slower to edit text with this than with the built-in text editor. perhaps a feasible workflow could involve editing these files with the built-in editor, then using Termux (or Emacs?) to push changes to the git repo? that would be a nifty, "screen free" way to maintain my blog.

that's all the ideas for now. cheers!

/ df