From 532dbdf56f168ffa4cf886a50790dafcc333ba9a Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 25 Apr 2024 21:18:13 -0500 Subject: [PATCH 01/14] testing bunny cdn --- static/css/custom.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/css/custom.css b/static/css/custom.css index d8e43e6..2acb0ac 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -11,8 +11,8 @@ font-weight: 400; font-display: fallback; src: local('Berkeley Mono'), - url('https://cdn.runtimeterror.dev/fonts/BerkeleyMono-Regular.woff2') format('woff2'), - url('https://cdn.runtimeterror.dev/fonts/BerkeleyMono-Regular.woff') format('woff') + url('https://megacorp-cdn.b-cdn.net/fonts/BerkeleyMono-Regular.woff2') format('woff2'), + url('https://megacorp-cdn.b-cdn.net/fonts/BerkeleyMono-Regular.woff') format('woff') } /* override page max-width */ From 68106e7fe1c90b1d7992154a08af24c5654aa84d Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 25 Apr 2024 22:02:32 -0500 Subject: [PATCH 02/14] Revert "testing bunny cdn" This reverts commit 532dbdf56f168ffa4cf886a50790dafcc333ba9a. --- static/css/custom.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/css/custom.css b/static/css/custom.css index 2acb0ac..d8e43e6 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -11,8 +11,8 @@ font-weight: 400; font-display: fallback; src: local('Berkeley Mono'), - url('https://megacorp-cdn.b-cdn.net/fonts/BerkeleyMono-Regular.woff2') format('woff2'), - url('https://megacorp-cdn.b-cdn.net/fonts/BerkeleyMono-Regular.woff') format('woff') + url('https://cdn.runtimeterror.dev/fonts/BerkeleyMono-Regular.woff2') format('woff2'), + url('https://cdn.runtimeterror.dev/fonts/BerkeleyMono-Regular.woff') format('woff') } /* override page max-width */ From 48e9c19ee41ec9764573b2d835944f4704de3ce1 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 2 Jun 2024 21:20:22 -0500 Subject: [PATCH 03/14] new post: the-slash-page-scoop --- content/posts/the-slash-page-scoop/index.md | 321 ++++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 content/posts/the-slash-page-scoop/index.md diff --git a/content/posts/the-slash-page-scoop/index.md b/content/posts/the-slash-page-scoop/index.md new file mode 100644 index 0000000..4f124bc --- /dev/null +++ b/content/posts/the-slash-page-scoop/index.md @@ -0,0 +1,321 @@ +--- +title: "The Slash Page Scoop" +date: 2024-06-02 +# lastmod: 2024-05-30 +description: "I've added new slash pages to the site to share some background info on who I am, what I use, and how this site works." +featured: false +toc: true +reply: true +categories: Backstage +tags: + - hugo + - meta +--- +Inspired by [Robb Knight](https://rknight.me/)'s recent [slash pages](https://slashpages.net/) site, I spent some time over the past week or two drafting some slash pages of my own. + +> Slash pages are common pages you can add to your website, usually with a standard, root-level slug like `/now`, `/about`, or `/uses`. They tend to describe the individual behind the site and are distinguishing characteristics of the IndieWeb. + +On a blog that is otherwise organized in a fairly chronological manner, slash pages provide a way share information out-of-band. I think they're great for more static content (like an about page that says who I am) as well as for content that may be regularly updated (like a changelog). + +The pages that I've implemented (so far) include: +- [/about](/about) tells a bit about me and my background +- [/changelog](/changelog) is just *starting* to record some of visual/functional changes I make here +- [/colophon](/colophon) describes the technology and services used in producing/hosting this site +- [/homelab](/homelab) isn't a canonical slash page but it provides a lot of details about my homelab setup +- [/save](/save) shamelessly hosts referral links for things I love and think you'll love too +- [/uses](/uses) shares the stuff I use on a regular basis + +And, of course, these are collected in one place at [/slashes](/slashes). + +Feel free to stop here if you just want to check out the slash pages, or keep on reading for some nerd stuff about how I implemented them on my Hugo site. + +--- + +### Implementation +All of my typical blog posts get created within the site's Hugo directory under `content/posts/`, like this one at `content/posts/the-slash-page-scoop/index.md`. They get indexed, automatically added to the list of posts on the home page, and show up in the RSS feed. I don't want my slash pages to get that treatment so I made them directly inside the `content` directory: + +``` +content +├── categories +├── posts +├── search +├── 404.md +├── _index.md +├── about.md [tl! ~~] +├── changelog.md [tl! ~~] +├── colophon.md [tl! ~~] +├── homelab.md [tl! ~~] +├── save.md [tl! ~~] +├── simplex.md +└── uses.md [tl! ~~] +``` + +Easy enough, but I didn't then want to have to worry about manually updating a list of slash pages so I used [Hugo's Taxonomies](https://gohugo.io/content-management/taxonomies/) feature for that. I simply tagged each page with a new `slashes` category by adding it to the post's front matter: + +```yaml +# torchlight! {"lineNumbers":true} +--- +title: "/changelog" +date: "2024-05-26" +lastmod: "2024-05-30" +description: "Maybe I should keep a log of all my site-related tinkering?" +categories: slashes # [tl! ~~] +--- +``` + +{{% notice note "Category Names" %}} +I really wanted to name the category `/slashes`, but that seems to trip up Hugo a bit when it comes to creating an archive of category posts. So I settled for `slashes` and came up with some workarounds to make it present the way I wanted. +{{% /notice %}} + +Hugo will automatically generate an archive page for a given taxonomy term (so a post tagged with the category `slashes` would be listed at `$BASE_URL/category/slashes/`), but I like to have a bit of control over how those archive pages are actually presented. So I create a new file at `content/categories/slashes/_index.md` and drop in this front matter: + +```yaml +# torchlight! {"lineNumbers":true} +--- +title: /slashes +url: /slashes +aliases: + - /categories/slashes +description: > + My collection of slash pages. +--- +``` + +The `slashes` in the file path tells Hugo which taxonomy it belongs to and so it can match the appropriately-categorized posts. + +Just like with normal posts, the `title` field defines the title (duh) of the post; this way I can label the archive page as `/slashes` instead of just `slashes`. + +The `url` field lets me override where the page will be served, and I added `/categories/slashes` as an alias so that anyone who hits that canonical URL will be automatically redirected. + +Setting a `description` lets me choose what introductory text will be displayed at the top of the index page, as well as when it's shown at the next higher level archive (like `/categories/`). + +Of course, I'd like to include a link to [slashpages.net](https://slashpages.net) to provide a bit more info about what these pages are, and I can't add hyperlinks to the description text. What I *can* do is edit the template which is used for rendering the archive page. In my case, that's at `layouts/partials/archive.html`, and it starts out like this: + +```jinja-html +# torchlight! {"lineNumbers":true} +{{ $pages := .Pages }} +{{ if .IsHome }} + {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{ end }} +
+{{ if .IsHome }} +

