aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/generate-authors.html
blob: 61cc5a67964e9f7a068b133eb48ed10f848b8722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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.Permalink -}}

  {{- end -}}

  {{- $markdown := resources.Get "templates/markdown-frontmatter.yaml" -}}

  {{- $template := resources.ExecuteAsTemplate
     (print "/data/generates/content/" . "/" "_index.md")
     (dict
      "author" .
      "layout" "section"
     )
     $markdown
  -}}
  {{- $writeToFile := $template.Permalink -}}

  {{- $template := resources.ExecuteAsTemplate
     (print "/data/generates/content/" . "/feeds/" "_index.md")
     (dict
      "author" .
      "layout" "section.feeds"
     )
     $markdown
  -}}
  {{- $writeToFile := $template.Permalink -}}

  {{- $template := resources.ExecuteAsTemplate
     (print "/data/generates/content/" . "/media/" "_index.md")
     (dict
      "author" .
      "layout" "section.media"
     )
     $markdown
  -}}
  {{- $writeToFile := $template.Permalink -}}

  {{- $template := resources.ExecuteAsTemplate
     (print "/data/generates/content/" . "/likes/" "_index.md")
     (dict
      "author" .
      "layout" "section.likes"
     )
     $markdown
  -}}
  {{- $writeToFile := $template.Permalink -}}

  {{- $template := resources.ExecuteAsTemplate
     (print "/data/generates/content/" . "/drafts/" "_index.md")
     (dict
      "author" .
      "layout" "section.drafts"
     )
     $markdown
  -}}
  {{- $writeToFile := $template.Permalink -}}

{{- end -}}