mirror of
https://github.com/imfing/hextra.git
synced 2025-08-23 10:07:11 -04:00

* feat(llms): add llms txt output format - Introduced a new output format 'llms' in the configuration. - Updated the example site to utilize the new 'llms' format for the home output. - Added a new layout file 'llms.txt' for rendering content in the LLMS format. * docs: add llms.txt support documentation - Introduced a new section in the configuration guide detailing how to enable the llms.txt output format for improved accessibility to large language models. - Provided example configuration for adding the 'llms' output format in the site's hugo.yaml. - Explained the content structure of the generated llms.txt file, including site title, section listings, page summaries, and direct links. * Update configuration.md
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
# {{ .Site.Title }}
|
|
|
|
> {{ .Site.Params.description }}
|
|
|
|
{{ range $section := site.Sections }}
|
|
{{- template "llms-section-tree" dict "context" . "level" 2 }}
|
|
{{ end }}
|
|
|
|
{{- $rootPages := where site.RegularPages "Section" "" }}
|
|
{{- if $rootPages }}
|
|
|
|
## Root Pages
|
|
{{- range $rootPages }}
|
|
- [{{ .Title }}]({{ .Permalink }}): {{ .Summary | plainify | truncate 100 | strings.TrimSpace }}{{ if .Date }} - Published {{ .Date.Format "2006-01-02" }}{{ end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
---
|
|
Generated on {{ now.Format "2006-01-02 15:04:05 UTC" }}
|
|
Site: {{ .Site.BaseURL }}
|
|
|
|
{{- define "llms-section-tree" -}}
|
|
{{- $context := .context -}}
|
|
{{- $level := .level | default 2 -}}
|
|
{{- $headerHashes := strings.Repeat $level "#" -}}
|
|
{{- "\n" -}}
|
|
{{ $headerHashes }} {{ $context.Title }}
|
|
|
|
{{- range $context.RegularPages }}
|
|
- [{{ .Title }}]({{ .Permalink }}): {{ .Summary | plainify | truncate 100 | strings.TrimSpace }}{{ if .Date }} - Published {{ .Date.Format "2006-01-02" }}{{ end }}
|
|
{{- end }}
|
|
|
|
{{- range $context.Sections }}
|
|
{{ template "llms-section-tree" dict "context" . "level" (add $level 1) }}
|
|
{{- end }}
|
|
{{- end -}}
|