Skip to main content

Internal Service: generate_ai_site

Generates all static files for the AI-optimized website.

Function Signature

async def generate_ai_site(
    url: str,
    organize_result: dict,
    scraped_pages: List[dict] = None
) -> dict

Parameters

ParameterTypeDescription
urlstrSource website URL
organize_resultdictResult from organize_with_llm
scraped_pageslistOriginal scraped pages for replicas

Generated Files

FileDescription
index.htmlMain landing page
llms.txtLLM-readable content file
sitemap.xmlXML sitemap
robots.txtRobots directives
data.jsonStructured data
/what-is-*Q&A pages
/pages/*Markdown replica pages

Returns

{
    "status": "success",
    "files": [...],
    "qa_slugs": ["what-is-example", ...],
    "replica_paths": ["/pages/about", ...]
}

Code Location

src/app/shared/ai_website/service.py