UNPKG

next-tribune-blog

Version:

Automatic blog generator for Next.js from Tribune.sh blockchain articles

123 lines (88 loc) 2.82 kB
# next-tribune-blog A TypeScript package for Next.js that automatically generates blog pages from your Tribune.sh blockchain articles during build time. ## Features - 🚀 Simple configuration - just add your wallet address - 📝 Automatic blog generation from YOUR Tribune.sh articles - 🎨 Beautiful default styles with dark mode support - 📅 Automatic date sorting - 🔍 SEO-friendly with metadata support - 💪 Full TypeScript support - 🎯 Next.js App Router compatible - ⛓️ Pre-configured for Tribune on Abstract mainnet - 🔗 Direct links to Tribune.sh and Abstract Scan ## Installation ```bash npm install next-tribune-blog # or yarn add next-tribune-blog # or bun add next-tribune-blog ``` ## Quick Start After installation, the package automatically updates your `next.config.ts`. You just need to: 1. **Set your wallet address** in `next.config.ts`: ```typescript const tribuneBlogPlugin = new NextTribuneBlogPlugin({ // Replace with your actual wallet address walletAddress: '0xYourWalletAddress', // <-- CHANGE THIS! }); ``` 2. **Build your project**: ```bash npm run build ``` 3. **Run the development server**: ```bash npm run dev ``` 4. **Visit your blog**: ``` http://localhost:3000/blog ``` ## How it Works 1. During build time, the plugin connects to Tribune.sh on Abstract mainnet 2. Fetches all articles published by your wallet address 3. Generates static blog pages with beautiful styling 4. Creates a blog listing page and individual article pages ## Configuration Options ```typescript const tribuneBlogPlugin = new NextTribuneBlogPlugin({ // Your wallet address (REQUIRED) walletAddress: '0xYourWalletAddress', // Output directory (optional, default: 'src/app/blog') outputDir: 'src/app/blog', }); ``` The Tribune contract address and RPC URL are pre-configured for Abstract mainnet. ## Generated Pages The plugin generates: - `/blog` - Blog listing page with all your articles - `/blog/[slug]` - Individual article pages Each article includes: - Cover image (if available) - Title and description - Publication date - Author wallet address (linked to Abstract Scan) - Link to view on Tribune.sh - Link to view article token on Abstract Scan ## Updating Articles Articles are fetched at build time for optimal performance. To update your blog with new articles: ```bash npm run build ``` ## Development ```bash # Clone the repository git clone https://github.com/yourusername/next-tribune-blog.git cd next-tribune-blog # Install dependencies npm install # Build the package npm run build ``` ## License MIT ## Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## Support For issues and feature requests, please use the [GitHub issues page](https://github.com/yourusername/next-tribune-blog/issues).