diff options
author | Maximilian Bosche <snow2k9@users.noreply.github.com> | 2019-04-10 15:41:06 +0300 |
---|---|---|
committer | Hanzei <16541325+hanzei@users.noreply.github.com> | 2019-04-10 15:41:06 +0300 |
commit | 5712e49125c893d18e6fea8d10494bacdc420c96 (patch) | |
tree | 7907b81766a6b547ca89b50716641ba50f79a165 /layouts | |
parent | f223f10314086913c43098ff1e38b35d3c81eb6b (diff) |
Order sections on homepage by weigth (#143)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/index.html | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/layouts/index.html b/layouts/index.html index ddbbb04..494e0d0 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -42,9 +42,22 @@ </section> <!-- Done with Hero --> {{ with .Site.GetPage "/home" }} + + {{ $blog := .Site.GetPage "/blog" }} + {{ $projects := .Site.GetPage "/projects" }} {{ $home := . }} - {{ range sort (.Resources.ByType "page") "Params.weight" }} + + {{ $pages := sort (.Resources.ByType "page" | append $blog | append $projects) "Params.weight" }} + {{ range $pages }} {{ if ne .Name "contact.md" }} + {{ if eq .File.Dir "projects/" }} + <!-- Now for some cool projects --> + {{ partial "home/projects.html" . }} + {{ else if eq .File.Dir "blog/" }} + <!-- Let`s show some blog posts --> + {{ partial "home/blog.html" . }} + {{ else }} + <!-- Range through all sections in /home execept contact.md --> <div class="section" id="{{ .File.TranslationBaseName }}"> <div class="container"> @@ -76,10 +89,7 @@ </div> {{ end }} {{ end }} - <!-- Now for some cool projects --> - {{ partial "home/projects.html" . }} - <!-- Let`s show some blog posts --> - {{ partial "home/blog.html" . }} + {{ end }} <!-- Let`s chat, shall we? --> {{ with .Resources.GetMatch "contact.md" }} <div class="section" id="{{ .File.TranslationBaseName }}"> @@ -124,4 +134,4 @@ {{ end }} </body> -</html>
\ No newline at end of file +</html> |