Skip to content

Commit

Permalink
don't write ogAlt or ogSrc to front matter when updating post
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanClementsHax committed May 16, 2023
1 parent f2a93b5 commit 587d196
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/content/posts/postService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class PostService implements IPostService {
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
async #updateMeta({ bannerSrc, slug, ...meta }: PostMeta) {
async #updateMeta({ bannerSrc, slug, ogAlt, ogSrc, ...meta }: PostMeta) {
logger.log(`Marking updated at for ${slug} to ${meta.updatedAt}`)
let rawPostString = await this.#getRawPostString(slug)
rawPostString = await writeFrontMatter(meta, rawPostString)
Expand Down
3 changes: 1 addition & 2 deletions posts/amazon-ships-bad-code-too.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
ogAlt: burning building @davehoefler on Unsplash
ogSrc: posts/amazon-ships-bad-code-too/og.jpg
bannerAlt: burning building @davehoefler on Unsplash
publishedOn: 2023-05-15T04:00:00.000Z
description: Find out why even a top tier tech company still ships bad code
title: Amazon Ships Bad Code Too
updatedAt: 2023-05-16T00:23:08.733Z
---

> When I got to Amazon, I thought engineering would be like a well oiled battle ship; ordered and tidy. Turns out it is more like a pirate ship; messy and chaotic. - Unknown Amazon principle engineer (paraphrased)
Expand Down
4 changes: 1 addition & 3 deletions posts/justifying-mocking.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
ogAlt: checklist by @glenncarstenspeters on Unsplash
ogSrc: posts/justifying-mocking/og.jpg
bannerAlt: checklist by @glenncarstenspeters on Unsplash
updatedAt: 2023-05-16T00:23:08.733Z
publishedOn: 2023-04-01T04:00:00.000Z
description: >-
Testing techniques like mocking are often overused, but can be justified. In
this post I break down what justifies such techniques.
title: Justifying Mocking
updatedAt: 2023-05-14T15:02:21.028Z
---

I'm not a huge fan of mocking as my [previous post on the testing totem pole makes clear](you-probably-dont-need-mocking). I find it, and other test simplifications like it, to take away from the value of the test being written. It can cause tests to become annoying maintenance pests that provide no more value than to remind you to update your tests when you make changes to the code.
Expand Down

0 comments on commit 587d196

Please sign in to comment.