adhir.me - Personal Blog

A modern, performant blog built with Eleventy, featuring articles about AI, Code, and Climate Change.

Features

Quick Start

Prerequisites

Installation

  1. Clone or download this repository
  2. Navigate to the project directory
  3. Install dependencies:
    npm install

Development

Start the development server:

npm start

The site will be available at http://localhost:8080 with hot-reload enabled.

Building for Production

Generate the static site:

npm run build

The built site will be in the _site directory.

Project Structure

adhir-blog/
β”œβ”€β”€ _data/              # Global data files
β”‚   └── metadata.json   # Site metadata
β”œβ”€β”€ _includes/          # Templates and layouts
β”‚   └── layouts/
β”‚       β”œβ”€β”€ base.njk    # Base layout
β”‚       β”œβ”€β”€ home.njk    # Homepage layout
β”‚       └── post.njk    # Blog post layout
β”œβ”€β”€ _site/              # Built site (generated)
β”œβ”€β”€ css/                # Stylesheets
β”‚   β”œβ”€β”€ main.css
β”‚   └── prism-tomorrow.css
β”œβ”€β”€ js/                 # JavaScript files
β”‚   └── main.js
β”œβ”€β”€ posts/              # Blog posts (Markdown)
β”‚   β”œβ”€β”€ gpt-optimization.md
β”‚   β”œβ”€β”€ rust-wasm.md
β”‚   └── carbon-api.md
β”œβ”€β”€ .eleventy.js        # Eleventy configuration
β”œβ”€β”€ .gitignore
β”œβ”€β”€ index.njk           # Homepage
β”œβ”€β”€ about.md            # About page
β”œβ”€β”€ 404.md              # 404 page
β”œβ”€β”€ package.json
└── README.md

Writing Posts

Create new posts in the posts/ directory as Markdown files with frontmatter:

---
title: Your Post Title
description: A brief description
date: 2024-01-20
tags:
  - AI
  - Climate
category: ai
readingTime: 5
layout: layouts/post.njk
---

Your content here...

Customization

Metadata

Edit _data/metadata.json to update site information, author details, and social links.

Styling

Modify css/main.css for design changes. The CSS uses CSS custom properties for easy theming.

Features

Deployment

Netlify

  1. Push to GitHub
  2. Connect repository to Netlify
  3. Build command: npm run build
  4. Publish directory: _site

Vercel

  1. Install Vercel CLI: npm i -g vercel
  2. Run: vercel
  3. Follow prompts

GitHub Pages

  1. Build the site: npm run build
  2. Push _site contents to gh-pages branch

API Keys

The blog uses NASA’s DEMO_KEY by default. For production:

  1. Get your free API key at https://api.nasa.gov
  2. Replace DEMO_KEY in js/main.js

Browser Support

License

MIT License - feel free to use this for your own blog!

Credits

Created by Adhir Inspired by Medium’s design with added interactivity


---

## πŸ“¦ Complete File Structure for Download

adhir-blog/ β”œβ”€β”€ _data/ β”‚ └── metadata.json β”œβ”€β”€ _includes/ β”‚ └── layouts/ β”‚ β”œβ”€β”€ base.njk β”‚ β”œβ”€β”€ home.njk β”‚ └── post.njk β”œβ”€β”€ css/ β”‚ β”œβ”€β”€ main.css (full CSS from the HTML artifact) β”‚ └── prism-tomorrow.css β”œβ”€β”€ js/ β”‚ └── main.js β”œβ”€β”€ posts/ β”‚ β”œβ”€β”€ gpt-optimization.md β”‚ β”œβ”€β”€ rust-wasm.md β”‚ └── carbon-api.md β”œβ”€β”€ .eleventy.js β”œβ”€β”€ .gitignore β”œβ”€β”€ index.njk β”œβ”€β”€ about.md β”œβ”€β”€ 404.md β”œβ”€β”€ package.json └── README.md