· John Dummy  · 1 min read

Installation & Setup Guide

Get your blog up and running locally for development and content authoring.

Get your blog up and running locally for development and content authoring.

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

Prerequisites

  • 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).

Getting Started

  1. Clone the Repository:

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

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

    # Structure should look like:
    # /parent-dir
    #   ├── 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.

Development Workflow

Local Preview

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

./bin/preview

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

Running Tests

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

./bin/test

Build & Deploy

To build the site for production:

./bin/deploy

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

Back to Blog

Related Posts

View All Posts »