{{ site.Params.indexTitle | markdownify }}

+{{ else }} +

{{ .Title | markdownify }}{{ if eq .Kind "term" }}  

+ {{ with .Description }}{{ . }}
{{ else }}
{{ end }} +{{ end }}{{ end }} + {{ .Content }} +
+``` + +Line 9 is where I had already modified the template to conditionally add an RSS link for category archive pages. I'm going to tweak the setup a bit to conditionally render designated text when the page `.Title` matches `/slashes`: + +```jinja-html +# torchlight! {"lineNumbers":true} +{{ $pages := .Pages }} +{{ if .IsHome }} + {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{ end }} +
+{{ if .IsHome }} +

{{ site.Params.indexTitle | markdownify }}

+{{ else }} + {{ if eq .Title "/slashes" }} +

{{ .Title | markdownify }}

+ My collection of slash pages.
+ {{ else }} +

{{ .Title | markdownify }}{{ if eq .Kind "term" }}  

+ {{ with .Description }}{{ . }}
{{ else }}
{{ end }} + {{ end }} +{{ end }}{{ end }} + {{ .Content }} +
+``` + +So instead of rendering the `description` I defined in the front matter the archive page will show: + +> *My collection of [slash pages](https://slashpages.net).* + +While I'm at it, I'd like for the slash pages themselves to be listed in alphabetical order rather than sorted by date (like everything else on the site). The remainder of my `layouts/partials/archive.html` already handles a few different ways of displaying lists of content: + +```jinja-html +# torchlight! {"lineNumbers":true} +{{- if and (eq .Kind "taxonomy") (eq .Title "Tags") }} + {{/* /tags/ */}} +
+ {{- range $key, $value := .Site.Taxonomies }} + {{- $slicedTags := ($value.ByCount) }} + {{- range $slicedTags }} + {{- if eq $key "tags"}} +
{{ .Name }}{{ .Count }}
+ {{- end }} + {{- end }} + {{- end }} +
+{{- else if eq .Kind "taxonomy" }} + {{/* /categories/ */}} + {{- $sorted := sort $pages "Title" }} + {{- range $sorted }} + {{- $postDate := .Date.Format "2006-01-02" }} + {{- $updateDate := .Lastmod.Format "2006-01-02" }} +
+
+

