# Serving Markdown for AI Agents, Now as a Jekyll Plugin

DevFeed: [Serving Markdown for AI Agents, Now as a Jekyll Plugin](<https://devfeed.tech/articles/serving-markdown-for-ai-agents-now-as-a-jekyll-plugin-55420.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/09/19/serving-markdown-with-a-jekyll-plugin.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-09-19T00:00:00Z

Content type: release

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [Jekyll](<https://devfeed.tech/topics/jekyll.md>), [Markdown](<https://devfeed.tech/topics/markdown.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [GitHub Actions](<https://devfeed.tech/topics/github-actions.md>), [GitHub Pages](<https://devfeed.tech/topics/github-pages.md>), [HTML](<https://devfeed.tech/topics/html.md>), [CSS](<https://devfeed.tech/topics/css.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [github](<https://devfeed.tech/tags/github.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [github-pages](<https://devfeed.tech/tags/github-pages.md>), [html](<https://devfeed.tech/tags/html.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [llms-txt](<https://devfeed.tech/tags/llms-txt.md>), [markdown](<https://devfeed.tech/tags/markdown.md>)

## AI overview

The author introduces jekyll-md, a Jekyll plugin that converts rendered HTML pages to Markdown and adds a discovery link for AI agents. The article explains its configuration and why the author chose a manually curated llms.txt page instead of generating one from every post.

## Source excerpt

Back in January I wrote Serving Markdown for AI Agents: for every page on this blog, there's also a .md version at the same URL, discoverable via a <link rel="alternate" type="text/markdown"> tag, so AI agents can fetch clean Markdown instead of parsing HTML. It also made me $360, via referral conversions an AI agent apparently generated after reading the clean Markdown version of a post. That worked, but it lived in this repo as a one-off script, _scripts/render_markdown.rb, wired into the GitHub Actions deploy workflow (needed since GitHub Pages' native build only allows a small allowlist of plugins, which jekyll-md isn't on), with the <link> tags added by hand via Liquid and a markdown_url front matter field on every page. I've since extracted all of it into jekyll-md, a proper Jekyll plugin. It does the same thing - converts each page's fully rendered HTML output to Markdown and injects the discovery <link> tag - but as a Jekyll::Generator and Jekyll::Hooks, with no external script or per-page front matter required. What Changed Add the gem and enable the plugin: # Gemfile gem 'jekyll-md' # _config.yml plugins: - jekyll-md If you don't configure anything else, jekyll-md looks for <main> or [role="main"] before falling back to the whole <body>, since that's the closest thing HTML has to a content/chrome convention. You can also configure a CSS selector to convert from, e.g. md: selector: "#markdown-content", and other options - see the README for the full list. What About llms.txt? There's a related convention, llms.txt, a single root-level file that's supposed to give an AI agent a curated map of a site. I considered adding llms.txt generation to jekyll-md, then didn't. The spec is explicit that the file should "stay small enough to fit in context" and contrasts itself with sitemap.xml, which it calls out for being too large and unfiltered to be useful. A plugin walking every page and dumping it into llms.txt - which is what some similar plugins do by default -