September 2023 blog updates

September 2, 2023
45s
blog-updateblog-update7

To help start the new month out fresh, I've made some updates to the blog. These updates are:

1. Blog width

The entire blog's width is now at a more readable value. Tailwind CSS calls this prose.

2. Better styling on posts

The /posts page now styles a little better, and resizes better on extra small screens.

3. Estimated read times

I've added estimated read times to all posts. You can see this next to the date of each post.

If you're interested in how I estimate the read times, I do that by assuming you read about 250 words per minute. Here's the code:

export function estimateReadingTime(content: string): string {
  const wordsPerMinute = 250
  const words = content.split(/\s+/g).length
  let totalMinutes = words / wordsPerMinute
  let totalSeconds = Math.round(totalMinutes * 60)

  // Round off to the nearest 15 seconds
  totalSeconds = Math.round(totalSeconds / 15) * 15
  
  const minutes = Math.floor(totalSeconds / 60)
  const seconds = totalSeconds % 60

  return formatReadingTime(minutes, seconds)
}

4. Tags in posts

I've added tags next to the reading time in each post.

5. Author bio

I've added a short bio about the author at the bottom of each post.

All posts
John McGlone

Hi, I'm John McGlone, a Christian American husband, father, and software engineer. I believe that God's plan to make disciples of all nations will be successful.

Follow me on X, GitHub, and LinkedIn

John McGlone © 2023. All rights reserved.