{{ .Title | markdownify }}

+ +
+
+ {{ .Description }} +
+
+
+ {{ end }} +{{- else }} + {{/* regular posts archive */}} + {{- range (.Paginate $pages).Pages }} + {{- $postDate := .Date.Format "2006-01-02" }} + {{- $updateDate := .Lastmod.Format "2006-01-02" }} +
+
+

{{ .Title | markdownify }}

+ +
+
+ {{if .Description }}{{ .Description }}{{ else }}{{ .Summary }}{{ end }} +
+
+
+ {{- end }} + {{- template "_internal/pagination.html" . }} +{{- end }} +``` + +1. The [/tags/](/tags/) archive uses a condensed display format which simply shows the tag name and the number of posts with that tag. +2. Other taxonomy archives (like [/categories](/categories)) are sorted by title, displayed with a brief description, and the date that a post in the categories was published or updated. +3. Archives of posts are sorted by date (most recent first) and include the post description (or summary if it doesn't have one), and both the publish and updated dates. + +I'll just tweak the second condition there to check for either a taxonomy archive or a page with the title `/slashes`: + +```jinja-html +# torchlight! {"lineNumbers":true} +{{- if and (eq .Kind "taxonomy") (eq .Title "Tags") }} + {{/* /tags/ */}} +
+ {{- range $key, $value := .Site.Taxonomies }} + {{- $slicedTags := ($value.ByCount) }} + {{- range $slicedTags }} + {{- if eq $key "tags"}} +
{{ .Name }}{{ .Count }}
+ {{- end }} + {{- end }} + {{- end }} +
+{{- else if eq .Kind "taxonomy" }} +{{- else if or (eq .Kind "taxonomy") (eq .Title "/slashes") }} + {{/* /categories/ */}} + {{/* /categories/ or /slashes/ */}} + {{- $sorted := sort $pages "Title" }} + {{- range $sorted }} + {{- $postDate := .Date.Format "2006-01-02" }} + {{- $updateDate := .Lastmod.Format "2006-01-02" }} +
+
+

{{ .Title | markdownify }}

+ +
+
+ {{ .Description }} +
+
+
+ {{ end }} +{{- else }} + {{/* regular posts archive */}} + {{- range (.Paginate $pages).Pages }} + {{- $postDate := .Date.Format "2006-01-02" }} + {{- $updateDate := .Lastmod.Format "2006-01-02" }} +
+
+

{{ .Title | markdownify }}

+ +
+
+ {{if .Description }}{{ .Description }}{{ else }}{{ .Summary }}{{ end }} +
+
+
+ {{- end }} + {{- template "_internal/pagination.html" . }} +{{- end }} +``` + +So that's got the [/slashes](/slashes/) page looking the way I want it to. The last tweak will be to the template I use for displaying related (ie, in the same category) posts in the sidebar. The magic for that happens in `layouts/partials/aside.html`: + +```jinja-html +# torchlight! {"lineNumbers":true} +{{ if .Params.description }}

{{ .Params.description }}


{{ end }} +{{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) }} +

+

On this page

+ {{ .TableOfContents }} +
+

+{{ end }} + +{{ if isset .Params "categories" }} +{{$related := where .Site.RegularPages ".Params.categories" "eq" .Params.categories }} +{{- $relatedLimit := default 8 .Site.Params.numberOfRelatedPosts }} +{{ if eq .Params.categories "slashes" }} +

More /slashes

+{{ $sortedPosts := sort $related "Title" }} + +{{ else }} +

