This commit implements extensive SEO improvements for the tzst documentation: ## Key Enhancements: ### 1. Sitemap & Crawling - Add sphinx-sitemap extension for automatic XML sitemap generation - Create robots.txt with crawler guidelines and sitemap reference - Configure html_baseurl for proper sitemap generation ### 2. Structured Data (Schema.org) - Add SoftwareApplication schema with detailed metadata - Implement BreadcrumbList schema for all pages - Add TechArticle schema for documentation pages - Create FAQPage schema for quickstart with 5 common Q&As - Add HowTo schema for examples page with step-by-step guide ### 3. Enhanced Meta Tags - Add comprehensive Open Graph tags (og:site_name, og:locale) - Enhance Twitter Card tags (twitter:site, twitter:creator) - Add article meta tags for proper attribution - Include rating and revisit-after tags ### 4. Page-Specific Optimization - Add SEO meta tags to development.md - Enhance all existing page meta tags - Implement page-specific canonical URLs - Add unique descriptions and keywords per page ### 5. Performance Optimization - Add preconnect hints for external domains - Add dns-prefetch for frequently accessed domains - Configure html_copy_source=False to reduce duplicate content - Hide unnecessary Sphinx links and branding ### 6. Documentation - Create comprehensive SEO_ENHANCEMENTS.md documenting all changes - Include best practices and monitoring recommendations - Provide verification steps and future enhancement ideas ## Benefits: - Improved search engine visibility and indexing - Rich snippets in search results - Better social media sharing previews - Enhanced click-through rates - Faster page discovery - Professional appearance ## Files Modified: - docs/conf.py - Sitemap config, meta tags, SEO settings - docs/requirements.txt - Add sphinx-sitemap dependency - docs/_templates/layout.html - Structured data, schemas - docs/development.md - Add page-specific meta tags - docs/_static/robots.txt - New file for crawler guidance - docs/SEO_ENHANCEMENTS.md - New comprehensive documentation
Documentation
This directory contains the Sphinx documentation for the tzst library.
Setup
-
Install documentation dependencies:
pip install -r requirements.txt -
Install the tzst package in development mode (required for autodoc):
pip install -e ..
Building Documentation
Local Development
Build the documentation locally:
# On Unix/macOS
make html
# On Windows
make.bat html
The built documentation will be in _build/html/. Open _build/html/index.html in your browser.
Live Reload (Recommended for Development)
For automatic rebuilding when files change:
# Install sphinx-autobuild if not already installed
pip install sphinx-autobuild
# Start live reload server
make livehtml
# or
sphinx-autobuild . _build/html
This will start a local server (usually at http://localhost:8000) that automatically rebuilds and refreshes when you save changes.
Other Build Targets
# Check documentation coverage
make coverage
# Check for broken links
make linkcheck
# Build PDF (requires LaTeX)
make latexpdf
# Clean build directory
make clean
Documentation Structure
index.md- Main documentation homepagequickstart.md- Quick start guide for new usersexamples.md- Practical examples and use casesapi/- API reference documentationindex.md- API overviewcore.md- Core functionality documentationcli.md- CLI documentationexceptions.md- Exception classes documentation
Writing Documentation
Markdown vs reStructuredText
This documentation uses MyST parser, which allows you to write in Markdown with some reStructuredText features. You can use either .md or .rst files.
Adding New Pages
- Create a new
.mdfile in the appropriate directory - Add it to the relevant
toctreedirective in the parent index file - Use proper Markdown headers and cross-references
API Documentation
API documentation is automatically generated from docstrings using Sphinx autodoc. To document a new module:
- Add the module to the appropriate API file (e.g.,
api/core.md) - Use autodoc directives like
automodule,autoclass,autofunction
Code Examples
Use fenced code blocks with language specification:
```python
from tzst import TzstArchive
with TzstArchive("example.tzst", "w") as archive:
archive.add("file.txt")
```
Cross-References
Link to other documentation pages:
See the {doc}`quickstart` guide for more information.
Link to API documentation:
Use the {class}`tzst.TzstArchive` class.
Automated Deployment
Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the main branch. The workflow is defined in .github/workflows/publish_docs.yml.
Local Testing of Deployment
To test the deployment process locally:
- Build the documentation:
make html - Serve the built files:
python -m http.server 8000 -d _build/html - Visit http://localhost:8000
Troubleshooting
Import Errors
If you get import errors when building documentation:
- Make sure the tzst package is installed:
pip install -e .. - Check that all dependencies are installed:
pip install -r requirements.txt - Verify your Python path includes the src directory
Theme Issues
If the RTD theme isn't working:
- Install the theme:
pip install sphinx-rtd-theme - Check that it's listed in
requirements.txt - Verify the theme configuration in
conf.py
Build Warnings
Address all Sphinx warnings to ensure high-quality documentation:
- Fix broken cross-references
- Add missing docstrings
- Resolve autodoc import issues
- Fix malformed markup
Contributing
When contributing to documentation:
- Follow the existing style and structure
- Test your changes locally before submitting
- Add examples for new features
- Update the changelog if appropriate
- Ensure all links work correctly