aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/generate-authors.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-17 16:31:53 -0400
committertdro <tdro@noreply.example.com>2022-06-17 16:31:53 -0400
commita7e31ec150c409c3c4a9bd8a6503dda852a2d103 (patch)
tree718c023e875c08fe9b0b4f0814d8538b09db5d96 /themes/default/layouts/partials/generate-authors.html
parent494ee6f4b0d708c20ed66d946b727159cf90f1c4 (diff)
downloadcanory-a7e31ec150c409c3c4a9bd8a6503dda852a2d103.tar.gz
canory-a7e31ec150c409c3c4a9bd8a6503dda852a2d103.tar.bz2
canory-a7e31ec150c409c3c4a9bd8a6503dda852a2d103.zip
config: Generate authors from configuration
Diffstat (limited to 'themes/default/layouts/partials/generate-authors.html')
-rw-r--r--themes/default/layouts/partials/generate-authors.html70
1 files changed, 70 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/generate-authors.html b/themes/default/layouts/partials/generate-authors.html
new file mode 100644
index 0000000..8e2081f
--- /dev/null
+++ b/themes/default/layouts/partials/generate-authors.html
@@ -0,0 +1,70 @@
+{{- range .Site.Author.list -}}
+
+ {{- if not (fileExists (print "data/" . ".yaml")) -}}
+
+ {{- $configuration := resources.Get "templates/author.yaml" -}}
+ {{- $configuration := resources.ExecuteAsTemplate
+ (print "/data/generates/authors/" . ".yaml")
+ (dict
+ "Name" (title .)
+ "User" .
+ )
+ $configuration
+ -}}
+ {{- $writeToFile := $configuration.RelPermalink -}}
+
+ {{- end -}}
+
+ {{- $markdown := resources.Get "templates/markdown-frontmatter.yaml" -}}
+
+ {{- $template := resources.ExecuteAsTemplate
+ (print "/data/generates/content/" . "/" "_index.md")
+ (dict
+ "author" .
+ "layout" "section"
+ )
+ $markdown
+ -}}
+ {{- $writeToFile := $template.RelPermalink -}}
+
+ {{- $template := resources.ExecuteAsTemplate
+ (print "/data/generates/content/" . "/feeds/" "_index.md")
+ (dict
+ "author" .
+ "layout" "feeds"
+ )
+ $markdown
+ -}}
+ {{- $writeToFile := $template.RelPermalink -}}
+
+ {{- $template := resources.ExecuteAsTemplate
+ (print "/data/generates/content/" . "/media/" "_index.md")
+ (dict
+ "author" .
+ "layout" "media"
+ )
+ $markdown
+ -}}
+ {{- $writeToFile := $template.RelPermalink -}}
+
+ {{- $template := resources.ExecuteAsTemplate
+ (print "/data/generates/content/" . "/likes/" "_index.md")
+ (dict
+ "author" .
+ "layout" "likes"
+ )
+ $markdown
+ -}}
+ {{- $writeToFile := $template.RelPermalink -}}
+
+ {{- $template := resources.ExecuteAsTemplate
+ (print "/data/generates/content/" . "/drafts/" "_index.md")
+ (dict
+ "author" .
+ "layout" "drafts"
+ )
+ $markdown
+ -}}
+ {{- $writeToFile := $template.RelPermalink -}}
+
+{{- end -}}