|
3 | 3 | {# |
4 | 4 | SEO and AEO head additions for the TRACE conformance suite. |
5 | 5 |
|
6 | | - 1. The homepage <title> is overridden. Material falls back to site_name when a |
7 | | - page has no front-matter title, which left the homepage titled "TRACE |
8 | | - Tests". Front matter is not an option: docs_dir is the repository root, so |
9 | | - README.md is also the GitHub landing page and YAML would render as noise |
10 | | - there. |
| 6 | + Title: Material appends " - TRACE Tests" to every page title and uses the |
| 7 | + front-matter title on the home page. The home page now uses that title alone, |
| 8 | + and a title that already names the site gets no suffix. Open Graph and |
| 9 | + Twitter use the same title string. An earlier comment here described a |
| 10 | + homepage title override that did not exist; this block is that override. |
11 | 11 |
|
12 | | - 2. Open Graph and Twitter meta, so links produce a card instead of a bare URL, |
13 | | - plus JSON-LD so answer engines can model what this suite is. |
| 12 | + JSON-LD: one AgenTrust Organization node under the hub's @id, the WebSite, |
| 13 | + and a node for the page itself (WebPage on the home page, TechArticle |
| 14 | + elsewhere) carrying its own title, description and canonical URL. Inner pages |
| 15 | + add a BreadcrumbList; the home page adds the SoftwareApplication node for the |
| 16 | + agentrust-trace-tests package. Page descriptions come from hooks/seo.py when |
| 17 | + the front matter has none. |
14 | 18 |
|
15 | 19 | Asset paths derive from config.site_url. Do not hardcode them: assets are |
16 | 20 | served under /docs/assets/ here because docs_dir is the repository root and |
17 | | - CI copies docs/ into the build directory. That differs between sibling |
18 | | - repositories, and a hardcoded path is how cMCP shipped a broken card. |
| 21 | + CI copies docs/ into the build directory. |
19 | 22 | #} |
20 | 23 |
|
| 24 | +{% block htmltitle %} |
| 25 | + {%- set t = page.meta.title if page and page.meta and page.meta.title else (page.title | striptags if page and page.title and not page.is_homepage else "") -%} |
| 26 | + {%- if not t %} |
| 27 | + <title>{{ config.site_name }}</title> |
| 28 | + {%- elif (page and page.is_homepage) or config.site_name in t %} |
| 29 | + <title>{{ t }}</title> |
| 30 | + {%- else %} |
| 31 | + <title>{{ t }} - {{ config.site_name }}</title> |
| 32 | + {%- endif %} |
| 33 | +{% endblock %} |
| 34 | + |
21 | 35 | {% block extrahead %} |
22 | 36 | {{ super() }} |
23 | | - {# page.title is the nav label ("Home"); page.meta.title is the front matter. #} |
24 | | - {% set page_name = (page.meta.title if page and page.meta and page.meta.title else (page.title if page else None)) %} |
25 | | - {% set page_desc = page.meta.description if page and page.meta and page.meta.description else config.site_description %} |
26 | | - {% set page_url = page.canonical_url if page and page.canonical_url else config.site_url %} |
27 | | - {% set og_image = config.site_url ~ 'docs/assets/og.png' %} |
28 | | - {% set social_title = 'Verify your TRACE implementation' %} |
| 37 | + {%- set t = page.meta.title if page and page.meta and page.meta.title else (page.title | striptags if page and page.title and not page.is_homepage else "") -%} |
| 38 | + {%- set is_home = page and page.is_homepage -%} |
| 39 | + {%- set page_title = config.site_name if not t else (t if is_home or config.site_name in t else t ~ " - " ~ config.site_name) -%} |
| 40 | + {%- set page_desc = page.meta.description if page and page.meta and page.meta.description else config.site_description -%} |
| 41 | + {%- set page_url = page.canonical_url if page and page.canonical_url else config.site_url %} |
29 | 42 |
|
30 | 43 | <meta property="og:type" content="website"> |
31 | | - <meta property="og:site_name" content="{{ config.site_name }}"> |
32 | | - <meta property="og:title" content="{% if page_name %}{{ page_name }} - {{ config.site_name }}{% else %}{{ config.site_name }}: {{ social_title }}{% endif %}"> |
33 | | - <meta property="og:description" content="{{ page_desc }}"> |
| 44 | + <meta property="og:site_name" content="AgenTrust"> |
| 45 | + <meta property="og:title" content="{{ page_title | e }}"> |
| 46 | + <meta property="og:description" content="{{ page_desc | e }}"> |
34 | 47 | <meta property="og:url" content="{{ page_url }}"> |
35 | | - <meta property="og:image" content="{{ og_image }}"> |
| 48 | + <meta property="og:image" content="{{ config.site_url }}docs/assets/og.png"> |
36 | 49 | <meta property="og:image:width" content="1200"> |
37 | 50 | <meta property="og:image:height" content="630"> |
38 | 51 | <meta property="og:image:alt" content="TRACE Tests: the AgenTrust conformance suite"> |
39 | 52 | <meta property="og:locale" content="en_US"> |
40 | | - |
41 | 53 | <meta name="twitter:card" content="summary_large_image"> |
42 | | - <meta name="twitter:title" content="{% if page_name %}{{ page_name }} - {{ config.site_name }}{% else %}{{ config.site_name }}: {{ social_title }}{% endif %}"> |
43 | | - <meta name="twitter:description" content="{{ page_desc }}"> |
44 | | - <meta name="twitter:image" content="{{ og_image }}"> |
| 54 | + <meta name="twitter:title" content="{{ page_title | e }}"> |
| 55 | + <meta name="twitter:description" content="{{ page_desc | e }}"> |
| 56 | + <meta name="twitter:image" content="{{ config.site_url }}docs/assets/og.png"> |
45 | 57 |
|
46 | 58 | <script type="application/ld+json"> |
47 | 59 | { |
48 | 60 | "@context": "https://schema.org", |
49 | 61 | "@graph": [ |
50 | | - { |
51 | | - "@type": "SoftwareApplication", |
52 | | - "name": "TRACE Tests", |
53 | | - "applicationCategory": "DeveloperApplication", |
54 | | - "description": "Conformance tests and an integration harness for TRACE records. It reports which conformance level a record reaches and checks the shape of attestation fields, not the attestation itself.", |
55 | | - "url": "{{ config.site_url }}", |
56 | | - "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }, |
57 | | - "author": { "@type": "Organization", "name": "AgenTrust", "url": "https://agentrust-io.com" }, |
58 | | - "isPartOf": { "@type": "WebSite", "name": "{{ config.site_name }}", "url": "{{ config.site_url }}" } |
59 | | - }, |
60 | 62 | { |
61 | 63 | "@type": "Organization", |
| 64 | + "@id": "https://agentrust-io.com/#organization", |
62 | 65 | "name": "AgenTrust", |
63 | | - "url": "https://agentrust-io.com", |
| 66 | + "url": "https://agentrust-io.com/", |
64 | 67 | "sameAs": [ |
65 | 68 | "https://github.com/agentrust-io", |
66 | | - "https://agentrust-io.com/demos/", |
67 | 69 | "https://trace.agentrust-io.com", |
68 | | - "https://cmcp.agentrust-io.com", |
69 | 70 | "https://manifest.agentrust-io.com", |
70 | | - "https://ca2a.agentrust-io.com" |
| 71 | + "https://cmcp.agentrust-io.com", |
| 72 | + "https://ca2a.agentrust-io.com", |
| 73 | + "https://wcm.agentrust-io.com", |
| 74 | + "https://tests.agentrust-io.com", |
| 75 | + "https://governance.agentrust-io.com" |
71 | 76 | ] |
72 | 77 | }, |
73 | 78 | { |
74 | 79 | "@type": "WebSite", |
75 | | - "name": "{{ config.site_name }}", |
76 | | - "url": "{{ config.site_url }}" |
| 80 | + "@id": {{ (config.site_url ~ "#website") | tojson }}, |
| 81 | + "name": {{ config.site_name | tojson }}, |
| 82 | + "url": {{ config.site_url | tojson }}, |
| 83 | + "description": {{ config.site_description | tojson }}, |
| 84 | + "publisher": { "@id": "https://agentrust-io.com/#organization" } |
| 85 | + }, |
| 86 | + { |
| 87 | + "@type": {{ ("WebPage" if is_home else "TechArticle") | tojson }}, |
| 88 | + "@id": {{ (page_url ~ "#page") | tojson }}, |
| 89 | + "url": {{ page_url | tojson }}, |
| 90 | + "name": {{ page_title | tojson }}, |
| 91 | + "headline": {{ page_title | tojson }}, |
| 92 | + "description": {{ page_desc | tojson }}, |
| 93 | + "inLanguage": "en", |
| 94 | + "isPartOf": { "@id": {{ (config.site_url ~ "#website") | tojson }} }, |
| 95 | + "publisher": { "@id": "https://agentrust-io.com/#organization" } |
| 96 | + } |
| 97 | + {%- if is_home %}, |
| 98 | + { |
| 99 | + "@type": "SoftwareApplication", |
| 100 | + "name": "TRACE Tests", |
| 101 | + "alternateName": "agentrust-trace-tests", |
| 102 | + "description": "Conformance tests and an integration harness for TRACE records. It reports which conformance level a record reaches and checks the shape of attestation fields, not the attestation itself.", |
| 103 | + "applicationCategory": "DeveloperApplication", |
| 104 | + "operatingSystem": "Cross-platform", |
| 105 | + "url": {{ config.site_url | tojson }}, |
| 106 | + "downloadUrl": "https://pypi.org/project/agentrust-trace-tests/", |
| 107 | + "codeRepository": {{ config.repo_url | tojson }}, |
| 108 | + "license": "https://www.apache.org/licenses/LICENSE-2.0", |
| 109 | + "author": { "@id": "https://agentrust-io.com/#organization" }, |
| 110 | + "publisher": { "@id": "https://agentrust-io.com/#organization" }, |
| 111 | + "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" } |
| 112 | + } |
| 113 | + {%- elif page and page.canonical_url %}, |
| 114 | + { |
| 115 | + "@type": "BreadcrumbList", |
| 116 | + "itemListElement": [ |
| 117 | + { "@type": "ListItem", "position": 1, "name": {{ config.site_name | tojson }}, "item": {{ config.site_url | tojson }} }, |
| 118 | + { "@type": "ListItem", "position": 2, "name": {{ (t or page_title) | tojson }}, "item": {{ page_url | tojson }} } |
| 119 | + ] |
77 | 120 | } |
| 121 | + {%- endif %} |
78 | 122 | ] |
79 | 123 | } |
80 | 124 | </script> |
|
0 commit comments