Skip to content

Site: page titles, descriptions, social previews and structured data #17

Closed

Description

@gudoshnikovn

Part of the SEO epic: gudoshnikovn/libphash#51

The site at https://gudoshnikovn.github.io/python-libphash/ has the same gaps as the C library's site (libphash#52): one description for every page ("Perceptual image hashing in Python: the binding of the libphash C library" on all 24 pages), titles from navigation labels ("Home - python-libphash", "Hashing many images - python-libphash"), no Open Graph, Twitter or structured data. Python users search for perceptual hashing far more often than C users do, so this site is the one most searches can reach, and its job is to answer the Python question and hand the reader on to libphash's site for the theory.

Zensical 0.0.68 has what this needs, no post-build step: theme.custom_dir for an override directory, the extrahead block in base.html, and page.meta.title / page.meta.description from front matter in the <title> and <meta name="description">.

Page metadata

  • title and description front matter on every page in docs/, worded the way people search: "perceptual image hash in Python", "find duplicate images in Python", "imagehash alternative", "hash images from numpy / Pillow / OpenCV", "hash a directory on all CPUs". Title up to 60 characters, description 120–160, the query's words first.
  • Front page: a title that says what the package is ("python-libphash: perceptual image hashing for Python") and, near the top, that it installs as python-libphash and imports as libphash, and that it is not pHash.org's library (Debian/Ubuntu libphash0) nor the phash/imagehash packages.
  • Pages made from a snippet (changelog, contributing, security, migration) and the API pages (mkdocstrings) carry the front matter in their wrapper in docs/.
  • One h1 per page that matches the title's wording.
  • The strict build (or tests/test_docs.py) fails on a page without a title or description, on a description outside 120–160 characters, and on a description or title another page also has.

Social previews and structured data (overrides/main.html, extrahead)

  • og:title, og:description, og:url (the canonical URL), og:type, og:site_name, og:image with its size and alt text; twitter:card = summary_large_image.
  • A 1200×630 preview image generated in the repository, in the C site's style (whichever libphash#52 settles on: one per site or one per page); the same image as the repository's social preview on GitHub.
  • JSON-LD SoftwareSourceCode on the front page: name, description, programmingLanguage: Python, codeRepository, license, version (from the package), url of the PyPI page, isBasedOn libphash's repository and site.
  • JSON-LD TechArticle on guide pages and BreadcrumbList from the navigation path, the same shape as libphash's.
  • Checked after the deploy: Google's Rich Results Test (no errors), an OG preview (Telegram, Slack or opengraph.xyz), and Lighthouse SEO 100 on the front page and one guide page.

Leading readers to libphash's site

  • Theory is not copied from the C site: pages link to it (two copies of the same text on two sites split their ranking).
  • Every algorithm the site names links to its page on libphash's site, with the algorithm's name as the link text, not "here": the Algorithm members in the API reference (docstrings), the configuring, loading, batch and storing guides.
  • Each guide page that sets or compares hashes links the relevant theory page (comparing, choosing a threshold, choosing an algorithm); today only the front page and five guides do.
  • "Finding duplicate images" task page (libphash#53 leaves open which site carries it): this site, if decided there, with the Python code from examples/ and the thresholds and theory linked on libphash's site.
  • A comparison with other Python libraries is libphash's (libphash#47, the binding benchmarks no other library); this site links to it once it exists.

PyPI and GitHub

  • Documentation = "https://gudoshnikovn.github.io/python-libphash/" in [project.urls] (a well-known PyPI label, shown with its icon); decide whether Homepage stays on GitHub. Check whether tools/audit.py or the tests compare the Project-URL entries.
  • README (the PyPI long description): the first paragraph states what the package is and what it is for in the words people search; the libphash link points to its site, not its repository.
  • keywords: add near-duplicate, image similarity, ahash, whash, numpy, pillow.
  • PyPI long description and repository description are current: search mirrors of this repository still show 1.10.4-era text ("C library (v1.10.4)", "libpng/spng"). Mirrors (libraries.io, piwheels and the like) refresh from PyPI with the next release.
  • Repository description matches the README's first sentence; topics as broad as libphash's: image-hashing, image-similarity, duplicate-detection, near-duplicate, ahash, dhash, whash, numpy, pillow.

Not in this issue

robots.txt for gudoshnikovn.github.io, Search Console and Bing Webmaster Tools (covering both sites), conda-forge, awesome lists, articles: the epic's work outside the repositories. Measuring: Search Console 4 and 12 weeks after the deploy, recorded on the epic.

The site deploys on a release tag, so the changes ship with the next binding release; the PyPI metadata ships with its wheels.

Activity

  1. gudoshnikovn commented on Oct 16, 2026

    @gudoshnikovn
    OwnerAuthor

    Done in aff808d on feature/seo (for 2.0.2.1, not pushed yet):

    • title and description on all 24 pages, checked by tests/test_docs.py (title ≤ 60, description 120–160, each unique).
    • overrides/main.html (Zensical's theme.custom_dir works in 0.0.68): og:* / twitter:*, a 1200×630 preview (docs/assets/social.png, drawn by tools/social_image.py), JSON-LD WebSite + SoftwareSourceCode on the front page, TechArticle + BreadcrumbList elsewhere; 404 is noindex.
    • Every Algorithm member, the quick start's table (a row per algorithm) and the settings table link libphash's theory pages; loading, batch and examples link Image preparation and Choosing a threshold.
    • Front page and README: installs as python-libphash, imports as libphash, not pHash.org's libphash0.
    • PyPI: Homepage is the site, keywords widened. llms.txt and llms-full.txt through the llmstxt plugin.
    • Repository description and topics updated.

    Left:

  2. self-assigned this
    on Oct 16, 2026
  3. astra-intelligence commented on Oct 16, 2026

    @astra-intelligence

    I implemented the Social previews and structured data section of this epic: PR #18.

    • Zensical extrahead override (overrides/main.html) emitting og:* + twitter:card on every page, with canonical og:url and an absolute 1200x630 og:image.
    • JSON-LD SoftwareSourceCode on the front page and TechArticle on the guide pages.
    • Preview image generated from the site's own hash-grid logo in accent #2a78d6, regenerable via committed tools/site/make-social-preview.py.
    • Verified: strict build passes; all 25 pages emit og:image; JSON-LD parses.

    The per-page title/description front matter and duplicate-description check remain for a follow-up PR.

  4. gudoshnikovn commented on Oct 16, 2026

    @gudoshnikovn
    OwnerAuthor

    Site published from main (0a4d131, Site run 38981416317, by hand): titles, descriptions, OG/Twitter, JSON-LD, llms.txt, the preview image and the 404's noindex are live. No 2.0.2.1 release: the wheels would equal 2.0.2.0's, so the PyPI metadata (Homepage → site, keywords, README) ships with the next release, 2.0.3.0. Still to do: Rich Results Test / OG preview / Lighthouse on the live site, the repository's social preview (by hand), reindexing in Search Console.

  5. gudoshnikovn commented on Oct 18, 2026

    @gudoshnikovn
    OwnerAuthor

    Done: the site is live from main (0a4d131), the manual checks are done (social preview, Search Console, Rich Results). The PyPI metadata (Homepage → site, keywords, README) is in CHANGELOG [Unreleased] and reaches PyPI with 2.0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions