Brian Wang

Restarting my personal webpage

· meta

Motivation

So this is my first post after the obligatory ‘Hello World’ post. I haven’t updated this personal webpage in a while (Github says the last time was 2021!).

I was laid off recently from my job as an Analytics Engineer at Netflix, and after spending a bit of time feeling listless about getting back into the workforce, I decided to take an intentional sabbatical or rather, break from work, at least for two months (more like three, to be honest), to pursue some personal goals and interests of mine. Through that, I’m hoping to renew my sense of excitement and purpose about what I want to do for work and why.

As part of this sabbatical, I thought it would be worth restarting my personal webpage, for a few reasons, both personal and practical:

I’ll probably be taking some time to reflect on some of those topics in a separate blog post, but this first one is more about the technical aspects of this blog, specifically how it’s set up.

In this age of AI, part of the reason that restarting this blog was so easy was because I did it with the help of Gemini.

With that being said, I have no idea what Gemini did, really - so I’d like to take some time to describe how this blog is set up so I understand how exactly each file that Gemini had me put together works together and so I can be more aware of how changes to the blog in the future should be done. I think a workflow like this of letting AI handle the implementation but making sure that one takes the time to build understanding will become more commonplace in the future, so this is me taking time to practice it now.

How this blog is set up

I started off my prompting Gemini like so:

i want to create a github-based website that is also formulated like a blog. i will type my blogposts in VSCode instead of via a CMS interface, which is OK. but can you suggest a simple website structure?

It spit out a bunch of technical information that I didn’t take the time to read (lol), and I followed it up with:

can you walk me through creating this structure step by step

after which it walked me step by step through the setup.

Node and npm

I recently upgraded from an Intel-based Mac to Apple Silicon, so I first had to reinstall node via brew install node. This command installs both node and npm.

A recap of what both of these are:

Even though we break them down separately to clarify what each does, in practice they act as a bundle - npm comes installed with Node automatically and runs on top of it, so you use them together as a single toolkit.

Astro

After re-installing Node and npm, I then created a new Astro project using npm create astro@latest . - technically, because this repo wasn’t empty, I initialized the scaffolding in a separate folder and then brought it over to the root folder.

Gemini then provided me a shell script to build out a repo skeleton, which I’ll copy here:

my-blog/
├── .github/
│   └── workflows/
│       └── deploy.yml          # Automated build & GitHub Pages deployment
├── public/
│   ├── favicon.ico
│   └── images/                 # Shared images (or co-located per post)
├── src/
│   ├── components/
│   │   ├── Header.astro        # Site title, nav links, theme toggle
│   │   ├── Footer.astro        # Copyright, RSS link, social links
│   │   └── PostCard.astro      # Preview card used on home/archive lists
│   ├── content/
│   │   └── posts/              # Where you write posts in VS Code
│   │       ├── 2026-12-03-hello-world.md
│   ├── layouts/
│   │   ├── BaseLayout.astro    # HTML shell, CSS, meta tags, SEO
│   │   └── PostLayout.astro    # Title, date, tags, reading time, prose styling
│   ├── pages/
│   │   ├── index.astro         # Home page (intro + recent posts)
│   │   ├── posts/
│   │   │   ├── index.astro     # Full blog archive / post index
│   │   │   └── [slug].astro    # Dynamic route rendering each post
│   │   ├── tags/
│   │   │   └── [tag].astro     # Optional filtered view by topic/tag
│   │   └── about.md            # Static "About" page
│   └── styles/
├── astro.config.mjs            # Site URL, Markdown plugins, integrations
├── package.json
└── README.md

What this repo includes

styles/

Directory for CSS stylesheets. Self-explanatory, I think.

components/

This is the directory for reusable Astro components - this repo is initiated with a Header and Footer Astro component. From what I can tell, Astro components are just reusable stubs that you can import into layouts. In our case, BaseLayout.astro imports both the Header and Footer components so that all layouts that utilize BaseLayout will automatically come with a Header and Footer.

layouts/

This is the directory for reusable layouts - each page leverages a particular Astro layout defined in this directory. Layouts can also embed properties of other layouts (reusability). In our case, we start with a BaseLayout and then we scaffold a PostLayout on top of it (we utilize BaseLayout within PostLayout). Some more details on either of those:

content.config.js

We’re going to take a quick detour of directories to talk about this file, which is important for the next section. This is a Typescript file (JS with typechecking) that enables use of Astro’s Content Collections feature (getCollection(), automatic schema validation, and type-safe frontmatter). In our specific implementation, we define a posts Collection variable that gathers the markdown files that match the given pattern within the given folder path. We then run the frontmatter of each Markdown object in our collection through schema validation, which will throw an error if any headers are incorrectly defined. Finally, we make the posts Collection object available in the collections variable so we can later access it through the Astro function getCollection('posts').

pages/

You can think of this as basically the sitemap - index.astro is loaded if no additional path is provided.

content/

This is where actual post content lives. Self-explanatory - most of how it’s used is explained in the content.config.js and [slug].astro sections above. But I do all of my typing here!

public/

This is a special folder in an Astro repo for static files that are copied straight into the final website untouched. Astro also includes a default favicon.ico and favicon.svg that serve as the website icon for different resolutions (SVG for high-res, .ico for the fallback). For now I’ll just keep the Astro default icon, but this is what I’d update in the future if I wanted.

tags /

This is not implemented on my blog. Maybe in the future.

Other files

Github workflows

So there’s this weird file called deploy.yml, and I’ve never used it before to build my webpage in the past. What is it?