mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 22:11:12 +00:00
feat(website): improve search reach and complete 27 language editions (#16783)
* feat(website): lead search metadata with the REA tagline Search results showed a generic homepage description, and rea.tools did not rank for its own name, "Reverse Engineer Anything". - Homepage title and description lead with "Reverse engineer anything, reimagine everything" in plain language, and the hero shows the tagline. - Guide hub and first investigation titles match "how to reverse engineer an app with AI" searches. - The English homepage publishes WebSite and SoftwareApplication structured data naming REA and "Reverse Engineer Anything", linked to GitHub, npm and X. - The npm package homepage points to https://rea.tools. - Translations of the changed messages keep 19 language homepages indexable. * fix(website): match local search terms and list rea.tools in the MCP registry Japanese and French coverage of REA uses なんでもリバースエンジニアリング and rétro-ingénierie, so the new titles and descriptions use the same terms. The MCP registry websiteUrl now points to https://rea.tools instead of the repository. * fix(website): say the AI agent understands software, and repair blog descriptions The homepage description now says REA lets your AI agent understand how any app, game or website works, translated for 19 editions. The blog index description had machine-translation errors in 8 languages, including Arabic rendering AI as Amnesty International; those are corrected. * fix(website): rewrite Vietnamese translations for clarity Replace machine-translated Vietnamese with natural wording across every page: consistent terms for coding agent, case study, prompt and file, correct breadcrumbs and number formats, and readable case studies, guides and essays. * fix(website): align translated titles and coding-agent terms End translated titles with the same " — REA" separator as English, use the established coding-agent term in German, Thai and Arabic, and fix the French get-started title. * feat(website): describe page breadcrumbs for search results Search engines can show a page's place on the site (rea.tools > Guides > ...) instead of a bare URL. The trail is read from each built page's visible breadcrumb, so every language edition gets its own translated names. * feat(website): add beginner and Ghidra/IDA guides and complete all 27 editions New pages for people searching for reverse engineering itself: "What is reverse engineering?", "Reverse engineering with AI" and "Use Ghidra or IDA with an AI agent", linked from the homepage and guides. The FAQ answers where to get REA safely, whether it is free, how it differs from a Ghidra or IDA MCP server, whether it recovers source code and whether reverse engineering is legal. Case-study, browser and dinosaur pages get titles that match what people search for, and the case-study index leads with "REA Examples". Every translation was reviewed and largely rewritten where it was machine translated, including wrong word senses, broken placeholders and, in Thai, unrelated text. Malayalam, Roman Urdu, Romanian and Bulgarian are now complete, and Hindi, Dutch and Bengali are new editions with READMEs. All 26 catalogs are fully translated, so no page falls back to English. * fix(website): read breadcrumbs with an HTML parser and correct IDA support Breadcrumb structured data now finds the trail by its class with an HTML-aware parser, so extra classes, attribute order and line breaks no longer drop a valid breadcrumb. The Ghidra and IDA guide no longer promises callers or byte reads through IDA, which no IDA profile provides; it suggests cross-references instead. The example prompt is engine-neutral, the terminal example says how to select IDA, and the ida-free-mcp choice warns that its 1.1.2 release accepts connections from other computers until a firewall or a local-only build restricts it.
This commit is contained in:
1 parent
baa7871e07
commit
ca66ab63ba
83 files changed
+199704
-95030
No files matched your search
@@ -4,6 +4,7 @@ from io import BytesIO
|
||||
from pathlib import Path
|
||||
import json
|
||||
import sys
|
||||
from urllib.parse import urljoin
|
||||
import xml.etree.ElementTree as ET
|
||||
from zipfile import ZipFile
|
||||
|
||||
@@ -83,6 +84,52 @@ def prepare_notes_example(site):
|
||||
print(f"Prepared examples/notes-example.zip ({len(EXAMPLE_FILES)} files).")
|
||||
|
||||
|
||||
def site_identity(description):
|
||||
"""Name the site and the product for search engines on the English homepage only."""
|
||||
root = f"{SITE_ORIGIN}/"
|
||||
return [
|
||||
{
|
||||
"@type": "WebSite", "url": root,
|
||||
"name": "REA", "alternateName": ["Reverse Engineer Anything", "rea.tools"],
|
||||
},
|
||||
{
|
||||
"@type": "SoftwareApplication", "url": root,
|
||||
"name": "REA", "alternateName": "Reverse Engineer Anything",
|
||||
"description": description,
|
||||
"applicationCategory": "DeveloperApplication",
|
||||
"operatingSystem": "macOS, Linux, Windows",
|
||||
"license": "https://opensource.org/license/mit",
|
||||
"offers": {"@type": "Offer", "price": "0", "priceCurrency": "USD"},
|
||||
"sameAs": [
|
||||
"https://github.com/morluto/rea",
|
||||
"https://www.npmjs.com/package/rea-agents",
|
||||
"https://x.com/reatools",
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def breadcrumb_list(source, url):
|
||||
"""Describe the page's visible breadcrumb trail, in its own language, for search results."""
|
||||
from bs4 import BeautifulSoup, SoupStrainer
|
||||
trail = BeautifulSoup(source, "html.parser", parse_only=SoupStrainer("p", class_=lambda value: value is not None and "breadcrumb" in str(value).split())).p
|
||||
links = trail.find_all("a", href=True) if trail else []
|
||||
if not links:
|
||||
return None
|
||||
following = "".join(
|
||||
node.get_text() if hasattr(node, "get_text") else str(node) for node in links[-1].next_siblings
|
||||
)
|
||||
current = " ".join(following.split()).lstrip("/ ").strip()
|
||||
if not current:
|
||||
return None
|
||||
items = [{"name": " ".join(link.get_text().split()), "item": urljoin(url, link["href"])} for link in links]
|
||||
items.append({"name": current})
|
||||
return {
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [{"@type": "ListItem", "position": n, **item} for n, item in enumerate(items, 1)],
|
||||
}
|
||||
|
||||
|
||||
def prepare_search_images(site):
|
||||
from bs4 import BeautifulSoup
|
||||
for path in site.rglob("*.html"):
|
||||
@@ -93,16 +140,22 @@ def prepare_search_images(site):
|
||||
continue
|
||||
url = fields["og:url"]
|
||||
data = {
|
||||
"@context": "https://schema.org", "@type": "WebPage", "url": url,
|
||||
"@type": "WebPage", "url": url,
|
||||
"name": fields["og:title"], "inLanguage": head.html["lang"],
|
||||
"primaryImageOfPage": fields["og:image"],
|
||||
}
|
||||
breadcrumb = breadcrumb_list(source, url)
|
||||
if breadcrumb:
|
||||
data["breadcrumb"] = breadcrumb
|
||||
if fields["og:type"] == "article":
|
||||
data["mainEntity"] = {
|
||||
"@type": "BlogPosting", "headline": fields["og:title"],
|
||||
"description": fields["og:description"], "image": fields["og:image"],
|
||||
"mainEntityOfPage": url,
|
||||
}
|
||||
if url == f"{SITE_ORIGIN}/":
|
||||
data = {"@graph": [data, *site_identity(fields["og:description"])]}
|
||||
data = {"@context": "https://schema.org", **data}
|
||||
payload = json.dumps(data, ensure_ascii=False).replace("<", "\\u003c")
|
||||
path.write_text(source.replace("</head>", f'<script type="application/ld+json">{payload}</script>\n </head>', 1), encoding="utf-8")
|
||||
|
||||
|
||||
@@ -546,6 +546,24 @@ class WebsiteMaintenanceChecks(unittest.TestCase):
|
||||
self.assertIn("https://rea.tools/blog/new-example/", (site / "sitemap.xml").read_text())
|
||||
self.assertEqual(VERIFY.check_site(site)[3], [])
|
||||
|
||||
def test_breadcrumb_data_follows_the_visible_trail_in_any_html_form(self):
|
||||
url = "https://rea.tools/vi/showcase/ctf/"
|
||||
expected = [
|
||||
{"@type": "ListItem", "position": 1, "name": "Trang chủ", "item": "https://rea.tools/vi/"},
|
||||
{"@type": "ListItem", "position": 2, "name": "Nghiên cứu", "item": "https://rea.tools/vi/showcase/"},
|
||||
{"@type": "ListItem", "position": 3, "name": "CTF flag checker"},
|
||||
]
|
||||
for trail in (
|
||||
'<p class="breadcrumb"><a href="../../">Trang chủ</a> / <a href="../">Nghiên cứu</a> / CTF flag checker</p>',
|
||||
'<p id="trail" class="page breadcrumb">\n <a href="../../">Trang\n chủ</a>\n /\n <a class="x" href="../">Nghiên cứu</a>\n / CTF <em>flag</em>\n checker\n</p>',
|
||||
):
|
||||
with self.subTest(trail=trail):
|
||||
data = PREPARE.breadcrumb_list(f"<html><body><main>{trail}</main></body></html>", url)
|
||||
self.assertEqual(data["itemListElement"], expected)
|
||||
for page in ("<p>No trail</p>", '<p class="breadcrumb">Draft</p>', '<p class="breadcrumb"><a href="../">Home</a></p>'):
|
||||
with self.subTest(page=page):
|
||||
self.assertIsNone(PREPARE.breadcrumb_list(page, url))
|
||||
|
||||
def test_links_in_prompts_fragments_and_copy_controls_are_verified(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
site = Path(directory) / "public"
|
||||
|
||||
Reference in new issue
Block a user