Installation & Setup Guide
This guide will help you set up the blog code repository on your local machine for development and writing.
Prerequisites
Section titled “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
Section titled “Getting Started”-
Clone the Repository:
Terminal window git clone https://github.com/iot49/blog-code.gitcd blog-code -
Install Dependencies:
Terminal window npm install -
Content Repository: This blog separates code from content. Ensure your
blog-contentrepository is located adjacent to theblog-codefolder:/parent-dir # Structure should look like:# ├── blog-code/# └── blog-content/ -
Environment Variables: Configure your
.envfile for local development and deployment. See the Setting up Environment Variables guide for details.
Development Workflow
Section titled “Development Workflow”Local Preview
Section titled “Local Preview”To start the Astro development server and preview your changes in real-time:
./bin/previewThe site will be available at http://localhost:4321.
Running Tests
Section titled “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/testBuild & Deploy
Section titled “Build & Deploy”To build the site for production:
./bin/deployThis script syncs your latest content, builds the static site, and prepares it for Cloudflare Pages.
Check Links
Section titled “Check Links”To check for broken external links:
./bin/check-linksRun this infrequently to avoid rate limiting by some providers.