25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

113 satır
3.9 KiB

  1. {{ $currentNode := . }}
  2. {{ $debug := (slice) }}
  3. {{ $pPath := "" }}
  4. {{ range $p := .Site.RegularPages }}
  5. {{ $pPath = printf "/%s" $p.File }}
  6. {{ $pageDir := "" }}
  7. {{ with $p.File }}
  8. {{ $pageDir = (substr .Dir 0 -1)}}
  9. {{ end }}
  10. {{ $gp := $.GetPage $pPath }}
  11. {{ $gpPath := printf "/%s" $gp.File }}
  12. {{ range $k, $v := $gp.Params }}
  13. {{ with in $k "has_" }}
  14. {{ $s := index (split $k "has_") 1 }}
  15. {{ range $sin,$plur := $currentNode.Site.Data.sandpointsnamegraph }}
  16. {{ if eq $s $plur }}
  17. {{ range index $gp.Params $k }}
  18. {{ $cp := $.GetPage (printf "/%s/%s" $sin .) }}
  19. {{ $cpPath := printf "/%s" $cp.File }}
  20. {{ range $kcp, $vcp := $cp.Params }}
  21. {{ with in $kcp "has_" }}
  22. {{ $scp := index (split $kcp "has_") 1 }}
  23. {{ range $sincp,$plurcp := $currentNode.Site.Data.sandpointsnamegraph }}
  24. {{ if eq $scp $plurcp }}
  25. {{ $.Scratch.SetInMap $gpPath "depth" "core" }}
  26. {{ $.Scratch.SetInMap $gpPath "child_depth" "mantle" }}
  27. {{ $.Scratch.SetInMap $gpPath "has" $s }}
  28. {{ with $gp.File }}
  29. {{ $core := substr .Dir 0 -1 }}
  30. {{ $.Scratch.SetInMap $gpPath "core" $core }}
  31. {{ $.Scratch.SetInMap $cpPath "core" $core }}
  32. {{ end }}
  33. {{ with $cp.File }}
  34. {{ $mantle := substr .Dir 0 -1 }}
  35. {{ $.Scratch.SetInMap $gpPath "mantle" $mantle }}
  36. {{ $.Scratch.SetInMap $cpPath "mantle" $mantle }}
  37. {{ end }}
  38. {{ with $.Scratch.Get $gpPath }}
  39. {{ if .has_children }}
  40. {{ $hasChildren := index . "has_children" | append $cp }}
  41. {{ $.Scratch.SetInMap $gpPath "has_children" (uniq $hasChildren) }}
  42. {{ else }}
  43. {{ $.Scratch.SetInMap $gpPath "has_children" (slice $cp) }}
  44. {{ end }}
  45. {{ end }}
  46. {{ $.Scratch.SetInMap $cpPath "depth" "mantle" }}
  47. {{ $.Scratch.SetInMap $cpPath "child_depth" "crust" }}
  48. {{ $.Scratch.SetInMap $cpPath "plural" $plur }}
  49. {{ $.Scratch.SetInMap $cpPath "has" $scp }}
  50. {{ range index $cp.Params $kcp }}
  51. {{ $gcp := $.GetPage (printf "/%s/%s" $sincp .) }}
  52. {{ $gcpPath := printf "/%s" $gcp.File }}
  53. {{ with $.Scratch.Get $cpPath }}
  54. {{ if .has_children }}
  55. {{ $hasGChildren := index . "has_children" | append $gcp }}
  56. {{ $.Scratch.SetInMap $cpPath "has_children" (uniq $hasGChildren) }}
  57. {{ else }}
  58. {{ $.Scratch.SetInMap $cpPath "has_children" (slice $gcp) }}
  59. {{ end }}
  60. {{ if .is_in }}
  61. {{ $isincore := index . "is_in" | append $gp}}
  62. {{ $.Scratch.SetInMap $cpPath "is_in" (uniq $isincore) }}
  63. {{ else }}
  64. {{ $.Scratch.SetInMap $cpPath "is_in" (slice $gp) }}
  65. {{ end }}
  66. {{ end }}
  67. {{ $.Scratch.SetInMap $gcpPath "depth" "crust" }}
  68. {{ $.Scratch.SetInMap $gcpPath "plural" $plurcp }}
  69. {{ $.Scratch.SetInMap $gcpPath "in" (slice $sin $plur) }}
  70. {{ with $gcp.File }}
  71. {{ $crust := substr .Dir 0 -1 }}
  72. {{ $.Scratch.SetInMap $gpPath "crust" $crust }}
  73. {{ $.Scratch.SetInMap $cpPath "crust" $crust }}
  74. {{ $.Scratch.SetInMap $gcpPath "crust" $crust }}
  75. {{ end }}
  76. {{ with $.Scratch.Get $gcpPath }}
  77. {{ if .is_in }}
  78. {{ $isinmantle := index . "is_in" | append $cp}}
  79. {{ $.Scratch.SetInMap $gcpPath "is_in" (uniq $isinmantle) }}
  80. {{ else }}
  81. {{ $.Scratch.SetInMap $gcpPath "is_in" (slice $cp) }}
  82. {{ end }}
  83. {{ end }}
  84. {{ end }}
  85. {{ end }}
  86. {{ end }}
  87. {{ end }}
  88. {{ end }}
  89. {{ end }}
  90. {{ end }}
  91. {{ end }}
  92. {{ end }}
  93. {{ end }}
  94. {{ $.Scratch.SetInMap $pPath "debug" (printf "%#v" $debug) }}
  95. {{ end }}
  96. {{ return $.Scratch }}