From 6cfc9e9e1ffaa88bdd01846236fb620441c03c3c Mon Sep 17 00:00:00 2001 From: adnano Date: Wed, 23 Sep 2020 14:12:07 -0400 Subject: [PATCH] Use index.gmi for index templates instead of directory.gmi --- README.md | 10 +++++----- kiln.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ff1f10a..d6952bb 100644 --- a/README.md +++ b/README.md @@ -60,10 +60,10 @@ Templates are located in the `templates` directory. There are currently two supported templates: - `page.gmi`: The template used for pages -- `directory.gmi`: The template used for directories +- `index.gmi`: The template used for directory index files If `page.gmi` does not exist, page files will not be created. -If `directory.gmi` does not exist, directory index files will not be created. +If `index.gmi` does not exist, directory index files will not be created. ### Page templates @@ -98,16 +98,16 @@ Content: This is some content. ``` -### Directory templates +### Directory index templates -Directory templates are provided with the following information: +Directory index templates are provided with the following information: - `Path`: Relative path to the directory - `Permalink`: Permalink to the directory - `Pages`: The pages in this directory - `Directories`: The subdirectories of this directory -Directory templates are written to `index.gmi` in the corresponding directory. +Directory index templates are written to `index.gmi` in the corresponding directory. Example: diff --git a/kiln.go b/kiln.go index d22264b..a386ed8 100644 --- a/kiln.go +++ b/kiln.go @@ -81,7 +81,7 @@ func (s *Site) Manipulate(dir *Directory) error { if dir.Index == nil { path := filepath.Join(dir.Path, "index.gmi") builder := &strings.Builder{} - tmpl := s.Templates.Lookup("directory.gmi") + tmpl := s.Templates.Lookup("index.gmi") if err := tmpl.Execute(builder, dir); err != nil { return err }