npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jsonblog/generator-tailwind

v4.3.0

Published

A Tailwind CSS generator for JsonBlog

Readme

JsonBlog Generator Tailwind

License: MIT TypeScript

A modern Tailwind CSS-powered static blog generator for JsonBlog. This package provides the same functionality as @jsonblog/generator-boilerplate but uses Tailwind CSS for styling with build-time compilation and purging for optimal bundle sizes.

Features

  • 🎨 Tailwind CSS with utility-first approach
  • Optimized CSS - Build-time compilation and purging (~14KB minified)
  • 🚀 Development server with live reload on port 3500
  • 🏷️ Tags and categories support for better content organization
  • 📄 Pagination with configurable posts per page
  • 📡 RSS feed generation for content syndication
  • 🗺️ Sitemap generation for SEO
  • 🔍 Syntax highlighting with Highlight.js
  • 📝 Clean, modern HTML output with semantic structure
  • 🎨 Professional design inspired by Stripe, Linear, and Vercel
  • 🔧 Customizable via tailwind.config.js
  • 📘 TypeScript support
  • ✅ Same API as generator-boilerplate

Installation

npm install @jsonblog/generator-tailwind

Usage

As a Library

import { generateBlog } from '@jsonblog/generator-tailwind';

const blog = {
  site: {
    title: 'My Blog',
    description: 'A blog about my thoughts',
  },
  basics: {
    name: 'John Doe',
  },
  settings: {
    postsPerPage: 5, // Optional: defaults to 10
  },
  posts: [
    {
      title: 'Hello World',
      slug: 'hello-world',
      content: '# Hello World\n\nThis is my first post!',
      createdAt: '2025-11-20',
      tags: ['introduction'],
    },
  ],
  pages: [],
};

const files = await generateBlog(blog, '/path/to/blog');
console.log(\`Generated \${files.length} files\`);

Customization

Tailwind Configuration

The generator includes a `tailwind.config.js` that extends Tailwind's default theme:

module.exports = {
  content: ['./templates/**/*.hbs'],
  theme: {
    extend: {
      fontFamily: {
        sans: ['-apple-system', 'BlinkMacSystemFont', ...],
        mono: ['"IBM Plex Mono"', 'Monaco', ...],
      },
      fontSize: {
        base: '19px', // Readable base font size
      },
      maxWidth: {
        content: '816px', // Optimized reading width
      },
    },
  },
};

Custom CSS

The `templates/input.css` file uses Tailwind's `@layer` directive:

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .post-card {
    @apply mb-10 pb-8 border-b border-gray-200;
  }
}

Grid Layout Pages

The generator supports grid layouts for pages like videos, projects, portfolios, etc. This allows you to showcase items in a visual grid with a featured item at the top.

Usage

Recommended: Load items from external file

In your blog.json, add a page with layout: "grid" and itemsSource pointing to a JSON file:

{
  "pages": [
    {
      "title": "Videos",
      "slug": "videos",
      "description": "My talks and presentations",
      "layout": "grid",
      "itemsSource": "videos.json"
    }
  ]
}

Then create videos.json in the same directory as your blog.json:

[
  {
    "title": "Building AI Products at Scale",
    "description": "A deep dive into production ML systems and the infrastructure needed to run them at scale.",
    "url": "https://youtube.com/watch?v=...",
    "image": "https://i.ytimg.com/vi/.../maxresdefault.jpg",
    "date": "2025-01-15",
    "featured": true,
    "tags": ["AI", "Infrastructure", "Scale"]
  },
  {
    "title": "Intro to RAG Systems",
    "description": "Understanding retrieval-augmented generation for building intelligent applications.",
    "url": "https://youtube.com/watch?v=...",
    "thumbnail": "https://i.ytimg.com/vi/.../hqdefault.jpg",
    "date": "2025-01-10",
    "tags": ["RAG", "LLM"]
  }
]

Alternative: Inline items

You can also define items directly in blog.json (not recommended for large lists):

{
  "pages": [
    {
      "title": "Videos",
      "layout": "grid",
      "items": [
        { "title": "...", "url": "..." }
      ]
    }
  ]
}

Grid Item Fields

Each item in the items array supports:

  • title (required): Item title
  • description (optional): Item description
  • url (optional): Link URL (makes title/image clickable)
  • image (optional): Full-size image (used for featured items)
  • thumbnail (optional): Thumbnail image (used for grid items)
  • featured (optional): Set to true to display as featured item at top
  • date (optional): Display date (formatted automatically)
  • tags (optional): Array of tags to display

Layout Behavior

  • Featured items: Display full-width at the top with larger image and more prominent styling
  • Regular items: Display in a 2-column grid below the featured item
  • Optional content: You can include regular markdown content that appears before the grid
  • Responsive: Grid automatically adjusts to single column on mobile

Use Cases

Perfect for:

  • Videos - YouTube/conference talks with thumbnails
  • Projects - Portfolio items with screenshots
  • Publications - Papers/articles with cover images
  • Courses - Educational content with thumbnails
  • Talks - Speaking engagements and presentations

Development

# Build Tailwind CSS only
npm run build:css

# Build everything (CSS + TypeScript)
npm run build

# Watch mode
npm run dev

Comparison with generator-boilerplate

| Feature | generator-tailwind | generator-boilerplate | |---------|-------------------|----------------------| | CSS Framework | Tailwind CSS | Custom CSS | | CSS Size | ~14KB (purged) | ~8.4KB | | Customization | tailwind.config.js | Direct CSS editing | | Utility Classes | ✅ Yes | ❌ No | | Build Step | CSS compilation | None |

License

MIT © JSON Blog Team