{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiei6g7m7s7kp2ygs5oy45dwoisi54cejonu2z4dscen34b6rbwjjm",
    "uri": "at://did:plc:hrmcjdks6yqnd6blyz33hrp4/app.bsky.feed.post/3mh3i6iqsiud2"
  },
  "path": "/2026/03/moving-my-static-site-blog-generator-from-hugo-to-bssg/",
  "publishedAt": "2026-03-14T18:28:23.000Z",
  "site": "https://neilzone.co.uk",
  "tags": [
    "blog for my work site, decoded.legal",
    "to a static site generated by hugo",
    "Stefano Marinelli",
    "Bash Static Site Generator, also called \"BSSG\"",
    "Here is my configuration file",
    "Here is the resulting css",
    "Here is the header file",
    "My footer",
    "a small shell script on my laptop",
    "Here is that build script",
    "@neil"
  ],
  "textContent": "I enjoy blogging. I blog on my own personal site (this blog), and I also have a blog for my work site, decoded.legal.\n\nIn 2023, I moved my blog to a static site generated by hugo.\n\nI've been reasonably pleased with hugo, and it does the job, but I find it complex.\n\nIn short, if an update broke my site, I am not 100% convinced that I would be able to fix it.\n\nI don't need much in the way of complexity; I have a simple, predominantly text, blog, and all I want is to be able to write posts in markdown, generate a static html site from it, andrsync it to a webserver, along with an RSS feed.\n\nI am using a Raspberry Pi 4 as my webserver, and this works fine, given my lightweight, low complexity, sites.\n\n## Enter BSSG\n\nOn the fediverse, I saw Stefano Marinelli discussing his own static site generator - the Bash Static Site Generator, also called \"BSSG\" - and I was keen to give it a try.\n\nI guess that I am simply more confident that, if there was a problem, I'd be more confident about fixing something written in bash.\n\n## Installing BSSG\n\nI am running hugo (and now BSSG) on my Raspberry Pi 4 webserver. I could install it on something beefier, like my laptop, and then just rsync the output files to the webserver, but, again for simplicity, it makes sense to me to run the static site generator on the webserver itself.\n\nI don't have anything particular to note about the basic installation.\n\n## Configuring BSSG\n\nI wanted to make quite a few changes to the default configuration, so I decided that the simplest thing to do was to copy the whole config file from the BSSG installation directory into my site directory, and then amend it.\n\nHere is my configuration file.\n\n(I have a separate file, in the same directory, for my .onion site; this is much the same, but referencing the .onion URL instead, and with a separate output directory.)\n\n## Customising the theme\n\nI was happy with how my old blog looked, and, for the work blog, I wanted it to remain consistent with the main website.\n\nI started with the BSSG \"minimal\" theme, and then made the changes that I wanted to support \"dark mode\", remove transitions/transformations, and to generally get to the look that I wanted.\n\nHere is the resulting css.\n\n## Adding fediverse stuff to the header\n\nOnce can also have site-specific templates, so I copied the templates directory from the BSSG directory into my site directory, and made changes there.\n\nIn particular, in the header template, I:\n\n  * added an inline svg for the icon, in lieu of a favicon file\n  * added a link for fediverse verification (`<link rel=\"me\" href=\"https://mastodon.neilzone.co.uk/@neil\"/>`)\n  * added a link for \"fediverse:creator\", so that post previews in Mastodon link to my Mastodon account (`<meta name=\"fediverse:creator\" content=\"@neil@mastodon.neilzone.co.uk\" />`)\n  * adjusted some of the OpenGraph (fedi previews) stuff, to use a static image, since I do not use header images (or, really, any images at all)\n\n\n\nHere is the header file.\n\nIn the footer, I amended the copyright information, and, on the work blog, added a short disclaimer. (My footer.)\n\n## Migrating content from my hugo blog\n\nThere is a significant (but not total) overlap between the header material of blogposts for hugo and blogposts for BSSG.\n\nI'm not entirely sure that I needed to do anything at all, aside from copying the raw markdown files into BSSG's `src` directory, but I used a few regexes to align the header material anyway:\n\n\n    # Change the date format\n    sed -r -i 's/(^date: \".*)(T)(.*)(\\+)(.*)(:)(.*$)/\\1 \\3 +\\5\\7/g' *.md\n    # Change the date format in the \"publishdate\" field, and change the field name to \"lastmod\"\n    sed -r -i 's/(^publishdate: \".*)(T)(.*)(\\+)(.*)(:)(.*$)/\\1 \\3 +\\5\\7/g' *.md\n    sed -r -i 's/publishdate/lastmod/g' *.md\n    # Remove the year and month lead-in to the slug, and change the name to \"slug\"\n    sed -r -i 's/(^url: )(.{8})(.*)/\\1\\3/g' *.md\n    sed -r -i 's/^url/slug/' *.md\n    # Remove the brackets from the tags, remove the quotation marks, and remove spaces\n    sed -r -i 's/(^tags: )(\\[)(.*)(\\]$)/\\1\\3/' *.md\n    sed -r -i '/^tags/ s/\"//g' *.md\n    sed -r -i '/^tags/ s/, /,/g' *.md\n\n\n(Yes, there might be shorter / cleaner / faster etc. ways of doing this. This worked for me.)\n\nI also found - thanks to an error message when I first tried to build the BSSG content - that BSSG does not like src files with spaces in the names. I did not have many (although one was enough), so I fixed that:\n\n\n    rename 's/ /-/g' *.md\n\n\nOne thing that I did not do with hugo is have descriptions for my posts.\n\nI think that I'd prefer not to have descriptions displayed at all, but I've yet to find a way to suppress them in BSSG without editing the underlying scripts, which (for ease of updating), I am loathe to do.\n\n## Adding new content and building the blog\n\nI am not using BSSG's editing tool, or its command line tools for adding new posts (although I might need to use it for deleting posts).\n\nInstead, I prefer to write markdown in vim, and then upload that to the webserver and then build the site.\n\nI have a small shell script on my laptop and phone, which generates a text file (with a .md extension) with the correct header material, and it pre-populates the date and time in the correct format.\n\nI then have a separate script which I use to push the new blogpost to the webserver, and then, via ssh, runs a script in the relevant BSSG site directory to build the site and rsync it into place.\n\nHere is that build script. (Although \"build script\" makes it sound fancier than it is.)\n\n## Initial thoughts\n\nIt is early days, so these are little more than my immediate notes.\n\nI'd like to find a way to remove the descriptions from the index page.\n\nBut, other than that, I am very happy with BSSG, and I am very grateful to Stefano for making it available.\n\nBuilding this blog on a Raspberry Pi 4, even using the (newly-fixed; thanks, Stefano!) \"ram\" mode, is not exactly rapid, but that is not a particular concern for me.\n\nI am very pleased.\n\nAnd, if you can read this - my first new blogpost since adopting BSSG - then everything is going well :)",
  "title": "Moving my static site blog generator from hugo to BSSG",
  "updatedAt": "2026-03-14T18:28:23.000Z"
}