Helping Organisations get organised!

Changelog

  • 0.6.0: Adds two MCP abilities for drafting a site’s llms.txt. lh-ai-legibility/get-llms-txt returns the document as structured data (summary, details and link sections), the exact /llms.txt it produces, and a check of every link: whether it is a published single post on the site that can be served as Markdown, and optionally whether every other link answers over HTTP. lh-ai-legibility/update-llms-txt replaces the document’s content from plain-text sections and links, building the block markup itself, and returns the same preview and link check; with dry_run nothing is saved. It only writes while the document is not published, and never publishes: a published document is refused, so changes to a live llms.txt are proposed for review through LH Agora instead. Both need manage_options, the same capability as the Settings > LLMs.txt screen. Archive pages (post type, taxonomy, date and author archives and the posts page) are now served as Markdown on request too: a paged list of the page’s posts as links, each with its written excerpt (or a summary another plugin supplies through the new lh_ai_legibility_archive_item_summary filter), with links to the previous and next pages, so llms.txt can point to a whole collection instead of listing it. Archives can be opted out with lh_ai_legibility_archive_markdown_enabled, and their HTML pages now carry the Vary: Accept and Link alternate headers. Section titles and paragraphs in llms.txt no longer show HTML entities such as & for an ampersand.
  • 0.5.1: Brought up to LocalHero plugin standards, with no change to what the plugin does for visitors. The main file now holds an LH_AI_Legibility class with the standard identity methods (namespace, text domain, name, and a version read from the header) and a plugins_loaded bootstrap that can be switched off with the lh_ai_legibility_init_plugin filter; the autoloader and the version, path and URL constants are gone. The post type, query variable and option names are now filterable methods instead of class constants, with the same values as before, so existing llms.txt drafts are kept. Hook names and text domains are derived from the plugin’s namespace and text domain. The llms.txt section block is renamed from llms-txt/section to lh-ai-legibility/section, as block names must use the plugin’s text domain; no published or draft document contained the old block, so no content needed migrating. The Accept header is now sanitised before it is parsed. Activation now loads the .htaccess class itself, so the LiteSpeed cache rule is checked on activation as intended. Code style now follows the WordPress coding standards (array() syntax, translator comment, escaped admin notice), and the phpcs:ignore annotations are removed. The on-disk README.md is removed: readmes are compiled from the plugin header and portfolio entry, and the reconstruction check passed (both formats compile cleanly, the changelog back to 0.1 is in the portfolio, and the filters and document structure are in the doc-sections; the sections on the old built-in converter and file layout were obsolete and dropped).
  • 0.5.0: Keeps Markdown and HTML apart in the LiteSpeed page cache: on a LiteSpeed server the plugin now adds a cache vary rule for Markdown requests to the top of the root .htaccess, on activation and at most once a day from wp-admin on the main site, unless the rule is already there. Without it, LiteSpeed (which ignores Vary: Accept) could serve a cached Markdown version of a page to browsers. Repairs llms.txt, which could not be used before: the draft document is now created the first time an administrator opens wp-admin on each site (activation never ran it for a network-activated plugin), the first document published becomes the site’s document, and lists in the document and links in llms-full.txt no longer cause a fatal error. In llms-full.txt, pages on the same site now follow the same rules as Markdown requests (password-protected, private and opted-out pages are left out) and come from the same template region, and pages on other sites are cached for 12 hours, or an hour if the fetch failed, and limited to 1 MB. Password-protected posts are now never served as Markdown, even to a visitor who has entered the password. The excerpt in the Markdown front matter is now included only when one has been written, without the theme’s read-more link.
  • 0.4.3: The Markdown version of a post now comes from the block template that actually displays it, including templates registered by plugins. It previously looked only for the theme’s single-{post type} template, so a plugin’s own template (such as LH Meetings’ single meeting template) was missed unless it had been customised in the Site Editor, and the Markdown fell back to the post content alone. The region marked lh-md-content is now found through LH Content Converter’s shared document-region resolver (2.3.0 or later), which resolves the template as WordPress does; with an older converter the previous lookup is used.
  • 0.4.2: Now requires PHP 8.2, matching LH Content Converter, which this plugin requires and which needs PHP 8.2 for its bundled conversion library. No change to how the plugin works.
  • 0.4.1: Markdown serving now uses LH Content Converter, the renamed LH Markdown Converter, which is now the required plugin. Where a post type has a block template, the Markdown is now built from the same template region as the HTML page (the block marked lh-md-content, rendered with the post’s own context so block bindings resolve), so the two versions cannot drift apart; post types without a block template still use the post content as before. The plugin header now declares its requirements (WordPress 6.5, PHP 8.1), links to its documentation, and has a shorter description, and the version is read from the header.
  • 0.4: Markdown serving now uses the shared LH Markdown Converter plugin instead of this plugin’s own regex-based converter, with no autolinks and no hard breaks. LH Markdown Converter is now a required plugin. The old built-in converter class is no longer used.
  • 0.3: Added the missing index.php guard files to the plugin root and its includes and blocks directories.
  • 0.2: Bug fixes. Markdown and llms.txt responses now send their public Cache-Control header directly instead of conflicting with nocache headers. YAML front matter no longer wrongly escapes single quotes. Em-dash separators in llms.txt list items are handled without corrupting UTF-8. Image alt text is kept whatever order the attributes appear in. A missing return after the fallback response was added.
  • 0.1: Initial release. Singular posts and pages are served as Markdown with YAML front matter when requested with Accept: text/markdown. An llms.txt document type, limited to one published document, generates /llms.txt and /llms-full.txt, edited in the block editor with a dedicated section block and a restricted inserter. Includes a built-in HTML to Markdown converter.

If you like this plugin please consider making a donation to further development