static website

Configuration and scripts to manage my personal static website, bfallik.net.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You'll need Hugo and git.

$ dnf install hugo git

Don't forget to update the submodules:

$ git submodule init
$ git submodule update --recursive --remote

Testing

You can use hugo server to preview your changes on a local server before deploying them publicly.

$ hugo server

                   | EN
+------------------+----+
  Pages            |  6
  Paginator pages  |  0
  Non-page files   |  0
  Static files     | 39
  Processed images |  0
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Total in 29 ms
Watching for changes in /home/bfallik/sandbox/bfallik.net/public-www/www.bfallik.net/{content,themes}
Watching for config changes in /home/bfallik/sandbox/bfallik.net/public-www/www.bfallik.net/config.toml, /home/bfallik/sandbox/bfallik.net/public-www/www.bfallik.net/themes/vncnt-hugo/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Deployment

The website is hosted on Github Pages in the repo https://github.com/bfallik/bfallik.github.io. Pushing changes to the master branch will trigger GitHub Actions to build and deploy the site.

To generate new static HTML site manually, first generate the static files on the gh-pages branch:

$ rm -rf public; \
  git clone -b gh-pages git@github.com:bfallik/bfallik.github.io public; \
  hugo --minify --cleanDestinationDir

Cloning into 'public'...
remote: Enumerating objects: 311, done.
remote: Counting objects: 100% (241/241), done.
remote: Compressing objects: 100% (120/120), done.
remote: Total 311 (delta 107), reused 227 (delta 94), pack-reused 70
Receiving objects: 100% (311/311), 2.36 MiB | 14.39 MiB/s, done.
Resolving deltas: 100% (116/116), done.
Start building sites …
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown

                   | EN
-------------------+-----
  Pages            | 12
  Paginator pages  |  0
  Non-page files   |  0
  Static files     |  5
  Processed images |  0
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Total in 125 ms

$ cd public

$ echo www.bfallik.net >CNAME

To deploy, push the latest artifacts to the gh-pages branch. (This assumes you're still inside public/)

$ git add -A && git commit -m "generated by Hugo"
$ git push

You can verify the changes appear on https://bfallik.net.

DNS for bfallik.net is served by domains.google.com. Specifically

  1. a Synthetic Record for subdomain forwarding, temporarily redirecting (301) bfallik.net to www.bfallik.net
  2. a www CNAME record pointing at bfallik.github.io