Mity Docs Mity Docs for Mity Digital
llms.txt for Statamic Documentation

Options

llms.txt for Statamic is ready to use after installation with no further required configuration.

But we all do have some preferences for our Bard editor, right?

If you want to make changes to the Bard editor that llms.txt uses, or adjust caching behaviour, publish the config file:

1php artisan vendor:publish --tag=statamic-llms-txt-config

This will publish the config file to config/statamic-llms-txt.php. Look at this file - we've included comments throughout to help make it easy for you to understand how to use each option too.

Convert URLs to Entries New

If you include an absolute URL in the content, the addon will attempt to rewrite this as a reference to the Statamic entry (if it can find an Entry).

If it can't find it as an Entry, no changes are made.

urls

Optionally set an array of URLs to watch.

The purpose for this is if you're working locally (i.e. a .test domain) and you have your llms.txt provided (by an author, AI, etc) and that has absolute links in it, the addon will attempt to rewrite these links to Entry relationships in Statamic.

This means that your llms.txt becomes more accurate as pages change - especially if your authors like to move URLs around - rather than linking to full absolute URLs all the time.

Your APP_URL is automatically included.

Set additional domains:

1'convert_urls_to_entries' => [
2 'urls' => [
3 'https://www.my-prod-domain.com'
4 ],
5],

In this example, if you create an absolute link to an Entry on my-prod-domain.com, and you're still running locally on your .test domain, the addon will attempt to rewrite the URL as a reference to the Statamic Entry. If your page is renamed, your llms.txt gets updated.

enabled

Set this to false to disable this feature.

Content

The Content options all adjust the behaviour of the Bard field used when editing your llms.txt file.

You can use the link_collections config option to choose which Collections are linkable from the anchor component of the Bard editor.

1'link_collections' => [
2 'pages',
3 'blog',
4],

This will only list Entries in the Pages or Blog Collections when browsing for Entries to link to.

You can set this to null to allow all Collections to be available. This is the default.

toolbar_mode

Your llms.txt may get long - and some like a lean floating toolbar, and others like fixed. This setting lets you choose which you prefer.

1// for a fixed toolbar
2'toolbar_mode' => 'fixed',
3 
4// for a floating toolbar
5'toolbar_mode' => 'floating',

Cache

Caching your llms.txt can help prevent it being rendered on each request. By default this is enabled, and uses your site's default cache driver.

enabled

Pretty self explanatory: set to true to enable the cache, or false to disable caching.

Default: true

duration

The life of the cache, in minutes, or set to null to remember forever.

Default: null

key

The key used for caching.

Default: mitydigital-statamic-llms-txt