From 4bdc50516716cd3e2ed0e581250e72c7d9b85b63 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 13 Mar 2024 16:14:27 +0000 Subject: [PATCH] Add `original_url` element to posts --- README.md | 9 ++++++--- content/blog/2023/old-webcam-on-modern-linux/index.md | 1 + content/blog/2023/powerbook-g4-disk-replacement/index.md | 1 + content/blog/2024/creating-an-appletalk-nas/index.md | 1 + themes/lhs-retro/layouts/blog/single.html | 6 ++++-- themes/lhs/archetypes/blog/index.md | 4 +++- themes/lhs/layouts/blog/single.html | 6 ++++-- 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2713df6..815ee4b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ To run the site locally you can do the following: * Run `hugo serve -D --gc -w -F` (add -F to show content with future dates) or `make serve` (if you have `make` installed) * Go to `http://localhost:1313/` to view the local instance. -The site will be updated in real time with any changes made to the site. +The site will be updated in real-time with any changes made to the site. ## Making Changes @@ -26,15 +26,18 @@ Branches are automatically deployed to [https://web-test.leighhack.org](https:// ### New Blog Post * Download and install Hugo -* Run `hugo new blog//name-of-post/index.md`, and a new file will be created in the right folder. +* Run `hugo new blog//name-of-post`, and a new folder will be created in the year folder with a `index.md` with the post. * Update the `author` and `author_email` values * Add a `subtitle` +* If you've posted the blog elsewhere, add the `original_url` value to link to your original post URL. +* Place any images in the folder that was created for your post. +* Set `listing_image` to the image you'll want on the blog listing page ([https://www.leighhack.org/blog/](https://www.leighhack.org/blog/)) * Run Dev Mode (above), or `make serve` and view your post. ### Updating Membership Plans The membership plan data is held in a YAML file, this is used by the Hackspace API and other tools as well. -* Edit [data/memberships.yaml](data/memberships.yaml), follow the format of existing entries. +* Edit [data/memberships.yaml](data/memberships.yaml), following the format of existing entries. * Links are standard URIs and can support any of the normal formats (mailto:, etc). \ No newline at end of file diff --git a/content/blog/2023/old-webcam-on-modern-linux/index.md b/content/blog/2023/old-webcam-on-modern-linux/index.md index 115ddcf..a60b324 100644 --- a/content/blog/2023/old-webcam-on-modern-linux/index.md +++ b/content/blog/2023/old-webcam-on-modern-linux/index.md @@ -11,6 +11,7 @@ tags: author: Andrew Williams author_email: andy@tensixtyone.com listing_image: camera.png +original_url: https://nikdoof.com/posts/2023/old-webcam-on-modern-linux/ --- {{< image src="camera.png" width="400x" class="is-pulled-right" title="The Trust WB-1200P, a webcam from the early days of USB devices.">}} diff --git a/content/blog/2023/powerbook-g4-disk-replacement/index.md b/content/blog/2023/powerbook-g4-disk-replacement/index.md index ae09f1f..52fb9a6 100644 --- a/content/blog/2023/powerbook-g4-disk-replacement/index.md +++ b/content/blog/2023/powerbook-g4-disk-replacement/index.md @@ -11,6 +11,7 @@ draft: false author: Andrew Williams author_email: andy@tensixtyone.com listing_image: open.jpg +original_url: https://nikdoof.com/posts/2023/powerbook-g4-disk-replacement/ --- In October 2003, I made my first leap into using an Apple device. For quite some time I'd been trying to find a reasonable and portable machine for daily use, and I had slowly gotten frustrated with the current offerings by Dell, HP, and other major laptop manufacturers. In the hunt for something new, I picked a Powerbook G4 12". This machine was my daily workhorse for several years and at the end of its life, it was stuffed into a draw and forgotten about. Sometime around 2014 when I was purchasing a new Macbook Pro I decided to grab my old laptop out of storage and get it booted to hopefully pull a few files from the system. I had lost the power adapter and (obviously) the battery had given up. I purchased a new power adapter on eBay and ended up throwing everything back in the drawer to sort out another day. diff --git a/content/blog/2024/creating-an-appletalk-nas/index.md b/content/blog/2024/creating-an-appletalk-nas/index.md index feeca9b..e52a300 100644 --- a/content/blog/2024/creating-an-appletalk-nas/index.md +++ b/content/blog/2024/creating-an-appletalk-nas/index.md @@ -10,6 +10,7 @@ draft: false author: Andrew Williams author_email: andy@tensixtyone.com listing_image: network-browser.jpg +original_url: https://nikdoof.com/posts/2024/creating-an-appletalk-nas/ --- {{< image src="netatalk.png" width="400x" class="is-pulled-right" title="The Netatalk logo.">}} diff --git a/themes/lhs-retro/layouts/blog/single.html b/themes/lhs-retro/layouts/blog/single.html index 4f0a475..de65bc4 100644 --- a/themes/lhs-retro/layouts/blog/single.html +++ b/themes/lhs-retro/layouts/blog/single.html @@ -16,8 +16,10 @@ {{ .Params.author }}'s avatar -

This is a post by {{ .Params.author }}.
Originally - posted {{ .PublishDate | time.Format ":date_full" }}

+

This is a post by {{ .Params.author }}.
Posted {{ .PublishDate | time.Format ":date_full" }}
+ {{ if .Params.original_url }}
Originally posted at {{ + .Params.original_url }}{{ end }} +

diff --git a/themes/lhs/archetypes/blog/index.md b/themes/lhs/archetypes/blog/index.md index d8a6974..d56f82a 100644 --- a/themes/lhs/archetypes/blog/index.md +++ b/themes/lhs/archetypes/blog/index.md @@ -4,6 +4,8 @@ subtitle: "" date: {{ .Date }} tags: [] draft: true -author: +author: # Name to show on the post author_email: # used for Gravatar icon +listing_image: # Image to use in the post list on the website +original_url: # If cross-posted from a blog, link to the original. --- diff --git a/themes/lhs/layouts/blog/single.html b/themes/lhs/layouts/blog/single.html index 8183b5f..760fcb0 100644 --- a/themes/lhs/layouts/blog/single.html +++ b/themes/lhs/layouts/blog/single.html @@ -17,8 +17,10 @@
-

This is a post by {{ .Params.author }}.
Originally - posted {{ .PublishDate | time.Format ":date_full" }}

+

This is a post by {{ .Params.author }}.
+ Posted {{ .PublishDate | time.Format ":date_full" }} + {{ if .Params.original_url }}
Originally posted at {{ .Params.original_url }}{{ end }} +