Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

3.7 KB
Raw Blame
{# overrides/main.html #}
{% extends "base.html" %}

{# We override the site_meta block (not just extrahead) because Material's base.html
   emits <link rel="canonical"> inside site_meta. If we only added our canonical in
   extrahead, every page would get TWO conflicting canonical tags.

   Why this is needed: site_url is the bare domain (https://docs.pipelex.com/) so that
   mike can properly prefix version paths in sitemaps without creating double paths.
   But we want all canonical URLs to point to /latest/, so we hardcode that prefix here.

   Note: docs/overrides/404.html also overrides this block to emit its own canonical
   (pointing to /latest/ homepage) and suppress the page-specific one. #}

{% block site_meta %}
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  {% if page.meta and page.meta.description %}
    <meta name="description" content="{{ page.meta.description }}">
  {% elif config.site_description %}
    <meta name="description" content="{{ config.site_description }}">
  {% endif %}
  {% if page.meta and page.meta.author %}
    <meta name="author" content="{{ page.meta.author }}">
  {% elif config.site_author %}
    <meta name="author" content="{{ config.site_author }}">
  {% endif %}
  {% set canonical_latest = "https://docs.pipelex.com/latest/" ~ page.url %}
  <link rel="canonical" href="{{ canonical_latest }}">
  {% if page.previous_page %}
    <link rel="prev" href="{{ page.previous_page.url | url }}">
  {% endif %}
  {% if page.next_page %}
    <link rel="next" href="{{ page.next_page.url | url }}">
  {% endif %}
  {% if config.extra.alternate is iterable %}
    {% for alt in config.extra.alternate %}
      <link rel="alternate" href="{{ alt.link | url }}" hreflang="{{ alt.lang }}">
    {% endfor %}
  {% endif %}
{% endblock %}

{% block extrahead %}
{{ super() }}
{% if page %}
{% set canonical_latest = "https://docs.pipelex.com/latest/" ~ page.url %}
{% set desc = page.meta.description if page.meta and page.meta.description else config.site_description %}
{% set title = page.meta.title if page.meta and page.meta.title else page.title %}
{% set img = page.meta.image if page.meta and page.meta.image else "https://d2cinlfp2qnig1.cloudfront.net/docs/pipelex_banner_1200x630.png?v=1" %}
{% set og_type = "website" if page.is_homepage or page.file.url in ('.', './', 'index.html') else "article" %}
<meta property="og:type" content="{{ og_type }}">
<meta property="og:site_name" content="{{ config.site_name }}">
<meta property="og:locale" content="en_US">
<meta property="og:title" content="{{ title }}">
<meta property="og:description" content="{{ desc }}">
<meta property="og:image" content="{{ img }}">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:url" content="{{ canonical_latest }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ title }}">
<meta name="twitter:description" content="{{ desc }}">
<meta name="twitter:image" content="{{ img }}">
{% if page.is_homepage or page.file.url in ('.', './', 'index.html') %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "{{ config.site_name }}",
  "url": "{{ canonical_latest }}",
  "description": "{{ config.site_description }}"
}
</script>
{% else %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "{{ title }}",
  "description": "{{ desc }}",
  "url": "{{ canonical_latest }}",
  "publisher": {
    "@type": "Organization",
    "name": "Pipelex",
    "url": "https://pipelex.com"
  }
}
</script>
{% endif %}
{% endif %}
{% endblock %}