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:
- First, it allows me to share my work in the open - summarizing what I’ve been doing and what I’ve learned through my time off.
- Second, it allows me to synthesize my learnings - how can I not only summarize my key takeaways but transform what I’ve learned into broader concepts and “truths” to carry forward with me into what I do, both in work and in life?
- Third, it allows me to reflect personally and share the emotional journey as well - navigating life post-layoff hasn’t been easy, and a lot of that is emotional - while I do have an actual private blog for some of my personal thoughts, I’ll also use this space to share some personal reflections on not just what I’m doing and learning through this layoff, but how that process is going - what are the thoughts that go through my head, what are the emotions that I feel, what are the mental challenges that I face?
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:
node.jsis the engine that executes JS code on my computer - it runs build scripts, a local preview server, and enables automation and compiling. Basically, you can think of it as the way that the files in my repo are converted into a format compatible with a web browser.- Note: For static sites like my blog, Node is only run at build-time, so the live website doesn’t actually carry anything from Node - it only uses the compiled artifacts.
- For dynamic / full-stack apps, Node can also run at request-time, but my blog doesn’t need this.
npmstands for Node Package Manager, and it allows me to download pre-built packages into my project (defined inpackage.json). and execute project shortcut commands (likenpm run devornpm run buildvia the “scripts” section inpackage.json, which automatically uses tools from my localnode_modules/folder). For a blog, this could include things such as CSS frameworks, syntax highlighters, or RSS feed and sitemap generators. You can think ofnpmasuv(package/project management) for a JS project.- The main caveat is that
uvalso handles Python version management, whichnpmdoesn’t handle - there is a separate toolnvmfor that, which I am not using in my project.
- The main caveat is that
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.
- PostCard.astro - I thought it was worth reflecting on this one for a bit, as it’s a bit more interesting. It starts by defining expected inputs for this component (it expects a
CollectionEntry<'posts'>item passed in via the postprop). It then provides a template to format the contents ofpostinto a reusablePostCardcomponent.
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:
-
BaseLayout - the base layout starts off by importing the Header/Footer components and also the global CSS stylesheet. It then defines expected inputs through
interface Props- what this means is that if any Astro page usingBaseLayoutdoes not carry these properties, an error will be thrown. The?operator makes a property optional; otherwise it is required. It then sets fallback values for these two properties in the line:const { title, description = 'Personal blog and notes' } = Astro.props;Finally, it leaves a placeholder
<slot />that tells Astro where to insert child HTML into this layout. -
PostLayout - the header is just about imports and properties, again, along with property validation. In this specific case, we also import
Astro.props.frontmatterwhich is the Markdown header in.mdfiles. On the other hand,Astro.propsare set in.astroor.mdxfiles. It builds reusable scaffolding with the propertiestitleanddescriptionas wellBaseLayout, and then it leaves a<slot />again so that Astro know where to insert child HTML.
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.
-
index.astro - You can basically think of an
astrofile as a fancy HTML file. It contains a special header where JS is imported and executed, and then it also contains the core HTML where you can also execute JS if needed. Note that all of the inline JS in an Astro file runs on the server at build-time (remember all that stuff about about Node helping convert JS and all the other stuff into a fully web-browser compatible HTML format? This is where that happens). If we want JS to run in the browser, we still have to use<script>tags just like we would do in plain old vanilla HTML. -
about.md - Just a cute little Markdown file that contains frontmatter. Because it’s not a directory it renders at
<base-URL>/about. -
posts/ -
-
index.astro - Same as the above
index.astro, just slightly different content. Also, instead of mappingpoststo a series of<li>bullet points, we map them to a series ofPostCardcomponents for more detailed styling (and pass in each item via thepostprop as required). -
[slug].astro - Remember that
content.config.tsearlier? This is where it comes in handy. This file starts by loading thepostscollection of objects, which again contain all of the information from our Markdown files incontent/postsby definition. This is done using a specialgetStaticPathsfunction, which is run once for the dynamic Astro file (we know it is dynamic because of the bracketed variable[slug]). AftergetStaticPathsis run, the remainder of the file runs in a loop for every object in the loaded collection. Therefore, we basically render the posts one-by-one as they are loaded, injecting thepost.idinto the[slug]variable. Note that[slug]is not a special keyword - it only needs to match the name of the inserted param so it works correctly.
-
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
-
astro.config.mjs - This is a Module Javascript file, and it contains the main Astro settings for our project. Currently this just contains my site URL so Astro can use it when URLs are generated and an additional Markdown configuration which is applied globally. Markdown settings live here because Markdown is compiled on the Astro
rendercall, before layouts and CSS are applied. -
AGENTS.md - There’s a boilerplate
AGENTS.mdfile included in Astro, which tells AI agents how to work in this repo.AGENTS.mdis a convention supported by OpenAI, Google, Cursor, Github, and Astro; only Claude looks for the fileCLAUDE.md, but usually folks will symlink the two to represent the same thing. I’m not working with Claude (and I’m not using agentic support to directly modify this website), so I probably won’t worry about this for now.
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?