Skip to content

Installation & Setup Guide

This guide will help you set up the blog code repository on your local machine for development and writing.

  • Node.js: Version 18.17.1 or higher.
  • npm: Included with Node.js.
  • Git: For version control.
  • uv & direnv: (Optional, but recommended for Jupyter support).
  1. Clone the Repository:

    Terminal window
    git clone https://github.com/iot49/blog-code.git
    cd blog-code
  2. Install Dependencies:

    Terminal window
    npm install
  3. Content Repository: This blog separates code from content. Ensure your blog-content repository is located adjacent to the blog-code folder:

    /parent-dir
    # Structure should look like:
    # ├── blog-code/
    # └── blog-content/
  4. Environment Variables: Configure your .env file for local development and deployment. See the Setting up Environment Variables guide for details.

To start the Astro development server and preview your changes in real-time:

Terminal window
./bin/preview

The site will be available at http://localhost:4321.

Before pushing any changes, ensure all tests pass. This script checks linting, types, and verifies that no private content is leaked in the build:

Terminal window
./bin/test

To build the site for production:

Terminal window
./bin/deploy

This script syncs your latest content, builds the static site, and prepares it for Cloudflare Pages.

To check for broken external links:

Terminal window
./bin/check-links

Run this infrequently to avoid rate limiting by some providers.