Skip to content

Commit eb0e4f0

Browse files
authored
Add command line page and badges (#4)
* Check active pages * Clean unneeded entries from sitemap * Remove duplicate meta description * Cite command line * Improve dark mode
1 parent 9a6c339 commit eb0e4f0

10 files changed

Lines changed: 561 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Supports content-md format for AI Agents](https://contentmd.org/badge.svg)](https://contentmd.org)
2+
13
# Content-md
24

35
[content-md](https://contentmd.org) is an open specification for structuring content to be consumed by AI agents.
@@ -8,8 +10,9 @@ Content-md synthesizes the current practices of structuring the markdown represe
810

911
- **[Documentation](https://contentmd.org)** — Motivation, guides and tutorials
1012
- **[Specification](https://contentmd.org/specification)** — Format details
13+
- **[`contentmd` Command Line](https://contentmd.org/cli)** — Fetch and validate markdown
1114

12-
This repo contains the specification, documentation, and reference guides.
15+
This repo contains the specification, documentation, reference guides, and the Rust command line.
1316

1417
## About
1518

config.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@
2525
return '/' . trimPath($path);
2626

2727
},
28+
29+
'isActive' => function ($page, $path) {
30+
$pagePath = str_replace('\\', '/', trimPath($page->getPath()));
31+
$path = trimPath($path);
32+
33+
if(Str::endsWith($path, '*')){
34+
$path = rtrim($path, '*');
35+
return Str::startsWith($pagePath, $path) || $pagePath === $path;
36+
}
37+
return Str::endsWith($pagePath, $path) || $pagePath === $path;
38+
},
2839
];
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="relative rounded bg-zinc-200 dark:bg-zinc-800 p-3 pr-8 font-mono text-xs text-zinc-900 dark:text-zinc-100 overflow-x-auto agent:hidden" x-data="{ copied: false }" x-bind:data-copied="copied">
2+
<span x-ref="code">{{ $slot }}</span>
3+
<button type="button" @click="navigator.clipboard.writeText($refs.code.innerText.trim()).then(() => { copied = true; setTimeout(() => copied = false, 2000) })" class="absolute hit-area-2 size-6 shrink-0 top-2 right-2 text-zinc-900 dark:text-zinc-100 hover:text-zinc-950 dark:hover:text-white transition-colors" aria-label="Copy to clipboard">
4+
<svg x-show="!copied" class="size-4" aria-hidden="true" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path></svg>
5+
<svg x-show="copied" class="size-4 text-emerald-700 dark:text-emerald-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd"></path></svg>
6+
</button>
7+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="{{ $href }}" @class(['text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button', 'font-bold underline' => $active ?? false]) class="">{{ $slot }}</a>

source/_layouts/main.blade.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<meta property="og:title" content="{{ $page->title ?? $page->siteTitle }}">
3030

3131
<meta property="og:locale" content="en_US">
32-
<meta name="description" content="{{ $page->description ?? $page->siteDescription }}">
3332
<meta property="og:description" content="{{ $page->description ?? $page->siteDescription }}">
3433
<meta property="og:url" content="{{ $page->url($page->getUrl()) }}">
3534
<meta property="og:site_name" content="OneOffTech">
@@ -105,20 +104,22 @@ class="ignore-agent shadow-xl z-50 fixed bottom-3.5 right-3.5 border border-zinc
105104
</a>
106105
<nav class="relative flex items-center gap-6 text-sm agent:flex-col agent:items-start">
107106
<div class="hidden sm:flex items-center gap-6 agent:flex-col agent:flex agent:items-start agent:gap-3">
108-
<a href="/writers" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Write content-md</a>
109-
<a href="/consumers" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Read content-md</a>
110-
<a href="/specification" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Specification</a>
111-
<a href="{{ $page->github }}" target="_blank" rel="noopener noreferrer" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">
107+
<x-nav-link href="/cli" :active="$page->isActive('cli')" >CLI</x-nav-link>
108+
<x-nav-link href="/writers" :active="$page->isActive('writers')">Write</x-nav-link>
109+
<x-nav-link href="/consumers" :active="$page->isActive('consumers')">Read</x-nav-link>
110+
<x-nav-link href="/specification" :active="$page->isActive('specification')">Specification</x-nav-link>
111+
<a href="{{ $page->github }}" target="_blank" rel="noopener" class="text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">
112112
GitHub ↗
113113
</a>
114114
</div>
115115
<details class="sm:hidden agent:hidden">
116116
<summary class="transition-button cursor-pointer">Menu</summary>
117117

118118
<div class="absolute w-60 bg-white dark:bg-zinc-950 shadow z-10 right-0 flex flex-col items-end gap-2 p-4">
119-
<a href="/writers" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Write content-md</a>
120-
<a href="/consumers" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Read content-md</a>
121-
<a href="/specification" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">Specification</a>
119+
<x-nav-link href="/cli" :active="$page->isActive('cli')" >CLI</x-nav-link>
120+
<x-nav-link href="/writers" :active="$page->isActive('writers')">Write</x-nav-link>
121+
<x-nav-link href="/consumers" :active="$page->isActive('consumers')">Read</x-nav-link>
122+
<x-nav-link href="/specification" :active="$page->isActive('specification')">Specification</x-nav-link>
122123
<a href="{{ $page->github }}" target="_blank" rel="noopener noreferrer" class="p-4 text-zinc-600 dark:text-zinc-300 hover:text-zinc-950 dark:hover:text-white transition-button">
123124
GitHub ↗
124125
</a>

source/badge-flat.svg

Lines changed: 14 additions & 0 deletions
Loading

source/badge.svg

Lines changed: 22 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)