@caleblawson/blog-shell
v0.3.3
Published
Reusable blog shell package for multi-tenant blog generation
Readme
@caleblawson/blog-shell
A reusable blog shell package that provides components and utilities for creating branded blogs. This package is designed for multi-tenant blog generation systems.
Installation
npm install @caleblawson/blog-shellUsage
Components
import Header from "@caleblawson/blog-shell/Header";
import PostsIndexClient from "@caleblawson/blog-shell/PostsIndexClient";
import PostCard from "@caleblawson/blog-shell/PostCard";Server Functions
import { loadPosts, loadSite } from "@caleblawson/blog-shell/server";Utility Functions
import {
defineBrandConfig,
createBlogShell,
} from "@caleblawson/blog-shell/utils";
// Note: createBlogShell is also available from the main export for backward compatibility
import { createBlogShell } from "@caleblawson/blog-shell";Styles
@import "@caleblawson/blog-shell/styles/globals.css";API
Components
Header- Navigation header with mobile menuPostsIndexClient- Client-side posts listing with search and filteringPostCard- Post preview card with multiple variants
Utilities
loadPosts()- Load posts from databaseloadSite()- Load site configurationcreateBlogShell(config)- Initialize blog shell with branding
Build Process
The package automatically processes CSS during build:
- CSS Processing: The build script processes
src/index.csswith Tailwind CLI to generate all necessary utilities - Asset Copying: Processed CSS is copied to
dist/styles/globals.csswith Tailwind directives removed - TypeScript: Component types are generated for better development experience
The resulting package exports processed CSS that can be imported directly without requiring consumers to configure Tailwind.
Development
This package is part of the blog-generator monorepo. To build:
npm run buildTo publish:
npm run prepublishOnly
npm publish --access public