Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Bosche <snow2k9@users.noreply.github.com>2019-04-10 15:41:06 +0300
committerHanzei <16541325+hanzei@users.noreply.github.com>2019-04-10 15:41:06 +0300
commit5712e49125c893d18e6fea8d10494bacdc420c96 (patch)
tree7907b81766a6b547ca89b50716641ba50f79a165 /layouts
parentf223f10314086913c43098ff1e38b35d3c81eb6b (diff)
Order sections on homepage by weigth (#143)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/index.html22
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>