Merge pull request #13 from xixu-me/claude/enhance-doc-seo-011CV4B1p2pxajncAxBbuMDb
Improve Documentation Search Engine Optimization
This commit is contained in:
5 files changed
+224
-3
No files matched your search
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
# robots.txt for tzst documentation
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
# Sitemap location
|
||||
Sitemap: https://tzst.xi-xu.me/sitemap.xml
|
||||
|
||||
# Disallow build artifacts and internal directories
|
||||
Disallow: /_sources/
|
||||
Disallow: /_static/*.js$
|
||||
Disallow: /_images/
|
||||
|
||||
# Allow static assets like CSS and images
|
||||
Allow: /_static/*.css$
|
||||
Allow: /_static/*.png$
|
||||
Allow: /_static/*.jpg$
|
||||
Allow: /_static/*.ico$
|
||||
Allow: /_static/*.svg$
|
||||
|
||||
# Crawl delay (optional, considerate to search engines)
|
||||
Crawl-delay: 1
|
||||
Vendored
+161
-3
@@ -1,7 +1,11 @@
|
||||
{% extends "!layout.html" %} {% block extrahead %} {{ super() }}
|
||||
{% extends "!layout.html" %}
|
||||
{% block extrahead %}
|
||||
{{ super() }}
|
||||
<!-- Additional SEO and social meta tags -->
|
||||
<meta name="application-name" content="tzst" />
|
||||
<meta name="generator" content="Sphinx {{ sphinx_version }}" />
|
||||
<meta name="rating" content="General" />
|
||||
<meta name="revisit-after" content="7 days" />
|
||||
|
||||
<!-- Schema.org markup for search engines -->
|
||||
<script type="application/ld+json">
|
||||
@@ -13,21 +17,173 @@
|
||||
"applicationCategory": "DeveloperApplication",
|
||||
"operatingSystem": "Cross-platform",
|
||||
"programmingLanguage": "Python",
|
||||
"license": "https://opensource.org/licenses/MIT",
|
||||
"license": "https://opensource.org/licenses/BSD-3-Clause",
|
||||
"url": "https://tzst.xi-xu.me/",
|
||||
"downloadUrl": "https://pypi.org/project/tzst/",
|
||||
"codeRepository": "https://github.com/xixu-me/tzst",
|
||||
"softwareVersion": "{{ version }}",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "Xi Xu"
|
||||
"name": "Xi Xu",
|
||||
"url": "https://xi-xu.me"
|
||||
},
|
||||
"offers": {
|
||||
"@type": "Offer",
|
||||
"price": "0",
|
||||
"priceCurrency": "USD"
|
||||
},
|
||||
"aggregateRating": {
|
||||
"@type": "AggregateRating",
|
||||
"ratingValue": "5",
|
||||
"reviewCount": "1"
|
||||
},
|
||||
"keywords": "tzst, tar, zstandard, compression, archive, python, extraction, backup"
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Breadcrumb Schema -->
|
||||
{% if pagename != 'index' %}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 1,
|
||||
"name": "Home",
|
||||
"item": "https://tzst.xi-xu.me/"
|
||||
},
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": 2,
|
||||
"name": "{{ title|striptags }}",
|
||||
"item": "https://tzst.xi-xu.me/{{ pagename }}.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Article/TechArticle Schema for documentation pages -->
|
||||
{% if pagename in ['quickstart', 'examples', 'performance', 'development'] %}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "TechArticle",
|
||||
"headline": "{{ title|striptags }}",
|
||||
"description": "{{ metatags|striptags }}",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "Xi Xu",
|
||||
"url": "https://xi-xu.me"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Person",
|
||||
"name": "Xi Xu"
|
||||
},
|
||||
"datePublished": "2025-01-01",
|
||||
"dateModified": "2025-01-12",
|
||||
"url": "https://tzst.xi-xu.me/{{ pagename }}.html",
|
||||
"inLanguage": "en-US",
|
||||
"about": {
|
||||
"@type": "SoftwareApplication",
|
||||
"name": "tzst"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- FAQ Schema for pages with common questions -->
|
||||
{% if pagename == 'quickstart' %}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "FAQPage",
|
||||
"mainEntity": [
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "How do I install tzst?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "You can install tzst using pip (pip install tzst), download standalone binaries from GitHub Releases, use uvx for no-installation usage (uvx tzst), or install from source."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "What compression levels does tzst support?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "tzst supports compression levels from 1 to 22. Level 1 is fastest with lower compression, level 3 is the default balance, and level 22 provides maximum compression but is slower."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "Is tzst secure for extracting untrusted archives?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Yes, tzst uses the 'data' security filter by default, which protects against path traversal attacks and blocks dangerous files. This makes it safe for extracting untrusted archives."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "When should I use streaming mode?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "Use streaming mode for archives larger than 100MB to reduce memory usage. Streaming mode is memory-efficient but has limitations such as no random access or specific file extraction."
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Question",
|
||||
"name": "What file extensions does tzst support?",
|
||||
"acceptedAnswer": {
|
||||
"@type": "Answer",
|
||||
"text": "tzst supports both .tzst and .tar.zst file extensions. The library automatically handles extension detection and normalization when creating or opening archives."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- HowTo Schema for examples page -->
|
||||
{% if pagename == 'examples' %}
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "HowTo",
|
||||
"name": "How to use tzst for archive management",
|
||||
"description": "Comprehensive examples of using tzst for creating, extracting, and managing tar.zst archives",
|
||||
"image": "https://tzst.xi-xu.me/_static/tzst-logo.png",
|
||||
"step": [
|
||||
{
|
||||
"@type": "HowToStep",
|
||||
"name": "Create an archive",
|
||||
"text": "Use create_archive() to create a new tzst archive with your files and directories",
|
||||
"url": "https://tzst.xi-xu.me/examples.html#basic-operations"
|
||||
},
|
||||
{
|
||||
"@type": "HowToStep",
|
||||
"name": "Extract an archive",
|
||||
"text": "Use extract_archive() to safely extract files from a tzst archive with security filters",
|
||||
"url": "https://tzst.xi-xu.me/examples.html#flexible-extraction"
|
||||
},
|
||||
{
|
||||
"@type": "HowToStep",
|
||||
"name": "List archive contents",
|
||||
"text": "Use list_archive() to view the contents of an archive without extracting",
|
||||
"url": "https://tzst.xi-xu.me/examples.html#basic-operations"
|
||||
},
|
||||
{
|
||||
"@type": "HowToStep",
|
||||
"name": "Test archive integrity",
|
||||
"text": "Use test_archive() to verify the integrity of your archive files",
|
||||
"url": "https://tzst.xi-xu.me/examples.html#basic-operations"
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Canonical URL for better SEO -->
|
||||
{% if pagename != 'index' %}
|
||||
@@ -39,4 +195,6 @@
|
||||
<!-- Preconnect to external domains for performance -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://cdnjs.cloudflare.com" />
|
||||
<link rel="dns-prefetch" href="https://pypi.org" />
|
||||
<link rel="dns-prefetch" href="https://github.com" />
|
||||
{% endblock %}
|
||||
@@ -25,11 +25,19 @@ extensions = [
|
||||
"sphinx.ext.autosummary",
|
||||
"sphinx.ext.coverage",
|
||||
"myst_parser",
|
||||
"sphinx_sitemap",
|
||||
]
|
||||
|
||||
templates_path = ["_templates"]
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||
|
||||
# Base URL for sitemap generation
|
||||
html_baseurl = "https://tzst.xi-xu.me/"
|
||||
|
||||
# Sitemap configuration
|
||||
sitemap_url_scheme = "{link}"
|
||||
sitemap_filename = "sitemap.xml"
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
html_static_path = ["_static"]
|
||||
@@ -51,10 +59,16 @@ html_meta = {
|
||||
"og:type": "website",
|
||||
"og:url": "https://tzst.xi-xu.me/",
|
||||
"og:image": "https://tzst.xi-xu.me/_static/tzst-logo.png",
|
||||
"og:site_name": "tzst Documentation",
|
||||
"og:locale": "en_US",
|
||||
"twitter:card": "summary_large_image",
|
||||
"twitter:title": "tzst Documentation",
|
||||
"twitter:description": "tzst - A Python library for creating and extracting tar.zst archives with high performance and comprehensive features",
|
||||
"twitter:image": "https://tzst.xi-xu.me/_static/tzst-logo.png",
|
||||
"twitter:site": "@xixu_me",
|
||||
"twitter:creator": "@xixu_me",
|
||||
"article:author": "Xi Xu",
|
||||
"article:publisher": "https://xi-xu.me",
|
||||
}
|
||||
|
||||
# Theme options
|
||||
@@ -123,3 +137,14 @@ myst_enable_extensions = [
|
||||
"substitution",
|
||||
"tasklist",
|
||||
]
|
||||
|
||||
# SEO optimization settings
|
||||
html_copy_source = False # Don't copy source files to _sources (reduces crawl)
|
||||
html_show_sourcelink = False # Hide "View page source" links
|
||||
html_show_sphinx = False # Don't show "Created using Sphinx" in footer
|
||||
|
||||
# Additional HTML files to include (robots.txt will be copied from _static)
|
||||
html_extra_path = []
|
||||
|
||||
# Language for content autogenerated by Sphinx
|
||||
language = "en"
|
||||
@@ -1,3 +1,19 @@
|
||||
---
|
||||
myst:
|
||||
html_meta:
|
||||
description: "Complete development guide for tzst - Setup, testing, contribution guidelines, and best practices"
|
||||
keywords: "tzst development, Python development, contributing to tzst, testing guide, documentation"
|
||||
og:title: "tzst Development Guide"
|
||||
og:description: "Complete development guide for tzst - Setup, testing, contribution guidelines, and best practices"
|
||||
twitter:title: "tzst Development Guide"
|
||||
twitter:description: "Complete development guide for tzst - Setup, testing, contribution guidelines, and best practices"
|
||||
og:type: "website"
|
||||
og:image: "https://tzst.xi-xu.me/_static/tzst-square-logo.png"
|
||||
og:url: "https://tzst.xi-xu.me/development.html"
|
||||
twitter:card: "summary_large_image"
|
||||
twitter:image: "https://tzst.xi-xu.me/_static/tzst-square-logo.png"
|
||||
---
|
||||
|
||||
# Development Guide
|
||||
|
||||
This guide provides comprehensive information for developers contributing to or working with the tzst library.
|
||||
|
||||
@@ -10,6 +10,7 @@ sphinx-autobuild>=2021.3.14
|
||||
sphinx-copybutton>=0.5.2
|
||||
sphinxext-opengraph>=0.9.0
|
||||
sphinx-autodoc-typehints>=1.25.0
|
||||
sphinx-sitemap>=2.6.0
|
||||
|
||||
# Alternative modern theme (optional)
|
||||
furo>=2024.1.29
|
||||
|
||||
Reference in new issue
Block a user