diff --git a/layouts/index.html b/layouts/index.html
index 4c80892..094006c 100755
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -8,18 +8,16 @@
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
{{/* Check to see if the section is defined for ranging through it */}}
{{ if $section }}
-
- {{/* Derive the section name by creating a string from the initial section definition */}}
- {{ $section_name := printf "%s" (delimit ($mainSections) " ") }}
+ {{/* Derive the section name */}}
+ {{ $section_name := index (.Site.Params.mainSections) 0 }}
-
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
- {{ with .Site.GetPage "section" $section_name }}
-
- Recent {{ .Title }}
-
- {{ end }}
+ {{ with .Site.GetPage "section" $section_name }}
+
+ Recent {{ .Title }}
+
+ {{ end }}
{{/* Range through the first three items of the section */}}
@@ -31,9 +29,7 @@
-
More
-
{{/* Now, range through the next four after the initial 3 items. Nest the requirements, "after" then "first" on the outside */}}
{{ range (first 4 (after 3 $section)) }}
@@ -47,9 +43,7 @@
{{ with .Site.GetPage "section" $section_name }}
All {{.Title }}
{{ end }}
-
-
{{ end }}
{{ end }}