From d8cdbce3c8c98b11246abd68666807389d753911 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 26 May 2024 16:25:02 -0500 Subject: [PATCH] simplify logic for displaying kudos and post reply buttons --- archetypes/default.md | 2 +- config/_default/params.toml | 4 +-- config/local/params.toml | 1 - config/preview/params.toml | 2 +- content/404.md | 1 - content/about.md | 2 +- content/changelog.md | 3 +- .../index.md | 1 - content/posts/blocking-ai-crawlers/index.md | 1 - .../index.md | 1 - .../index.md | 1 - .../ditching-vsphere-for-proxmox/index.md | 1 - .../index.md | 1 - .../index.md | 1 - .../enable-fips-fix-aria-lifecycle/index.md | 1 - .../index.md | 1 - .../prettify-hugo-rss-feed-xslt/index.md | 1 - .../index.md | 1 - .../salt-state-netdata-tailscale/index.md | 1 - .../posts/spotlight-on-torchlight/index.md | 1 - .../index.md | 1 - .../index.md | 1 - .../posts/tailscale-ssh-serve-funnel/index.md | 1 - content/posts/using-custom-font-hugo/index.md | 1 - .../virtuallypotato-runtimeterror/index.md | 1 - content/simplex.md | 2 +- layouts/_default/single.html | 31 ++++++------------- 27 files changed, 16 insertions(+), 50 deletions(-) diff --git a/archetypes/default.md b/archetypes/default.md index 57e2c61..3e580c0 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -6,7 +6,7 @@ draft: true description: "This is a new post about..." featured: false toc: true -comments: true +reply: true categories: Tips # Backstage, ChromeOS, Code, Self-Hosting, VMware tags: - android diff --git a/config/_default/params.toml b/config/_default/params.toml index ab2a2f9..32f862a 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -37,10 +37,8 @@ robots = [ ] # Comments -comments = true analytics = true -kudos = true -emailReplies = true +reply = true [author] name = "John Bowdre" diff --git a/config/local/params.toml b/config/local/params.toml index 3b5ce10..51e9b52 100644 --- a/config/local/params.toml +++ b/config/local/params.toml @@ -1,2 +1 @@ -comments = true analytics = false \ No newline at end of file diff --git a/config/preview/params.toml b/config/preview/params.toml index c8a1743..8913a08 100644 --- a/config/preview/params.toml +++ b/config/preview/params.toml @@ -1,2 +1,2 @@ -comments = false +reply = false analytics = false \ No newline at end of file diff --git a/content/404.md b/content/404.md index 2d764ec..1a10e4c 100644 --- a/content/404.md +++ b/content/404.md @@ -3,7 +3,6 @@ title = "404'd!" noindex = true timeless = true comments = true -kudos = false +++ We're not sure what you were looking for but it's not here. diff --git a/content/about.md b/content/about.md index 91ccdc7..67ca941 100644 --- a/content/about.md +++ b/content/about.md @@ -2,7 +2,7 @@ title = "Hi, I'm John." description = "A brief introduction to me, this blog, and what you're likely to see here." timeless = true -comments = false +reply = false aliases = ["tldr", "bio"] +++ ![Me, +/- a few decades](/images/john.jpg) diff --git a/content/changelog.md b/content/changelog.md index da1358f..94eb8f0 100644 --- a/content/changelog.md +++ b/content/changelog.md @@ -9,4 +9,5 @@ timeless: true --- #### 2024-05-26 -- Begin changelog \ No newline at end of file +- Begin changelog +- Simplify logic for displaying kudos and post reply buttons \ No newline at end of file diff --git a/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md b/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md index 3184794..b0a9b5c 100644 --- a/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md +++ b/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md @@ -6,7 +6,6 @@ description: "Using the power of Home Assistant automations and Ntfy push notifi featured: true alias: automating-security-camera-notifications-with-home-assistant-and-ntfy toc: true -comments: true thumbnail: thumbnail.png categories: Self-Hosting tags: diff --git a/content/posts/blocking-ai-crawlers/index.md b/content/posts/blocking-ai-crawlers/index.md index 71ecd84..1e9beb9 100644 --- a/content/posts/blocking-ai-crawlers/index.md +++ b/content/posts/blocking-ai-crawlers/index.md @@ -5,7 +5,6 @@ lastmod: "2024-04-14T02:21:57Z" description: "Using Hugo to politely ask AI bots to not steal my content - and then configuring Cloudflare's WAF to actively block them, just to be sure." featured: false toc: true -comments: true categories: Backstage tags: - cloud diff --git a/content/posts/deploy-hugo-neocities-github-actions/index.md b/content/posts/deploy-hugo-neocities-github-actions/index.md index a3fd1e4..7a6e24f 100644 --- a/content/posts/deploy-hugo-neocities-github-actions/index.md +++ b/content/posts/deploy-hugo-neocities-github-actions/index.md @@ -5,7 +5,6 @@ date: 2024-01-21 description: "Using GitHub Actions to automatically deploy a Hugo website to Neocities." featured: false toc: true -comments: true categories: Backstage tags: - cicd diff --git a/content/posts/display-tempest-weather-static-site/index.md b/content/posts/display-tempest-weather-static-site/index.md index 0d50e9b..dc7c1ce 100644 --- a/content/posts/display-tempest-weather-static-site/index.md +++ b/content/posts/display-tempest-weather-static-site/index.md @@ -6,7 +6,6 @@ description: "Using a GitHub Actions workflow to retrieve data from an authentic featured: false thumbnail: "finished-product.png" toc: true -comments: true categories: Backstage tags: - api diff --git a/content/posts/ditching-vsphere-for-proxmox/index.md b/content/posts/ditching-vsphere-for-proxmox/index.md index 0b5d2eb..d52577a 100644 --- a/content/posts/ditching-vsphere-for-proxmox/index.md +++ b/content/posts/ditching-vsphere-for-proxmox/index.md @@ -4,7 +4,6 @@ date: 2023-11-24 description: "I moved my homelab from VMware vSphere to Proxmox VE, and my only regret is that I didn't make this change sooner." featured: false toc: true -comments: true categories: Tips # Projects, Code tags: - homelab diff --git a/content/posts/dynamic-opengraph-images-with-hugo/index.md b/content/posts/dynamic-opengraph-images-with-hugo/index.md index f097c2d..f70f340 100644 --- a/content/posts/dynamic-opengraph-images-with-hugo/index.md +++ b/content/posts/dynamic-opengraph-images-with-hugo/index.md @@ -5,7 +5,6 @@ date: "2024-02-19T04:12:27Z" description: "Using Hugo built-in functions to dynamically generate OpenGraph share images for every post." featured: false toc: true -comments: true thumbnail: hugo-logo-wide.png categories: Backstage tags: diff --git a/content/posts/easy-push-notifications-with-ntfy/index.md b/content/posts/easy-push-notifications-with-ntfy/index.md index fb11bb9..81de62e 100644 --- a/content/posts/easy-push-notifications-with-ntfy/index.md +++ b/content/posts/easy-push-notifications-with-ntfy/index.md @@ -5,7 +5,6 @@ lastmod: 2023-12-22 description: "Deploying and configuring a self-hosted pub-sub notification handler, getting another server to send a notifcation when it boots, and integrating the notification handler into Home Assistant." featured: false toc: true -comments: true categories: Self-Hosting tags: - android diff --git a/content/posts/enable-fips-fix-aria-lifecycle/index.md b/content/posts/enable-fips-fix-aria-lifecycle/index.md index 0adcec9..912431f 100644 --- a/content/posts/enable-fips-fix-aria-lifecycle/index.md +++ b/content/posts/enable-fips-fix-aria-lifecycle/index.md @@ -4,7 +4,6 @@ date: 2024-01-19 # lastmod: 2024-01-19 description: "Never in my life have I seen enabling FIPS *fix* a problem - until now." featured: false -comments: true categories: VMware tags: - vmware diff --git a/content/posts/gemini-capsule-gempost-github-actions/index.md b/content/posts/gemini-capsule-gempost-github-actions/index.md index 647cc70..0cf715f 100644 --- a/content/posts/gemini-capsule-gempost-github-actions/index.md +++ b/content/posts/gemini-capsule-gempost-github-actions/index.md @@ -5,7 +5,6 @@ lastmod: "2024-04-05T21:07:38Z" description: "Deploying a Gemini capsule, powered by Agate, gempost, kineto, Tailscale, and GitHub Actions" featured: false toc: true -comments: true categories: Self-Hosting tags: - caddy diff --git a/content/posts/prettify-hugo-rss-feed-xslt/index.md b/content/posts/prettify-hugo-rss-feed-xslt/index.md index e7eafc2..b9e36f6 100644 --- a/content/posts/prettify-hugo-rss-feed-xslt/index.md +++ b/content/posts/prettify-hugo-rss-feed-xslt/index.md @@ -5,7 +5,6 @@ description: "Making my Hugo-generated RSS XML look as good to human visitors as featured: false thumbnail: pretty-feed.png toc: true -comments: true categories: Backstage tags: - hugo diff --git a/content/posts/publish-services-cloudflare-tunnel/index.md b/content/posts/publish-services-cloudflare-tunnel/index.md index c281774..c95e079 100644 --- a/content/posts/publish-services-cloudflare-tunnel/index.md +++ b/content/posts/publish-services-cloudflare-tunnel/index.md @@ -5,7 +5,6 @@ date: 2024-01-15 description: "Exploring Cloudflare Tunnel as an alternative to Tailscale Funnel for secure public access to internal resources." featured: false toc: true -comments: true categories: Self-Hosting tags: - cloudflare diff --git a/content/posts/salt-state-netdata-tailscale/index.md b/content/posts/salt-state-netdata-tailscale/index.md index 0c9fef1..3558c50 100644 --- a/content/posts/salt-state-netdata-tailscale/index.md +++ b/content/posts/salt-state-netdata-tailscale/index.md @@ -5,7 +5,6 @@ lastmod: 2024-02-03 description: "A hasty Salt state to deploy netdata monitoring and publish it internally on my tailnet with Tailscale Serve" featured: false toc: true -comments: true categories: Code tags: - homelab diff --git a/content/posts/spotlight-on-torchlight/index.md b/content/posts/spotlight-on-torchlight/index.md index f42c4e1..70f1b5c 100644 --- a/content/posts/spotlight-on-torchlight/index.md +++ b/content/posts/spotlight-on-torchlight/index.md @@ -5,7 +5,6 @@ lastmod: 2023-11-13 description: "Syntax highlighting powered by the Torchlight.dev API makes it easier to dress up code blocks. Here's an overview of what I did to replace this blog's built-in Hugo highlighter (Chroma) with Torchlight." featured: false toc: true -comments: true categories: Backstage tags: - javascript diff --git a/content/posts/systemctl-edit-delay-service-startup/index.md b/content/posts/systemctl-edit-delay-service-startup/index.md index a4b8b87..67a74b9 100644 --- a/content/posts/systemctl-edit-delay-service-startup/index.md +++ b/content/posts/systemctl-edit-delay-service-startup/index.md @@ -5,7 +5,6 @@ date: 2023-10-15 description: "Quick notes on using `systemctl edit` to override a systemd service to delay its startup." featured: false toc: false -comments: true categories: Tips # Projects, Code tags: - crostini diff --git a/content/posts/tailscale-serve-docker-compose-sidecar/index.md b/content/posts/tailscale-serve-docker-compose-sidecar/index.md index 4397cc5..d4b5e9b 100644 --- a/content/posts/tailscale-serve-docker-compose-sidecar/index.md +++ b/content/posts/tailscale-serve-docker-compose-sidecar/index.md @@ -5,7 +5,6 @@ lastmod: 2024-02-07 description: "Using Docker Compose to deploy containerized applications and make them available via Tailscale Serve and Tailscale Funnel" featured: false toc: true -comments: true categories: Self-Hosting tags: - containers diff --git a/content/posts/tailscale-ssh-serve-funnel/index.md b/content/posts/tailscale-ssh-serve-funnel/index.md index 2bd7d0b..2425300 100644 --- a/content/posts/tailscale-ssh-serve-funnel/index.md +++ b/content/posts/tailscale-ssh-serve-funnel/index.md @@ -5,7 +5,6 @@ date: 2023-12-20 description: "Exploring some of my favorite Tailscale addon features: SSH, Serve, and Funnel." featured: false toc: true -comments: true categories: Tips # Projects, Code tags: - homelab diff --git a/content/posts/using-custom-font-hugo/index.md b/content/posts/using-custom-font-hugo/index.md index 1962318..408a78a 100644 --- a/content/posts/using-custom-font-hugo/index.md +++ b/content/posts/using-custom-font-hugo/index.md @@ -5,7 +5,6 @@ lastmod: "2024-05-01T13:29:30Z" description: "Installing a custom font on a Hugo site, and taking steps to protect the paid font files from unauthorized distribution. Plus a brief exploration of a pair of storage CDNs, and using Tailscale in a GitHub Actions workflow." featured: false toc: true -comments: true categories: Backstage tags: - bunny diff --git a/content/posts/virtuallypotato-runtimeterror/index.md b/content/posts/virtuallypotato-runtimeterror/index.md index 2babfd2..4a1f709 100644 --- a/content/posts/virtuallypotato-runtimeterror/index.md +++ b/content/posts/virtuallypotato-runtimeterror/index.md @@ -6,7 +6,6 @@ timeless: true draft: false description: "This blog has migrated from virtuallypotato.com to runtimeterror.dev." toc: false -comments: true categories: Backstage tags: - meta diff --git a/content/simplex.md b/content/simplex.md index c27283b..d6a4b29 100644 --- a/content/simplex.md +++ b/content/simplex.md @@ -1,5 +1,5 @@ +++ -comments = false +reply = false toc = false usePageBundles = false showDate = false diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 03da65a..cc059bc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -33,36 +33,23 @@
{{ .Content }}
- - {{- $showComments := true }} - {{- if eq .Site.Params.comments false }} - {{- $showComments = false }} - {{- else if eq .Params.comments false }} - {{- $showComments = false }} + {{- $reply := true }} + {{- if eq .Site.Params.reply false }} + {{- $reply = false }} + {{- else if eq .Params.reply false }} + {{- $reply = false }} {{- end }} - {{- if ne $showComments false }} + {{- if or (eq $reply true) (eq .Site.Params.analytics "true") }}
- {{- $showKudos := true }} - {{- if eq .Site.Params.kudos false }} - {{- $showKudos = false }} - {{- else if eq .Params.kudos false }} - {{- $showKudos = false }} - {{- end }} - {{- if and (eq .Site.Params.analytics true) (ne $showKudos false) }} + {{- if eq .Site.Params.analytics true }} {{- end }} - {{- $emailReplies := true }} - {{- if eq .Site.Params.emailReplies false }} - {{- $emailReplies = false }} - {{- else if eq .Params.emailReplies false }} - {{- $emailReplies = false }} - {{- end }} - {{- if and (eq .Site.Params.comments true) (eq $emailReplies true) }} + {{- if (eq $reply true) }} {{- $path := .Page.RelPermalink | path.Dir }} {{- $path := strings.Trim $path "/" }} {{- $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" }} 📧 Reply by email {{- end }} {{- end }} - + {{ end }}