From e2a487c3cd24589b9d9bd298b79d8efaa9914480 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 30 Sep 2026 10:41:00 +0200 Subject: feat(hub): search title, description, canonical and noscript in the shell A descriptive , a two-line meta description apart from the short one messengers get, "/" canonical for every shell path, and a <noscript> pitch with the download and doc links for crawlers that do not run app.js. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- packages/meshbay-hub/src/meshbay_hub/api/webapp.py | 33 ++++++++++++++++++++-- .../meshbay-hub/tests/test_asset_versioning.py | 5 +++- packages/meshbay-hub/tests/test_site_basics.py | 33 ++++++++++++++++++++++ 3 files changed, 67 insertions(+), 4 deletions(-) (limited to 'packages/meshbay-hub') diff --git a/packages/meshbay-hub/src/meshbay_hub/api/webapp.py b/packages/meshbay-hub/src/meshbay_hub/api/webapp.py index c9cb8d5..1d3bc7e 100644 --- a/packages/meshbay-hub/src/meshbay_hub/api/webapp.py +++ b/packages/meshbay-hub/src/meshbay_hub/api/webapp.py @@ -164,11 +164,20 @@ async def index(): # square icon, which is the shape a thumbnail is cut to anyway. PREVIEW_DESCRIPTION = "Your files stay at home. Reach them from anywhere." +# What a search engine shows under the link: two lines, about 150 characters, +# so it can say what the preview has no room for. welcome.lead, shortened. +SEARCH_TITLE = "MeshBay — private, encrypted sharing from your own computer" +SEARCH_DESCRIPTION = ("Your photos, music, videos and conversations stay on your " + "own computer. MeshBay lets you reach them from anywhere " + "and share them with the people you choose.") + def _preview_tags(hub_id: str) -> str: origin = html.escape(f"https://{hub_id}", quote=True) return f"""\ - <meta name="description" content="{PREVIEW_DESCRIPTION}"> + <meta name="description" content="{SEARCH_DESCRIPTION}"> + <!-- "/" and every /app/* path serve this same shell: one URL for all. --> + <link rel="canonical" href="{origin}/"> <meta property="og:type" content="website"> <meta property="og:site_name" content="MeshBay"> <meta property="og:title" content="MeshBay"> @@ -203,13 +212,31 @@ _HTML = """\ Ignored by browsers that do not know it. --> <meta name="viewport" content="width=device-width, initial-scale=1, interactive-widget=resizes-content"> - <title>MeshBay + {title} {preview}
+ +