"""سئوی سمت سرور — robots.txt، sitemap.xml، llms.txt و سرو همهٔ صفحات با متای تزریقی. فرانت‌اند یک SPA است؛ خزنده‌های جست‌وجو و شبکه‌های اجتماعی جاوااسکریپت اجرا نمی‌کنند. این ماژول همان index.html بیلد فرانت‌اند را می‌خواند و پیش از ارسال، تگ‌های title / description / canonical / OG / hreflang / JSON-LD را از دیتابیس داخل آن تزریق می‌کند — بازدیدکننده‌های عادی همان SPA همیشگی را می‌بینند و خزنده‌ها متای درست را در HTML اولیه می‌خوانند. (اسکیمای صفحه داخل ') if org_jsonld: payload = json.dumps(org_jsonld, ensure_ascii=False).replace("{payload}') block = "\n ".join(tags) raw = _read_index() if raw is None: # بیلد فرانت‌اند سوار نشده — صفحه حداقلی با خودِ متا تا خزنده‌ها دست خالی نمانند lang_attr = 'lang="en" dir="ltr"' if lang == "en" else 'lang="fa" dir="rtl"' body = f"

{esc(title)}

{esc(description)}

" return HTMLResponse( f'' f"{esc(title)}{alternates}{block}{body}", status_code=status_code, ) # اسکیمای Organization مینیمالِ پوستهٔ استاتیک حذف می‌شود تا با نسخهٔ غنی تزریقی تکراری نشود if org_jsonld: raw = re.sub(r'', "", raw, count=1) if lang == "en": # پوسته بیلدشده فارسی است — برای نسخه انگلیسی جهت، زبان و برند سند عوض می‌شود raw = re.sub(r']*>', '', raw, count=1) raw = raw.replace(FALLBACK_FA_BRAND, FALLBACK_EN_BRAND) # description استاتیک حذف می‌شود تا با متای تزریقی تکراری نشود raw = re.sub(r']*/>\s*', '', raw, count=1) # og:locale — در پوسته استاتیک به‌روز می‌شود و از بلوک تزریقی حذف تا دوباره نوشته نشود og_locale = "en_US" if lang == "en" else "fa_IR" if re.search(r'.*?", f"{esc(title)}", raw, count=1, flags=re.S) raw = raw.replace("", f" {alternates}\n {block}\n ", 1) if noscript: raw = raw.replace("", f"\n ", 1) return HTMLResponse(raw, status_code=status_code) # ---------- موجودیت‌های ساخت‌یافته (JSON-LD) ---------- def _brand_row(db: Session) -> models.Brand | None: return db.query(models.Brand).first() def _brand_name(db: Session, lang: str = "fa") -> str: brand = _brand_row(db) if brand is None: return FALLBACK_EN_BRAND if lang == "en" else FALLBACK_FA_BRAND if lang == "en": return brand.name_en or brand.name or FALLBACK_EN_BRAND return brand.name or FALLBACK_FA_BRAND def _page_meta(db: Session, page_key: str) -> models.SeoMeta | None: return db.query(models.SeoMeta).filter(models.SeoMeta.page_key == page_key).first() def _meta_for(db: Session, page_key: str, lang: str) -> tuple[str, str]: """عنوان و توضیح سئوی یک صفحه به زبان درخواستی — با برگشت به فارسی.""" meta = _page_meta(db, page_key) if meta is None: return "", "" if lang == "en": return meta.title_en or meta.title or "", meta.description_en or meta.description or "" return meta.title or "", meta.description or "" def _meta_desc_for(article: models.Article, lang: str) -> str: """توضیح سئوی مقاله به زبان درخواستی — توضیح اختصاصی در اولویت، چکیده در برگشت.""" if lang == "en": return (article.meta_description_en or article.meta_description or article.excerpt_en or article.excerpt or "").strip() return (article.meta_description or article.excerpt or "").strip() def _org_jsonld(db: Session, lang: str) -> dict: """اسکیمای Organization — روی همهٔ صفحات تزریق می‌شود (موجودیت برند سایت). فقط داده‌های واقعی: لوگو، شبکه‌های اجتماعی فوتر و تماس ثبت‌شده در پنل.""" brand = _brand_row(db) org: dict = { "@context": "https://schema.org", "@type": "Organization", "name": _brand_name(db, lang), } if settings.site_url: org["url"] = _absolute("/") logo = (brand.logo or "").strip() if brand else "" if logo: org["logo"] = _absolute(logo) footer = db.query(models.FooterContent).first() socials = [] if footer is not None: socials = (footer.socials_en if lang == "en" and footer.socials_en else footer.socials) or [] same_as: list[str] = [] for item in socials if isinstance(socials, list) else []: if isinstance(item, dict): href_ = (item.get("href") or "").strip() if href_.startswith("http") and href_ not in same_as: same_as.append(href_) if same_as: org["sameAs"] = same_as phone = (brand.phone or "").strip() if brand else "" if phone: org["contactPoint"] = [ {"@type": "ContactPoint", "contactType": "customer service", "telephone": phone} ] email = (brand.email or "").strip() if brand else "" if email: org["email"] = email return org def _localbusiness_jsonld(db: Session, lang: str, path: str) -> dict | None: """اسکیمای GeneralContractor از دفاتر ثبت‌شده — برای صفحه‌های تماس و درباره.""" offices = db.query(models.Office).order_by(models.Office.position, models.Office.id).all() if not offices: return None brand = _brand_row(db) business: dict = { "@context": "https://schema.org", "@type": "GeneralContractor", "name": _brand_name(db, lang), "url": _absolute(path), } phone = (brand.phone or "").strip() if brand else "" if phone: business["telephone"] = phone email = (brand.email or "").strip() if brand else "" if email: business["email"] = email addresses: list[dict] = [] areas: list[str] = [] for office in offices: city = ((office.city_en or office.city) if lang == "en" else office.city).strip() street = ((office.address_en or office.address) if lang == "en" else office.address).strip() address: dict = {"@type": "PostalAddress", "addressCountry": "IR"} if street: address["streetAddress"] = street if city: address["addressLocality"] = city areas.append(city) addresses.append(address) business["address"] = addresses[0] if len(addresses) == 1 else addresses if areas: business["areaServed"] = sorted(set(areas)) return business def _breadcrumb_jsonld(items: list[tuple[str, str]]) -> dict: """اسکیمای BreadcrumbList — متناظر با مسیر بطری بصری صفحه.""" return { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ {"@type": "ListItem", "position": i + 1, "name": name, "item": _absolute(url)} for i, (name, url) in enumerate(items) ], } def _faq_entities(faqs: object, lang: str = "fa", faqs_en: object = None) -> list[dict]: """ساخت mainEntity اسکیمای FAQPage از ردیف‌های [{question, answer}].""" rows = faqs if isinstance(faqs, list) else [] if lang == "en": rows_en = faqs_en if isinstance(faqs_en, list) else None if rows_en: rows = rows_en entities = [] for item in rows: if isinstance(item, dict): question = (item.get("question") or "").strip() answer = (item.get("answer") or "").strip() if question and answer: entities.append( {"@type": "Question", "name": question, "acceptedAnswer": {"@type": "Answer", "text": answer}} ) return entities def _faq_page_jsonld(db: Session, lang: str) -> dict | None: """اسکیمای FAQPage صفحهٔ پرسش‌وپاسخ — از موجودیت faqs. (گوگل از اردیبهشت ۱۴۰۵ نتیجهٔ غنی FAQ برای همهٔ سایت‌ها برداشت؛ این اسکیما برای موتورهای هوش مصنوعی است که پرسش‌وپاسخ ساخت‌یافته را مستقیم می‌خوانند.)""" rows = db.query(models.Faq).order_by(models.Faq.position, models.Faq.id).all() entities = _faq_entities( [{"question": f.question, "answer": f.answer} for f in rows], lang, [{"question": f.question_en, "answer": f.answer_en} for f in rows], ) if not entities: return None return {"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": entities} def _article_jsonld(article: models.Article, lang: str, db: Session) -> dict: """اسکیمای Article — با نویسنده (Person در صورت ثبت نام)، تاریخ انتشار و ناشر.""" brand = _brand_name(db, lang) title = (article.title_en or article.title) if lang == "en" else article.title en_slug = ((article.slug_en or "").strip() or article.slug) if lang == "en" else article.slug author_name = ((article.author_en or "").strip() or (article.author or "").strip()) if lang == "en" else (article.author or "").strip() publisher: dict = {"@type": "Organization", "name": brand} brand_row = _brand_row(db) logo = (brand_row.logo or "").strip() if brand_row else "" if logo: publisher["logo"] = {"@type": "ImageObject", "url": _absolute(logo)} schema: dict = { "@context": "https://schema.org", "@type": "Article", "headline": title, "description": _meta_desc_for(article, lang), "inLanguage": lang, "author": {"@type": "Person", "name": author_name} if author_name else {"@type": "Organization", "name": brand}, "publisher": publisher, "mainEntityOfPage": _absolute(f"/blog/{article.slug}" if lang == "fa" else f"/en/blog/{en_slug}"), } image = _absolute(article.image) if (article.image or "").strip() else "" if image: schema["image"] = image published = _parse_site_date(article.date_en if lang == "en" else article.date) or _parse_site_date(article.date) if published: schema["datePublished"] = published return schema def _nav_label(db: Session, href: str, lang: str) -> str: """برچسب فارسی/انگلیسی یک مسیر از ناوبری — برای پیش‌فرض عنوان و بردکرامب.""" nav = db.query(models.NavItem).filter(models.NavItem.href == href).first() if nav is None: return "" return ((nav.label_en or nav.label) if lang == "en" else nav.label or "").strip() # ---------- robots.txt و sitemap.xml و llms.txt ---------- @router.get("/robots.txt", response_class=Response) def robots(db: Session = Depends(get_db)): # پیش‌نمایش خصوصی — هیچ خزنده‌ای نباید چیزی ذخیره کند if settings.preview_mode: return Response( content="User-agent: *\nDisallow: /\n", media_type="text/plain; charset=utf-8", ) lines = ["User-agent: *", "Disallow: /admin", "Disallow: /api", ""] # سیاست صریح خزنده‌های هوش مصنوعی — ربات‌های جست‌وجو/ارجاع آزادند تا محتوا # در پاسخ‌های ChatGPT/Claude/Perplexity/Gemini ارجاع شود for bot in AI_SEARCH_BOTS: lines += [f"User-agent: {bot}", "Allow: /", ""] # خزندهٔ تهاجمی با سود کم lines += ["User-agent: Bytespider", "Disallow: /", ""] if settings.site_url: lines.append(f"Sitemap: {_absolute('/sitemap.xml')}") return Response(content="\n".join(lines), media_type="text/plain; charset=utf-8") def _static_has_en(db: Session, page_key: str) -> bool: """آیا صفحهٔ استاتیک ترجمهٔ انگلیسی واقعی دارد؟ (متای سئوی انگلیسی ثبت شده باشد)""" meta = _page_meta(db, page_key) return bool( meta and ((meta.title_en or "").strip() or (meta.description_en or "").strip()) ) @router.get("/sitemap.xml", response_class=Response) def sitemap(db: Session = Depends(get_db)): # پیش‌نمایش خصوصی — نقشه سایت خالی تا هیچ نشانی‌ای اعلام نشود if settings.preview_mode: xml = ( '\n' '\n' ) return Response(content=xml, media_type="application/xml; charset=utf-8") esc = html.escape articles = { a.slug: a for a in db.query(models.Article) .filter(models.Article.status == "published") .order_by(models.Article.position, models.Article.id) .all() } projects = { p.slug: p for p in db.query(models.Project).order_by(models.Project.position, models.Project.id).all() } def entry(loc: str, lang: str, has_en: bool) -> str: pairs = _alternate_pairs(loc, lang, has_en) links = "\n".join( f' ' for code, href_ in pairs ) return f" {esc(_absolute(loc))}\n{links}\n " urls: list[str] = [] # صفحات استاتیک فارسی + معادل‌های انگلیسیِ ترجمه‌شده for path in STATIC_PATHS: page_key = "home" if path == "/" else path.strip("/") has_en = _static_has_en(db, page_key) urls.append(entry(path, "fa", has_en)) if has_en: urls.append(entry(_en_path(path), "en", True)) # مقاله‌ها و پروژه‌ها — alternate انگلیسی فقط با وجود ترجمهٔ واقعی for slug, article in articles.items(): fa_path = f"/blog/{slug}" has_en = _article_has_en(article) urls.append(entry(fa_path, "fa", has_en)) if has_en: urls.append(entry(_en_path(fa_path), "en", True)) for slug, project in projects.items(): fa_path = f"/projects/{slug}" has_en = _project_has_en(project) urls.append(entry(fa_path, "fa", has_en)) if has_en: urls.append(entry(_en_path(fa_path), "en", True)) xml = ( '\n' '\n' f"{chr(10).join(urls)}\n\n" ) return Response(content=xml, media_type="application/xml; charset=utf-8") @router.get("/llms.txt", response_class=Response) def llms_txt(db: Session = Depends(get_db)): """راهنمای سایت برای دستیارهای هوش مصنوعی — برند، واقعیت‌های کلیدی و صفحه‌های اصلی. در حالت پیش‌نمایش خصوصی ۴۰۴ می‌دهد تا ساختار سایت بیرون درز نکند.""" if settings.preview_mode: return Response(status_code=404) brand = _brand_name(db, "en") _, home_desc = _meta_for(db, "home", "en") lines = [ f"# {brand}", f"> {_clip(home_desc or 'Construction group — engineering, contracting and property investment.', 200)}", "", ] services = [ (s.title_en or s.title).strip() for s in db.query(models.Service).order_by(models.Service.position, models.Service.id).all() if (s.title_en or s.title).strip() ] offices = db.query(models.Office).order_by(models.Office.position, models.Office.id).all() cities = [ (o.city_en or o.city).strip() for o in offices if (o.city_en or o.city).strip() ] facts = [] if services: facts.append(f"- Services: {', '.join(services)}") if cities: facts.append(f"- Offices: {', '.join(sorted(set(cities)))}") facts.append("- Languages: Persian at / and English at /en") lines += ["## Key Facts", *facts, ""] lines.append("## Pages") for page_key, label in [ ("home", "Home"), ("about", "About"), ("services", "Services"), ("projects", "Projects"), ("blog", "Blog"), ("faq", "FAQ"), ("contact", "Contact"), ]: title, description = _meta_for(db, page_key, "en") if page_key == "home": url = "/" else: url = f"/en/{page_key}" if page_key != "projects" else "/en/projects" summary = _clip(description, 100) lines.append(f"- [{label}]({_absolute(url)}): {summary or label}") featured_projects = ( db.query(models.Project).order_by(models.Project.position, models.Project.id).limit(6).all() ) if featured_projects: lines += ["", "## Featured Projects"] for p in featured_projects: title = (p.title_en or p.title).strip() summary = _clip(p.summary_en or p.summary, 100) lines.append(f"- [{title}]({_absolute('/en/projects/' + p.slug)}): {summary}") latest = ( db.query(models.Article) .filter(models.Article.status == "published") .order_by(models.Article.position, models.Article.id) .limit(6) .all() ) if latest: lines += ["", "## Recent Articles"] for a in latest: title = (a.title_en or a.title).strip() summary = _clip(a.excerpt_en or a.excerpt, 100) lines.append(f"- [{title}]({_absolute('/en/blog/' + a.slug)}): {summary}") brand_row = _brand_row(db) contact_lines = [] if brand_row and (brand_row.phone or "").strip(): contact_lines.append(f"- Phone: {brand_row.phone.strip()}") if brand_row and (brand_row.email or "").strip(): contact_lines.append(f"- Email: {brand_row.email.strip()}") for o in offices: city = (o.city_en or o.city).strip() street = ((o.address_en or o.address) or o.address).strip() if city or street: contact_lines.append(f"- Office: {_clip(street + ('، ' + city if city and street else city), 120)}") if contact_lines: lines += ["", "## Contact", *contact_lines] return Response(content="\n".join(lines) + "\n", media_type="text/plain; charset=utf-8") # ---------- صفحات استاتیک فارسی ---------- def _static_shell(db: Session, *, path: str, page_key: str, lang: str = "fa") -> HTMLResponse: """پوستهٔ صفحات استاتیک — متا از seo_meta، اسکیمای اختصاصی هر صفحه.""" title, description = _meta_for(db, page_key, lang) brand = _brand_name(db, lang) if not title: # عنوان پیش‌فرض از برچسب ناوبری همان صفحه label = _nav_label(db, f"/{page_key}", lang) title = f"{label} | {brand}" if label else brand jsonld: list[dict] = [] if page_key == "faq": faq_schema = _faq_page_jsonld(db, lang) if faq_schema: jsonld.append(faq_schema) elif page_key in ("contact", "about"): business = _localbusiness_jsonld(db, lang, path) if business: jsonld.append(business) return _shell( title=title, description=description, path=path, lang=lang, has_en=_static_has_en(db, page_key), jsonld=jsonld or None, org_jsonld=_org_jsonld(db, lang), ) @router.get("/", response_class=HTMLResponse) def home(db: Session = Depends(get_db)): return _static_shell(db, path="/", page_key="home") @router.get("/about", response_class=HTMLResponse) def about_page(db: Session = Depends(get_db)): return _static_shell(db, path="/about", page_key="about") @router.get("/services", response_class=HTMLResponse) def services_page(db: Session = Depends(get_db)): return _static_shell(db, path="/services", page_key="services") @router.get("/investment", response_class=HTMLResponse) def investment_page(db: Session = Depends(get_db)): return _static_shell(db, path="/investment", page_key="investment") @router.get("/faq", response_class=HTMLResponse) def faq_page(db: Session = Depends(get_db)): return _static_shell(db, path="/faq", page_key="faq") @router.get("/contact", response_class=HTMLResponse) def contact_page(db: Session = Depends(get_db)): return _static_shell(db, path="/contact", page_key="contact") # ---------- صفحات وبلاگ ---------- @router.get("/blog", response_class=HTMLResponse) def blog_list(db: Session = Depends(get_db)): return _static_shell(db, path="/blog", page_key="blog") @router.get("/blog/{slug}", response_class=HTMLResponse) def blog_detail(slug: str, db: Session = Depends(get_db)): article = ( db.query(models.Article) .filter(models.Article.slug == slug, models.Article.status == "published") .first() ) if article is None: # مقاله ناموجود یا پیش‌نویس — کد وضعیت ۴۰۴ تا خزنده صفحه را ایندکس نکند؛ # SPA همان پیام «یافت نشد» را نشان می‌دهد return _shell( title=_brand_name(db), description="", path=f"/blog/{slug}", org_jsonld=_org_jsonld(db, "fa"), status_code=404, ) brand = _brand_name(db) title = article.title first_text = _doc_text(article.body) if not isinstance(article.body, list) else " ".join(article.body[:2]) faq_schema = _faq_jsonld(article, "fa") breadcrumb = _breadcrumb_jsonld([ (_nav_label(db, "/", "fa") or "خانه", "/"), (_nav_label(db, "/blog", "fa") or "وبلاگ", "/blog"), (title, f"/blog/{article.slug}"), ]) jsonld: list[dict] = [_article_jsonld(article, "fa", db), breadcrumb] if faq_schema: jsonld.append(faq_schema) noscript = f"

{html.escape(title)}

{html.escape(first_text)}

" return _shell( title=f"{title} | {brand}", description=_meta_desc_for(article, "fa"), path=f"/blog/{article.slug}", has_en=_article_has_en(article), og_image=article.image, og_image_alt=article.image_alt or title, og_type="article", jsonld=jsonld, org_jsonld=_org_jsonld(db, "fa"), noscript=noscript, ) def _faq_jsonld(article: models.Article, lang: str) -> dict | None: """اسکیمای FAQPage از پرسش‌وپاسخ‌های پایان مقاله.""" entities = _faq_entities(article.faqs, lang, article.faqs_en) if not entities: return None return {"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": entities} # ---------- صفحات پروژه ---------- @router.get("/projects", response_class=HTMLResponse) def projects_list(db: Session = Depends(get_db)): return _static_shell(db, path="/projects", page_key="projects") @router.get("/projects/{slug}", response_class=HTMLResponse) def project_detail(slug: str, db: Session = Depends(get_db)): project = db.query(models.Project).filter(models.Project.slug == slug).first() if project is None: return _shell( title=_brand_name(db), description="", path=f"/projects/{slug}", org_jsonld=_org_jsonld(db, "fa"), status_code=404, ) brand = _brand_name(db) jsonld = [ { "@context": "https://schema.org", "@type": "WebPage", "name": project.title, "description": project.summary, "image": _absolute(project.image), "inLanguage": "fa", }, _breadcrumb_jsonld([ (_nav_label(db, "/", "fa") or "خانه", "/"), (_nav_label(db, "/projects", "fa") or "پروژه‌ها", "/projects"), (project.title, f"/projects/{project.slug}"), ]), ] return _shell( title=f"{project.title} | {brand}", description=project.summary, path=f"/projects/{project.slug}", has_en=_project_has_en(project), og_image=project.image, og_image_alt=project.title, jsonld=jsonld, org_jsonld=_org_jsonld(db, "fa"), ) # ---------- صفحات انگلیسی (/en/...) ---------- def _en_blog_detail(article: models.Article, db: Session) -> HTMLResponse: brand = _brand_name(db, "en") title = article.title_en or article.title body = article.body_en if isinstance(article.body_en, dict) else article.body first_text = _doc_text(body) if not isinstance(body, list) else " ".join(body[:2]) faq_schema = _faq_jsonld(article, "en") breadcrumb = _breadcrumb_jsonld([ (_nav_label(db, "/", "en") or "Home", "/"), (_nav_label(db, "/blog", "en") or "Blog", "/en/blog"), (title, f"/en/blog/{(article.slug_en or '').strip() or article.slug}"), ]) jsonld: list[dict] = [_article_jsonld(article, "en", db), breadcrumb] if faq_schema: jsonld.append(faq_schema) noscript = f"

{html.escape(title)}

{html.escape(first_text)}

" return _shell( title=f"{title} | {brand}", description=_meta_desc_for(article, "en"), path=f"/en/blog/{(article.slug_en or '').strip() or article.slug}", lang="en", has_en=_article_has_en(article), og_image=article.image, og_image_alt=article.image_alt or title, og_type="article", jsonld=jsonld, org_jsonld=_org_jsonld(db, "en"), noscript=noscript, ) @router.get("/en", response_class=HTMLResponse) @router.get("/en/", response_class=HTMLResponse) def en_home(db: Session = Depends(get_db)): return _static_shell(db, path="/en", page_key="home", lang="en") @router.get("/en/blog", response_class=HTMLResponse) def en_blog_list(db: Session = Depends(get_db)): return _static_shell(db, path="/en/blog", page_key="blog", lang="en") @router.get("/en/blog/{slug}", response_class=HTMLResponse) def en_blog_detail_route(slug: str, db: Session = Depends(get_db)): article = ( db.query(models.Article) .filter( (models.Article.slug_en == slug) | ((models.Article.slug_en == "") & (models.Article.slug == slug)), models.Article.status == "published", ) .first() ) if article is None: return _shell( title=_brand_name(db, "en"), description="", path=f"/en/blog/{slug}", lang="en", org_jsonld=_org_jsonld(db, "en"), status_code=404, ) return _en_blog_detail(article, db) @router.get("/en/projects", response_class=HTMLResponse) def en_projects_list(db: Session = Depends(get_db)): return _static_shell(db, path="/en/projects", page_key="projects", lang="en") @router.get("/en/projects/{slug}", response_class=HTMLResponse) def en_project_detail(slug: str, db: Session = Depends(get_db)): project = db.query(models.Project).filter(models.Project.slug == slug).first() if project is None: return _shell( title=_brand_name(db, "en"), description="", path=f"/en/projects/{slug}", lang="en", org_jsonld=_org_jsonld(db, "en"), status_code=404, ) brand = _brand_name(db, "en") title = project.title_en or project.title summary = project.summary_en or project.summary jsonld = [ { "@context": "https://schema.org", "@type": "WebPage", "name": title, "description": summary, "image": _absolute(project.image), "inLanguage": "en", }, _breadcrumb_jsonld([ (_nav_label(db, "/", "en") or "Home", "/"), (_nav_label(db, "/projects", "en") or "Projects", "/en/projects"), (title, f"/en/projects/{project.slug}"), ]), ] return _shell( title=f"{title} | {brand}", description=summary, path=f"/en/projects/{project.slug}", lang="en", has_en=_project_has_en(project), og_image=project.image, og_image_alt=title, jsonld=jsonld, org_jsonld=_org_jsonld(db, "en"), ) @router.get("/en/{path:path}", response_class=HTMLResponse) def en_page(path: str, db: Session = Depends(get_db)): """بقیه مسیرهای انگلیسی (about، services، ...) — متا از seo_meta به انگلیسی. مسیرهای ناشناخته ۴۰۴ می‌گیرند — پوستهٔ ۲۰۰ با عنوان برند، خطای soft-404 است.""" page_key = path.split("/")[0] if path else "" if page_key not in META_KEYS: return _shell( title=_brand_name(db, "en"), description="", path=f"/en/{path}".rstrip("/"), lang="en", org_jsonld=_org_jsonld(db, "en"), status_code=404, ) return _static_shell(db, path=f"/en/{path}".rstrip("/"), page_key=page_key, lang="en")