Skip to content

PoC: llms.txt based on page titles and descriptions #714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion site/config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ outputFormats:
baseName: notfound
isHTML: true
mediaType: text/html
llms:
baseName: llms
isHTML: false
mediaType: text/plain

outputs:
home: ["HTML", "navigation", "notfound"]
home: ["HTML", "navigation", "notfound", "llms"]

enableRobotsTXT: true

Expand Down
28 changes: 28 additions & 0 deletions site/themes/arangodb-docs-theme/layouts/_default/home.llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ArangoDB

> ArangoDB is a scalable graph database system to drive value from connected data, faster. Native graphs, an integrated search engine, and JSON support, via a single query language. ArangoDB runs on-prem, in the cloud – anywhere.
{{ range .Site.Sections.ByWeight }}
{{- if eq (.Store.Get "alias") "stable" }}
{{- /* ## Version {{ .Type }} */}}

{{- $pages := .Pages }}
{{- range $pages.ByWeight }}
## {{ .Title | safeHTML }}{{ if .Description }}

{{ replace .Description "\n" " " | safeHTML }}{{ end }}

{{ template "section-tree-llm" . }}
{{- end }}
{{- end }}
{{- end }}

{{- define "section-tree-llm" }}
{{- range .Pages.ByWeight }}
{{- if .Description -}}
- [{{ .Title | safeHTML }}]({{ .Permalink }}):
{{ replace .Description "\n" " " | safeHTML }}

{{ end }}
{{- template "section-tree-llm" . }}
{{- end }}
{{- end }}