Add comprehensive GitHub Pages documentation site#89
Open
Add comprehensive GitHub Pages documentation site#89
Conversation
This commit adds a complete Docusaurus-based documentation site for the VIP Block Data API plugin with the following features: ## Documentation Structure - Introduction and getting started guide - Complete REST API reference with code examples - Full GraphQL API documentation - WordPress hooks reference (filters and actions) - How-to guides for common use cases - Advanced topics (performance, caching, troubleshooting) - Extensive code examples for React, Next.js, and more ## Technical Implementation - Built with Docusaurus 3.x (React-based) - WordPress VIP design system and color scheme - Responsive layout with dark mode support - Comprehensive code examples in PHP, JavaScript, TypeScript, GraphQL - TypeScript type definitions for block structures - Complete React block renderer implementation ## Key Features - Automatic GitHub Pages deployment via GitHub Actions - Search-ready (Algolia DocSearch integration) - Mobile-responsive design - Extensive real-world examples - Best practices for WordPress and React ## Documentation Coverage - REST API endpoints and parameters - GraphQL queries with Apollo Client - All WordPress filters and actions - Block filtering techniques - Custom attribute examples - Performance optimization strategies - Caching implementations - Common troubleshooting scenarios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Extends the documentation with detailed examples for enabling draft access: ## New Content - Complete "Draft & Preview Access Guide" covering: - Basic authenticated draft access - Author-only draft viewing - Headless WordPress preview modes - Time-limited preview tokens - Next.js preview mode integration - Scheduled posts access - Private posts handling ## Enhanced Filter Documentation Added 7 new examples to vip_block_data_api__rest_validate_post_id: - Allow authenticated users to view drafts - Allow post authors to view their own drafts - Allow editors to preview with specific capabilities - Allow draft access with time-limited preview tokens - Role-based draft access - Content preview for headless CMS - Scheduled posts (future) access ## Security Best Practices - Token validation with constant-time comparison - Permission checking examples - Rate limiting implementation - Input sanitization - Time-limited token generation This addresses common use cases for headless WordPress applications that need to preview draft content before publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Significantly enhances the vip_block_data_api__rest_permission_callback
documentation with comprehensive authentication examples and best practices.
## New Examples Added
1. **Require Publish Capability** - Using current_user_can('publish_posts')
2. **Application Password Authentication** - WordPress 5.6+ app passwords
3. **API Key Authentication** - Custom API key validation
4. **JWT Token Authentication** - Integration with JWT plugins
5. **Combine Multiple Conditions** - OR logic for auth + IP whitelist
6. **Rate Limiting for Public Access** - Throttle public requests
7. **Time-Based Access Control** - Business hours example
## Additional Content
- Client-side usage examples for Application Passwords
- Client-side usage examples for API Key authentication
- Important caching warning callout for authenticated requests
- Practical code examples for headless WordPress applications
## Key Features Covered
- Application Passwords (WordPress 5.6+)
- Custom API key validation
- JWT token authentication
- IP whitelisting
- Combined authentication methods
- Rate limiting strategies
- Time-based access control
- Caching implications on WordPress VIP
These examples provide production-ready code for securing the Block Data API
in various scenarios from simple authentication to complex multi-condition access.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds a complete, production-ready documentation site for the VIP Block Data API plugin built with Docusaurus (React-based).
What's Included
📚 Complete Documentation
🎨 Design & Features
💻 Technical Implementation
🚀 Deployment
trunkbranchHow to Use
Local Development
cd docs npm install npm startBuild for Production
cd docs npm run buildEnable GitHub Pages
Documentation Site Structure
Preview
Once merged and deployed, the documentation will be available at:
https://automattic.github.io/vip-block-data-api/Testing Checklist
Benefits
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com