From a6cd7954455ae921e88a49280809811a1d0c4a35 Mon Sep 17 00:00:00 2001
From: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Date: Fri, 15 May 2026 01:53:19 +0000
Subject: [PATCH] docs: show use of custom outputs
---
README.md | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/README.md b/README.md
index c3c2586..f7ad9c7 100644
--- a/README.md
+++ b/README.md
@@ -57,8 +57,46 @@
* [Customisation](https://ananke-documentation.netlify.app/customisation/)
* [Troubleshooting](https://ananke-documentation.netlify.app/troubleshooting/)
+## Custom outputs
+
+Ananke does not require theme changes for Hugo custom outputs. Define the output format in your site configuration and add the matching layout file to your site. Hugo resolves project layouts before theme layouts, so the custom output can live outside the theme.
+
+For example, this configuration adds a `SearchIndex` JSON output for the home page:
+
+```toml
+[mediaTypes."application/json"]
+suffixes = ["json"]
+
+[outputFormats.SearchIndex]
+mediaType = "application/json"
+baseName = "index"
+isPlainText = true
+notAlternative = true
+
+[outputs]
+home = ["HTML", "RSS", "SearchIndex"]
+```
+
+Then add a matching layout in your site at `layouts/index.searchindex.json`:
+
+```go-html-template
+{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections -}}
+[
+{{- range $index, $page := $pages }}
+ {{- if $index }},{{ end }}
+ {
+ "title": {{ $page.Title | jsonify }},
+ "permalink": {{ $page.RelPermalink | jsonify }},
+ "summary": {{ $page.Summary | plainify | jsonify }}
+ }
+{{- end }}
+]
+```
+
+This produces `/index.json` while keeping Ananke's default HTML and RSS output intact.
+
## Support and Contributions
* Bug reports: [GitHub Issues](https://github.com/gohugo-ananke/ananke/issues)
* Questions and feature ideas: [GitHub Discussions](https://github.com/gohugo-ananke/ananke/discussions)
-* Contribution guide: [CONTRIBUTING.md](CONTRIBUTING.md)
+* Contribution guide: [CONTRIBUTING.md](CONTRIBUTING.md)
\ No newline at end of file
--
Gitblit v1.10.0