Skip to content

michaellwest/westtech.dev

Repository files navigation

westtech.dev

something to know — a blog about .NET, Sitecore, AI, DevOps, and modern software development by Michael West.

Built with Astro 5, Tailwind CSS v4, and hosted on Cloudflare Pages.


Local development

Prerequisites: Bun

bun install
bun run dev

The dev server runs at http://localhost:4321.

Note: The search page requires a production build to work. Run bun run build and then bun run preview to test it locally.


Writing a new post

Run the helper script from the repo root:

.\scripts\new-post.ps1

It will prompt you for:

  • Title — used as the heading and to generate the URL slug
  • Tags — comma-separated (e.g. sitecore, dotnet)
  • Description — one sentence for SEO and post cards

It creates the .md file in src/content/posts/, a matching image folder in public/images/posts/, and opens the file in VS Code.

Frontmatter reference

---
title: "Your Post Title"
date: 2025-01-15
description: "One sentence summary shown in post cards and search results."
tags: ["sitecore", "dotnet"]
draft: false # set to true to hide from the public site
---

Adding screenshots

  1. Take your screenshot (Win+Shift+S, Snipping Tool, ShareX, etc.)
  2. The image is now on your clipboard
  3. Run the helper script:
.\scripts\paste-image.ps1

It will:

  • Ask which post to attach the image to (defaults to the most recently modified post)
  • Ask for a short description (used as the filename and alt text)
  • Save the image to public/images/posts/[post-slug]/descriptive-name.png
  • Print the Markdown embed string and copy it to your clipboard

Then just paste into your post:

![blob table before cleanup](/images/posts/clean-orphaned-blob-records/blob-table-before-cleanup.png)

Tags

Tags are defined in post frontmatter — no separate config needed. New tags appear automatically on the /tags page. Keep them lowercase with hyphens (e.g. sitecore-cli, dotnet, docker).


Project structure

src/
  content/posts/      <- Markdown blog posts
  layouts/            <- BaseLayout, PostLayout
  components/         <- Header, Footer, PostCard, TagPill, ThemeToggle
  pages/              <- index, [slug], tags/, search, rss.xml, 404
  styles/global.css   <- Tailwind v4 import + base styles
public/
  images/posts/       <- per-post image folders
  favicon.svg
scripts/
  new-post.ps1        <- create a new post
  paste-image.ps1     <- paste clipboard image into a post

Build and preview

bun run build     # builds to /dist, then runs Pagefind indexer
bun run preview   # serves /dist locally at http://localhost:4321

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors