Files
hugo-PaperMod/layouts/llms.txt
T
Aditya Telange 87de3fb024 Implement new template system added with Hugo v0.146.0 (#1858)
* feat(layouts): move all files in layouts/_default up to the layouts/ root.

* feat(layouts): rename layouts/partials folder to layouts/_partials

* feat(layouts): rename layouts/shortcodes folder to layouts/_shortcodes

* feat(taxonomy): add new taxonomy layout template

A template named taxonomy.html used to be a candidate for both Page kind term and taxonomy, now it’s only considered for taxonomy.
2026-05-02 21:25:30 +05:30

42 lines
1.2 KiB
Plaintext

{{- /* Recursive printer for sections */ -}}
{{- define "llms_print_section" -}}
{{- $section := .section -}}
{{- $depth := .depth -}}
{{- if or (gt (len $section.RegularPages) 0) (gt (len $section.Sections) 0) -}}
{{- $hashes := strings.Repeat (add $depth 1) "#" }}
{{ printf "%s %s" $hashes $section.Title }}
{{- /* Pages in this section */ -}}
{{- range $p := $section.RegularPages }}
{{- if and (not $p.Params.searchHidden) (ne $p.Layout `archives`) (ne $p.Layout `search`) }}
- [{{ $p.Title }}]({{ $p.Permalink }})
{{- end -}}
{{- end -}}
{{- /* Recurse into subsections */ -}}
{{- range $s := $section.Sections -}}
{{- template "llms_print_section" (dict "section" $s "depth" (add $depth 1)) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- /* Main template starts here */ -}}
# {{ site.Title }}
{{- /* Pages not in any section */ -}}
{{- $orphans := where site.RegularPages "Section" "" -}}
{{ if gt (len $orphans) 0 }}
{{- range $p := $orphans -}}
{{ if and (not $p.Params.searchHidden) (ne $p.Layout `archives`) (ne $p.Layout `search`) (not $p.IsHome) }}
- [{{ $p.Title }}]({{ $p.Permalink }})
{{- end -}}
{{- end -}}
{{- end -}}
{{- range site.Sections -}}
{{- template "llms_print_section" (dict "section" . "depth" 1) -}}
{{- end }}