Skip to content

Conversation

@davlgd
Copy link
Contributor

@davlgd davlgd commented Sep 13, 2025

This PR adds some features to llms.txt support, to better follow proposal spec:

  • Link to markdown files
  • Add an Optional section (use it with llmsTxtOptional: true in content front matter)

I only link 1st level sections, ordered alphabetically, but feel free to use different rules

@netlify
Copy link

netlify bot commented Sep 13, 2025

Deploy Preview for hugo-hextra ready!

Name Link
🔨 Latest commit c3381f8
🔍 Latest deploy log https://app.netlify.com/projects/hugo-hextra/deploys/68c8f017f74ce700080b57b0
😎 Deploy Preview https://deploy-preview-834--hugo-hextra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@davlgd davlgd force-pushed the davlgd-llmstxt branch 2 times, most recently from 32a5c0c to d823900 Compare September 13, 2025 14:49
@imfing
Copy link
Owner

imfing commented Sep 13, 2025

I believe it’s possible to disable llmstxt on a per-page basis using:
https://gohugo.io/configuration/outputs/#outputs-per-page

Would it also make sense to add documentation for the new Markdown output format?

@davlgd
Copy link
Contributor Author

davlgd commented Sep 13, 2025

I believe it’s possible to disable llmstxt on a per-page basis using: https://gohugo.io/configuration/outputs/#outputs-per-page

I don't filter content but this implementation differs from current as it doesn't add "Root" pages and level 2 sections

Would it also make sense to add documentation for the new Markdown output format?

If this part of implementation is ok for you I can add it

PS : I've added it in a dedicated commit. For fa language, translation is incomplete

Copy link
Owner

@imfing imfing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a few questions. in addtion, given that we are adding param for "optional" content, would it make sense to also support exclude a page / section from llms.txt?

for example:

params:
  llmstxt:
    optional: true # default `false`
    exclude: true  # default `false`

@davlgd davlgd force-pushed the davlgd-llmstxt branch 2 times, most recently from a9bd96e to 46ad9ee Compare September 16, 2025 04:47
@davlgd
Copy link
Contributor Author

davlgd commented Sep 16, 2025

I've removed the title alphabetical sort and "Optional" section when there is no optional content

@davlgd
Copy link
Contributor Author

davlgd commented Sep 16, 2025

have a few questions. in addtion, given that we are adding param for "optional" content, would it make sense to also support exclude a page / section from llms.txt?

for example:

params:
  llmstxt:
    optional: true # default `false`
    exclude: true  # default `false`

Yep, for example you maybe want to exclude blog from such listing to focus on core documentation (it's why there is an optional section at the beginning, to list useful but not mandatory documents).

I've also added an exclude parameter working on a per page/section basis (you can exclude a full section or only a single page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants