Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

5.2 KB
Raw Blame
{% extends "base.njk" %}

{%- set postUrl = site.origin + (page.url | u) -%}
{%- set tocItems = content | toc -%}
{%- set catLabel = categoryLabel or category or "Notes" -%}
{%- set authorName = (author.name if author else site.author.name) -%}
{%- set authorInitials = (author.initials if author and author.initials else "MD") -%}
{%- set heroOg = false if ogImage else (page.fileSlug | heroOg) -%}
{%- set kw = keywords or ((primaryKeyword + ", " + (secondaryKeywords | join(", "))) if primaryKeyword else (tags | join(", "))) -%}

{% block head %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": {{ title | dump | safe }},
  "description": {{ (description or site.description) | dump | safe }},
  "image": [{{ (ogImage or ((site.origin + heroOg.path) if heroOg else site.defaultOgImage)) | dump | safe }}],
  "datePublished": "{{ page.date | isoDate }}",
  "dateModified": "{{ (updated | isoDate) if updated else (page.date | isoDate) }}",
  "author": { "@type": "Person", "name": {{ authorName | dump | safe }} },
  "publisher": {
    "@type": "Organization",
    "name": "Munder Difflin",
    "logo": { "@type": "ImageObject", "url": "{{ site.origin }}/logo.png" }
  },
  "mainEntityOfPage": { "@type": "WebPage", "@id": "{{ postUrl }}" },
  "keywords": {{ kw | dump | safe }},
  "articleSection": {{ catLabel | dump | safe }},
  "inLanguage": "en-US",
  "url": "{{ postUrl }}"
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    { "@type": "ListItem", "position": 1, "name": "Home", "item": "{{ site.origin }}/" },
    { "@type": "ListItem", "position": 2, "name": "Blog", "item": "{{ site.baseUrl }}" },
    { "@type": "ListItem", "position": 3, "name": {{ title | dump | safe }}, "item": "{{ postUrl }}" }
  ]
}
</script>
{% if faq %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {% for item in faq %}{ "@type": "Question", "name": {{ item.q | dump | safe }}, "acceptedAnswer": { "@type": "Answer", "text": {{ item.a | dump | safe }} } }{% if not loop.last %},{% endif %}
    {% endfor %}
  ]
}
</script>
{% endif %}
{% endblock %}

{% block content %}
<article class="t-{{ (category | slug) if category else 'default' }}">
  <header class="post-head wrap">
    <nav class="crumbs" aria-label="Breadcrumb">
      <a href="{{ '/' | u }}">Blog</a>
      <span>/</span>
      <a href="{{ ('/topics/' + (category | slug) + '/') | u }}">{{ catLabel }}</a>
    </nav>
    <h1>{{ title }}</h1>
    {% if description %}<p class="dek">{{ description }}</p>{% endif %}
    <div class="byline">
      <span class="av" aria-hidden="true">{{ authorInitials }}</span>
      <strong>{{ authorName }}</strong>
      <span class="dot" aria-hidden="true">·</span>
      <time datetime="{{ page.date | htmlDate }}">{{ page.date | readableDate }}</time>
      <span class="dot" aria-hidden="true">·</span>
      <span>{{ content | readingTime }} min read</span>
      <span class="tag kind">{{ catLabel }}</span>
    </div>
  </header>

  <div class="hero-wrap wrap">{% hero page.fileSlug %}</div>

  <div class="post-wrap wrap">
    <div class="prose">
      {{ content | safe }}

      {% if faq %}
      <section class="faq" aria-label="Frequently asked questions">
        <h2 id="faq">FAQ</h2>
        {% for item in faq %}
        <div class="qa">
          <p class="q">{{ item.q }}</p>
          <p class="a">{{ item.a }}</p>
        </div>
        {% endfor %}
      </section>
      {% endif %}

      {% if tags and tags.length %}
      <hr />
      <div class="share">
        <span class="lbl">Tags</span>
        {% for tag in tags %}<a class="tag" href="{{ ('/tags/' + (tag | slug) + '/') | u }}">{{ tag }}</a>{% endfor %}
      </div>
      {% endif %}
    </div>

    {% if tocItems.length > 2 %}
    <aside class="toc-rail" aria-label="Table of contents">
      <div class="tt">On this page</div>
      <ol>
        {% for h in tocItems %}<li class="lvl-{{ h.level }}"><a href="#{{ h.id }}">{{ h.text }}</a></li>{% endfor %}
      </ol>
    </aside>
    {% endif %}
  </div>

  <footer class="post-foot wrap">
    {%- set posts = collections.posts -%}
    {%- set idx = null -%}
    {%- for p in posts -%}{%- if p.url == page.url -%}{% set idx = loop.index0 %}{%- endif -%}{%- endfor -%}
    {%- set newer = posts[idx - 1] if idx > 0 else null -%}
    {%- set older = posts[idx + 1] if idx < (posts.length - 1) else null -%}
    <div class="prevnext">
      {% if older %}<a class="pn prev" href="{{ older.url | u }}"><span class="k">← Older</span><span class="t">{{ older.data.title }}</span></a>{% else %}<span></span>{% endif %}
      {% if newer %}<a class="pn next" href="{{ newer.url | u }}"><span class="k">Newer →</span><span class="t">{{ newer.data.title }}</span></a>{% else %}<span></span>{% endif %}
    </div>

    {%- set related = collections.posts | relatedPosts(page.url, category, 3) -%}
    {% if related.length %}
    <section class="related">
      <h2>Related in {{ catLabel }}</h2>
      <div class="post-grid">
        {% for p in related %}{% include "card.njk" %}{% endfor %}
      </div>
    </section>
    {% endif %}
  </footer>
</article>
{% endblock %}