More {{ .Params.categories }}

+ +{{ end }} +
+{{ end }} + +{{- $posts := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} +{{- $featured := default 8 .Site.Params.numberOfFeaturedPosts }} +{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}} +{{- with $featuredPosts }} +

Featured Posts

+ +{{- end }} +``` + +So now if you visit any of my slash pages (like, say, [/colophon](/colophon/)) you'll see the alphabetized list of other slash pages in the side bar. + +### Closing +I'll probably keep tweaking these slash pages in the coming days, but for now I'm really glad to finally have them posted. I've only thinking about doing this for the past six months. \ No newline at end of file From 93b017ee71d86896a73848f8a0077cb8e86bb2b6 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 2 Jun 2024 21:35:48 -0500 Subject: [PATCH 04/14] update /uses --- content/uses.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/uses.md b/content/uses.md index 5286f9d..f277bd0 100644 --- a/content/uses.md +++ b/content/uses.md @@ -1,7 +1,7 @@ --- title: "/uses" date: "2024-05-29" -# lastmod: {{ .Date | time.Format "2006-01-02" }} +lastmod: "2024-06-02" description: "The hardware, software, services, and gear which I use (almost) daily." toc: true timeless: true @@ -18,7 +18,7 @@ categories: slashes - **[Weatherflow Tempest Weather Station](https://shop.tempest.earth/products/tempest)** to help me get my Wx nerd on. ### Everyday Carry -*What has it got in its pockets/backpack?* +*What has it got in its pocketses?* - **[Flipper Zero](https://flipperzero.one/)** running [Momentum Firmware](https://momentum-fw.dev/) in my pocket or bag for on-the-go hacking and exploration. - **[Leatherman FREE K4](https://www.leatherman.com/free-k4-590.html)** knife/multitool in my pocket for cutting and tinkering. - **[Milky lactase tablets](https://shopmilky.com/)** in my wallet so I can enjoy dairy without consequences. @@ -28,7 +28,8 @@ categories: slashes - **[Pixel Watch 2](https://store.google.com/product/pixel_watch_2)** on my wrist, for notifications and fitness tracking. - **[ProxGrind RF Field Detector Card](https://www.redteamtools.com/RFID_LF_HF_Field_Detector_Card)** on my keychain to quickly learn about RFID/NFC readers. - **[Ridge Wallet](https://ridge.com/products/aluminum-gunmetal)** in my pocket for keeping my cards handy. -- **[Ti EDC Backpack](https://bigidesign.com/pages/ti-edc-backpack-landing-page)** for carrying my stuff. +- **[RovyVon Aurora A7 EDC Flashlight](https://www.rovyvon.com/collections/aurora-keychain-flashlights/products/aurora-a7-usb-c-gitd-sky-blue-keychain-flashlight-4th-generation)** in my pocket for keeping the darkness at bay. +- **[Ti EDC Backpack](https://bigidesign.com/pages/ti-edc-backpack-landing-page)** for carrying my stuff, and keeping it organized while in transit. - **[Yubico Yubikey 5C NFC](https://www.yubico.com/product/yubikey-5c-nfc/)** on my keychain for hardware token things. ### Software From a06c3312878b6cc95abc92bf9c104ea06bcf6b94 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Tue, 4 Jun 2024 20:49:01 -0500 Subject: [PATCH 05/14] update search link to use mojeek --- content/posts/prettify-hugo-rss-feed-xslt/index.md | 6 +++--- static/xml/feed.xsl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/posts/prettify-hugo-rss-feed-xslt/index.md b/content/posts/prettify-hugo-rss-feed-xslt/index.md index 3667692..3bb42b8 100644 --- a/content/posts/prettify-hugo-rss-feed-xslt/index.md +++ b/content/posts/prettify-hugo-rss-feed-xslt/index.md @@ -1,7 +1,7 @@ --- title: "Prettify Hugo RSS Feeds with XSLT" date: 2024-04-30 -lastmod: "2024-05-30" +lastmod: "2024-06-05" description: "Making my Hugo-generated RSS XML look as good to human visitors as it does to feed readers." featured: false thumbnail: pretty-feed.png @@ -180,7 +180,7 @@ That's getting there: ![A darker styled RSS page](getting-there-feed.png) -Including those CSS styles means that the rendered page now uses my color palette and the [font I worked so hard to integrate](/using-custom-font-hugo/). I'm just going to make a few more tweaks to change some of the formatting, put the `New to feeds?` bit on its own line, and point to my [self-hosted instance of the SearXNG metasearch engine](https://scribbles.jbowdre.lol/post/self-hosting-a-search-engine-iyjdlk6y) instead of DDG. +Including those CSS styles means that the rendered page now uses my color palette and the [font I worked so hard to integrate](/using-custom-font-hugo/). I'm just going to make a few more tweaks to change some of the formatting, put the `New to feeds?` bit on its own line, and point to [Mojeek](https://mojeek.com) instead of DDG ([why?](https://scribbles.jbowdre.lol/post/a-comprehensive-evaluation-of-various-search-engines-i-ve-used)). Here's my final (for now) `static/xml/feed.xsl` file: @@ -210,7 +210,7 @@ Here's my final (for now) `static/xml/feed.xsl` file:

(RSS)

This is an RSS feed. To subscribe to it, copy its address and paste it when your feed reader asks for it. It will be updated periodically in your reader.

-

New to feeds? Learn more.

+

New to feeds? Learn more.

urladdressfalse diff --git a/static/xml/feed.xsl b/static/xml/feed.xsl index d51a25c..03a86f1 100644 --- a/static/xml/feed.xsl +++ b/static/xml/feed.xsl @@ -22,7 +22,7 @@

(RSS)

This is an RSS feed. To subscribe to it, copy its address and paste it when your feed reader asks for it. It will be updated periodically in your reader.

-

New to feeds? Learn more.

+

New to feeds? Learn more.

urladdressfalse From 33c80f1280c888b6a56de6601165dd833e692b17 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 18:05:16 -0500 Subject: [PATCH 06/14] preview: deploy to bunny --- .github/workflows/deploy-preview.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 65658db..97c5dd5 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -1,4 +1,4 @@ -name: Deploy Preview to Neocities +name: Deploy Preview to Bunny # only run on changes to preview on: @@ -42,16 +42,19 @@ jobs: chmod 644 ~/.ssh/known_hosts - name: Build with Hugo run: HUGO_REMOTE_FONT_PATH=${{ secrets.REMOTE_FONT_PATH }} hugo --minify --environment preview - - name: Insert 404 page - run: | - cp public/404/index.html public/not_found.html - name: Highlight with Torchlight run: | npm i @torchlight-api/torchlight-cli npx torchlight - - name: Deploy to Neocities - uses: bcomnes/deploy-to-neocities@v1 + - name: Deploy to Bunny + uses: ayeressian/bunnycdn-storage-deploy@v2.2.2 with: - api_token: ${{ secrets.NEOCITIES_PREVIEW_API_TOKEN }} - cleanup: true - dist_dir: public \ No newline at end of file + source: public + destination: / + storageZoneName: "${{ secrets.BUNNY_STORAGE_NAME }}" + storagePassword: "${{ secrets.BUNNY_STORAGE_PASSWORD }}" + accessKey: "${{ secrets.BUNNY_STORAGE_KEY }}" + pullZoneId: "${{ secrets.BUNNY_ZONE_ID }}" + upload: "true" + remove: "true" + purgePullZone: "true" \ No newline at end of file From 7e878358f923c4105d0da90379199d6a092ee000 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 18:06:16 -0500 Subject: [PATCH 07/14] preview: update baseurl --- config/preview/hugo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/preview/hugo.toml b/config/preview/hugo.toml index 8936b1b..f9f012b 100644 --- a/config/preview/hugo.toml +++ b/config/preview/hugo.toml @@ -1 +1 @@ -baseURL = "https://preview--runtimeterror.neocities.org/" \ No newline at end of file +baseURL = "https://preview.runtimeterror.dev/" \ No newline at end of file From e2b6f268e1f33b45160b0ef5edf189dbd9d11923 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 18:10:08 -0500 Subject: [PATCH 08/14] preview: workflow tweaks --- .github/workflows/deploy-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 97c5dd5..e071cce 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -5,6 +5,7 @@ on: push: branches: - preview + workflow_dispatch: concurrency: # prevent concurrent deploys doing strange things group: deploy-preview @@ -53,6 +54,7 @@ jobs: destination: / storageZoneName: "${{ secrets.BUNNY_STORAGE_NAME }}" storagePassword: "${{ secrets.BUNNY_STORAGE_PASSWORD }}" + storageEndpoint: "${{ secrets.BUNNY_STORAGE_ENDPOINT }}" accessKey: "${{ secrets.BUNNY_STORAGE_KEY }}" pullZoneId: "${{ secrets.BUNNY_ZONE_ID }}" upload: "true" From 1472e1fd4059ccf17693ea9e7e13b76633cbe7d9 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 18:15:15 -0500 Subject: [PATCH 09/14] tweak bunny api access --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index e071cce..5fd194f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -55,7 +55,7 @@ jobs: storageZoneName: "${{ secrets.BUNNY_STORAGE_NAME }}" storagePassword: "${{ secrets.BUNNY_STORAGE_PASSWORD }}" storageEndpoint: "${{ secrets.BUNNY_STORAGE_ENDPOINT }}" - accessKey: "${{ secrets.BUNNY_STORAGE_KEY }}" + accessKey: "${{ secrets.BUNNY_API_KEY }}" pullZoneId: "${{ secrets.BUNNY_ZONE_ID }}" upload: "true" remove: "true" From d0c2c61f52a29cc5b3fa31c0bb7ca8184cb37b89 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 19:41:43 -0500 Subject: [PATCH 10/14] update preview workflow --- .github/workflows/deploy-preview.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 5fd194f..8a074c8 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -1,4 +1,4 @@ -name: Deploy Preview to Bunny +name: Build and Deploy Preview # only run on changes to preview on: @@ -52,11 +52,11 @@ jobs: with: source: public destination: / - storageZoneName: "${{ secrets.BUNNY_STORAGE_NAME }}" - storagePassword: "${{ secrets.BUNNY_STORAGE_PASSWORD }}" + storageZoneName: "${{ secrets.BUNNY_STORAGE_NAME_PREVIEW }}" + storagePassword: "${{ secrets.BUNNY_STORAGE_PASSWORD_PREVIEW }}" storageEndpoint: "${{ secrets.BUNNY_STORAGE_ENDPOINT }}" accessKey: "${{ secrets.BUNNY_API_KEY }}" - pullZoneId: "${{ secrets.BUNNY_ZONE_ID }}" + pullZoneId: "${{ secrets.BUNNY_ZONE_ID_PREVIEW }}" upload: "true" remove: "true" purgePullZone: "true" \ No newline at end of file From 265493ec151e7fedd660639843ee7edfdfa3a15c Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 19:58:17 -0500 Subject: [PATCH 11/14] deploy prod to bunny --- .github/workflows/deploy-prod.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 341fb88..f7e4e07 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -1,4 +1,4 @@ -name: Deploy to Production +name: Build and Deploy Prod # only run on changes to main on: @@ -52,12 +52,19 @@ jobs: run: | npm i @torchlight-api/torchlight-cli npx torchlight - - name: Deploy HTML to Neocities - uses: bcomnes/deploy-to-neocities@v1 + - name: Deploy to Bunny + uses: ayeressian/bunnycdn-storage-deploy@v2.2.2 with: - api_token: ${{ secrets.NEOCITIES_API_TOKEN }} - cleanup: true - dist_dir: public + source: public + destination: / + storageZoneName: "${{ secrets.BUNNY_STORAGE_NAME }}" + storagePassword: "${{ secrets.BUNNY_STORAGE_PASSWORD }}" + storageEndpoint: "${{ secrets.BUNNY_STORAGE_ENDPOINT }}" + accessKey: "${{ secrets.BUNNY_API_KEY }}" + pullZoneId: "${{ secrets.BUNNY_ZONE_ID }}" + upload: "true" + remove: "true" + purgePullZone: "true" - name: Deploy GMI to Agate run: | rsync -avz --delete --exclude='*.html' --exclude='*.css' --exclude='*.js' -e ssh public/ deploy@${{ secrets.GMI_HOST }}:${{ secrets.GMI_CONTENT_PATH }} From 2f91984442ff2e44231185ef73ee929185887c15 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 20:40:59 -0500 Subject: [PATCH 12/14] include torchlight token in workflow --- .github/workflows/deploy-preview.yml | 2 +- .github/workflows/deploy-prod.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 8a074c8..bceae9b 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -46,7 +46,7 @@ jobs: - name: Highlight with Torchlight run: | npm i @torchlight-api/torchlight-cli - npx torchlight + TORCHLIGHT_TOKEN=${{ secrets.TORCHLIGHT_TOKEN }} npx torchlight - name: Deploy to Bunny uses: ayeressian/bunnycdn-storage-deploy@v2.2.2 with: diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index f7e4e07..abcd3e3 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -51,7 +51,7 @@ jobs: - name: Highlight with Torchlight run: | npm i @torchlight-api/torchlight-cli - npx torchlight + TORCHLIGHT_TOKEN=${{ secrets.TORCHLIGHT_TOKEN }} npx torchlight - name: Deploy to Bunny uses: ayeressian/bunnycdn-storage-deploy@v2.2.2 with: From 43bb14f26a7a228a8027eb65da09507d569687c3 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 20:46:38 -0500 Subject: [PATCH 13/14] update colophon/changelog to reflect move from neocities to bunny --- content/changelog.md | 5 ++++- content/colophon.md | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/content/changelog.md b/content/changelog.md index bf481de..715a67a 100644 --- a/content/changelog.md +++ b/content/changelog.md @@ -1,7 +1,7 @@ --- title: "/changelog" date: "2024-05-26T21:19:08Z" -lastmod: "2024-05-30" +lastmod: "2024-06-06" description: "Maybe I should keep a log of all my site-related tinkering?" featured: false toc: false @@ -10,6 +10,9 @@ categories: slashes --- *High-level list of config/layout changes to the site.* +**2024-06-06:** +- Migrate hosting from Neocities to Bunny CDN + **2024-05-30:** - Fix broken styling for taxonomy (categories/tags) feeds - Open "notes" header link in new tab since it's an external link diff --git a/content/colophon.md b/content/colophon.md index 15c6c4b..92a5dd4 100644 --- a/content/colophon.md +++ b/content/colophon.md @@ -1,7 +1,7 @@ --- title: "/colophon" date: "2024-05-26T22:30:58Z" -lastmod: "2024-05-28" +lastmod: "2024-06-06" description: "There's a lot that goes into this site. Let me tell you how it works." featured: false toc: true @@ -16,8 +16,8 @@ categories: slashes - performs syntax highlighting with [Torchlight](https://torchlight.dev) ([details](/spotlight-on-torchlight/)). - provides site search with [lunr](https://lunrjs.com/) based on an implementation detailed by [Victoria Drake](https://victoria.dev/blog/add-search-to-hugo-static-sites-with-lunr/). - leverages [tinylytics](https://tinylytics.app/) for privacy-friendly analytics and cute kudos buttons. -- uses [bunny.net](https://bunny.net) for DNS and CDN services. -- is published to / hosted by [Neocities](https://neocities.org) with a GitHub Actions workflow ([details](/deploy-hugo-neocities-github-actions/)). +- resolves via [Bunny DNS](https://bunny.net/dns/). +- is published to / hosted by [Bunny CND](https://bunny.net/cdn/) with a GitHub Actions workflow. - has a [Gemini](https://geminiprotocol.net) mirror at `gemini://gmi.runtimeterror.dev`. This is generated from a [Hugo gemtext post layout](https://github.com/jbowdre/runtimeterror/blob/main/layouts/_default/single.gmi), deployed to a [Vultr](https://www.vultr.com/) VPS through a GitHub Actions workflow, and served with [Agate](https://github.com/mbrubeck/agate). From 9c199b4a3f306558824678097c003f404678491d Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Thu, 6 Jun 2024 20:49:28 -0500 Subject: [PATCH 14/14] workflow: remove unneeded 404 step --- .github/workflows/deploy-prod.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index abcd3e3..119ef5a 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -45,9 +45,6 @@ jobs: chmod 644 ~/.ssh/known_hosts - name: Build with Hugo run: HUGO_REMOTE_FONT_PATH=${{ secrets.REMOTE_FONT_PATH }} hugo --minify - - name: Insert 404 page - run: | - cp public/404/index.html public/not_found.html - name: Highlight with Torchlight run: | npm i @torchlight-api/torchlight-cli