|
| 1 | +# ivikramsahu.github.io |
| 2 | + |
| 3 | +Personal blog built with **Astro** + **Tailwind CSS**, deployed to **GitHub Pages** via **GitHub Actions**. |
| 4 | + |
| 5 | +## Why this blog exists |
| 6 | +This site is designed to be fast, readable, and fun: |
| 7 | + |
| 8 | +- **Writing-first** |
| 9 | + Posts are authored as content entries and rendered as static pages for great performance. |
| 10 | +- **A little delight** |
| 11 | + The sidebar includes a **Quotes** widget and a small **Snakes & Ladders** game to keep the experience light and interactive while still staying out of the way of reading. |
| 12 | + |
| 13 | +## Features |
| 14 | +- **Astro static rendering** for speed and SEO. |
| 15 | +- **Tailwind CSS** for consistent styling. |
| 16 | +- **Sticky header** with a **theme toggle** (light/dark). |
| 17 | +- **Blog listing + pagination** (`/page/[page]/`). |
| 18 | +- **Post pages** (`/blog/[...slug]/`) with clean typography. |
| 19 | +- **Quotes widget** |
| 20 | + Rotates quotes and refreshes periodically. |
| 21 | +- **Snakes & Ladders** |
| 22 | + A small two-player (You vs Computer) mini-game with state persistence, move logs, and win/lose effects. |
| 23 | + |
| 24 | +## Why the Quotes widget? |
| 25 | +The quotes panel is meant to add a small “focus boost” while browsing posts: |
| 26 | + |
| 27 | +- A quick line of motivation or perspective |
| 28 | +- Refreshes automatically (and also changes on reload) |
| 29 | +- Lives in the sidebar so it doesn’t distract from reading |
| 30 | + |
| 31 | +Implementation lives in `src/components/QuotesWidget.astro`. |
| 32 | + |
| 33 | +## Why the Snakes & Ladders game? |
| 34 | +The game is intentionally simple and optional: |
| 35 | + |
| 36 | +- Adds a playful element to the homepage/listing pages |
| 37 | +- Encourages exploration (without affecting core reading UX) |
| 38 | +- Runs fully client-side and doesn’t require any backend |
| 39 | + |
| 40 | +Implementation lives in `src/components/SnakesAndLadders.astro`. |
| 41 | + |
| 42 | +## Tech stack |
| 43 | +- **Astro** (site framework) |
| 44 | +- **Tailwind CSS** (styling) |
| 45 | +- **GitHub Pages** + **GitHub Actions** (deployment) |
| 46 | + |
| 47 | +## Project structure (high level) |
| 48 | +- `src/layouts/BaseLayout.astro` |
| 49 | + Shared layout, header/nav, theme toggle. |
| 50 | +- `src/pages/index.astro` |
| 51 | + Homepage blog list + sidebar. |
| 52 | +- `src/pages/page/[page].astro` |
| 53 | + Paginated blog list pages. |
| 54 | +- `src/pages/blog/[...slug].astro` |
| 55 | + Individual blog post pages. |
| 56 | +- `src/pages/about.astro` |
| 57 | + About page. |
| 58 | +- `src/components/QuotesWidget.astro` |
| 59 | + Quotes sidebar widget. |
| 60 | +- `src/components/SnakesAndLadders.astro` |
| 61 | + Snakes & Ladders game. |
| 62 | +- `src/styles/global.css` |
| 63 | + Global styles + typography tweaks. |
| 64 | +- `.github/workflows/deploy.yml` |
| 65 | + GitHub Actions workflow that builds and deploys the static output. |
| 66 | + |
| 67 | +## Running locally |
| 68 | +Prerequisites: |
| 69 | +- Node.js (LTS recommended) |
| 70 | +- npm |
| 71 | + |
| 72 | +Commands: |
| 73 | + |
| 74 | +```bash |
| 75 | +npm install |
| 76 | +npm run dev |
| 77 | +``` |
| 78 | + |
| 79 | +Astro will print the local dev URL (typically `http://localhost:4321`). |
| 80 | + |
| 81 | +## Build |
| 82 | +```bash |
| 83 | +npm run build |
| 84 | +npm run preview |
| 85 | +``` |
| 86 | + |
| 87 | +## Deployment (GitHub Pages) |
| 88 | +This repo is intended to be deployed as a **user site**: |
| 89 | + |
| 90 | +- Repo name: `ivikramsahu.github.io` |
| 91 | +- URL: `https://ivikramsahu.github.io/` |
| 92 | + |
| 93 | +Notes: |
| 94 | +- Deployment is done via **GitHub Actions** (see `.github/workflows/deploy.yml`). |
| 95 | +- In GitHub settings, ensure: |
| 96 | + - **Settings → Pages → Source = GitHub Actions** |
| 97 | + - Not “Deploy from a branch” (that can trigger Jekyll on source files). |
| 98 | + |
| 99 | +## Content notes |
| 100 | +If you imported content from another platform, helper scripts may live under `scripts/` (for example `scripts/import-hashnode.mjs`). These scripts are optional and not required to run the site. |
0 commit comments