diff --git a/docs/overrides/main.html b/docs/overrides/main.html index ed5d28a8c..000ff9bec 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -5,6 +5,85 @@ +{# + Structured data (JSON-LD) for SEO. + - Homepage gets WebSite + Organization schema (helps Google show sitelinks and knowledge panel). + - All other pages get BreadcrumbList schema (helps Google show breadcrumb trails in results). + Breadcrumb URLs are resolved via _find_leaf_url because MkDocs nav sections don't have + their own URLs — we use the first descendant page's URL as a proxy. + Dedup by title to collapse nav levels duplicated by plugins (e.g. the blog plugin nests + "Blog" inside "Blog"). The current page is omitted when its title matches the last + ancestor (e.g. /examples/ is both the "Examples" section index and the page itself). +#} +{% macro _find_leaf_url(nav_item) -%} + {%- if nav_item.url -%} + /{{ nav_item.url }} + {%- elif nav_item.children -%} + {{ _find_leaf_url(nav_item.children | first) }} + {%- endif -%} +{%- endmacro %} +{% if page.is_homepage %} + +{% elif page.ancestors | length > 0 %} + +{% endif %} {% endblock %} {% block container %} diff --git a/docs/robots.txt b/docs/robots.txt new file mode 100644 index 000000000..b38b74b55 --- /dev/null +++ b/docs/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://dstack.ai/sitemap.xml diff --git a/mkdocs.yml b/mkdocs.yml index 1f9308451..58c176f3d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -212,7 +212,7 @@ extra: - icon: /fontawesome/brands/discord link: https://discord.gg/u8SmfwPpMd - icon: /simple/x - link: https://twitter.com/dstackai + link: https://x.com/dstackai - icon: /fontawesome/brands/linkedin link: https://www.linkedin.com/company/dstackai status: