Add original_url element to posts

This commit is contained in:
2024-03-13 16:14:27 +00:00
parent ee1a3c6481
commit 4bdc505167
7 changed files with 20 additions and 8 deletions

View File

@@ -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/<year>/name-of-post/index.md`, and a new file will be created in the right folder.
* Run `hugo new blog/<year>/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).

View File

@@ -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.">}}

View File

@@ -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.

View File

@@ -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.">}}

View File

@@ -16,8 +16,10 @@
<img src="{{ $avatar.RelPermalink }}" alt="{{ .Params.author }}'s avatar">
</td>
<td>
<p><i>This is a post by <b>{{ .Params.author }}</b>.<br>Originally
posted <b>{{ .PublishDate | time.Format ":date_full" }}</b></i></p>
<p><i>This is a post by <b>{{ .Params.author }}</b>.<br>Posted <b>{{ .PublishDate | time.Format ":date_full" }}</b></i>
{{ if .Params.original_url }}<br>Originally posted at <a href="{{ .Params.original_url }}" rel="canonical">{{
.Params.original_url }}</a>{{ end }}
</p>
</td>
</tr>
</table>

View File

@@ -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.
---

View File

@@ -17,8 +17,10 @@
</figure>
<div class="media-content">
<div class="content">
<p class="is-size-5 is-italic">This is a post by <b>{{ .Params.author }}</b>.<br />Originally
posted <b>{{ .PublishDate | time.Format ":date_full" }}</b></p>
<p class="is-size-6 is-italic">This is a post by <b>{{ .Params.author }}</b>.<br />
Posted <b>{{ .PublishDate | time.Format ":date_full" }}</b>
{{ if .Params.original_url }}<br/>Originally posted at <a href="{{ .Params.original_url }}" rel="canonical">{{ .Params.original_url }}</a>{{ end }}
</p>
</div>
</div>
</article>