diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 6c5ac13..9908d2d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -9,17 +9,13 @@ paginate = 10 showMenuItems = 2 fullWidthTheme = false centerTheme = false + # singlePageSite moves pages from the main nav menu to sections on the homepage. - # These only menu items with a url starting with "/#" will be displayed using the - # front matter defined in "homepage/". A collection is displayed for other menu items. + # Only menu items with a url starting with "/#" will be displayed using the + # front matter defined in "homepage/". The standard collection is displayed for other menu items. singlePageSite = true homepagePaginateCount = 10 # If you want the homepage to paginate a different numebr of items -[params.twitter] - creator = "@justinnuwin" - site = "@justinnuwin" - - [languages] [languages.en] title = "Terminal" @@ -35,6 +31,10 @@ paginate = 10 logoHomeLink = "/" [languages.en.menu] + [[languages.en.menu.main]] + identifier = "homepage-info" + name = "Homepage Section" + url = "#/section" [[languages.en.menu.main]] identifier = "about" name = "About" diff --git a/exampleSite/content/homepage/section.md b/exampleSite/content/homepage/section.md new file mode 100644 index 0000000..05720ed --- /dev/null +++ b/exampleSite/content/homepage/section.md @@ -0,0 +1,12 @@ ++++ +title = "Homepage Section" +cover = "img/hello.jpg" +layout = "2col-right" ++++ + +**Hi there!** This is a section dedicated for a homepage. +There are 3 layouts supported for the homepage sections: + +- `2col-right` - The layout for this section with the cover image appearing on the left and the front-matter on the right +- `2col-left` - The layout for this section has the cover image on the right and front-matter on the left +- `default` - The default layout for the section matching the post layout with the image appearing above the front-matter diff --git a/layouts/partials/section.html b/layouts/partials/section.html index 7a2af42..816822e 100644 --- a/layouts/partials/section.html +++ b/layouts/partials/section.html @@ -1,17 +1,3 @@ -{{ if eq .Params.Layout "post" }} - {{ if .Params.Cover }} - {{ .Title | plainify | default - {{ end }} -
- {{- with .Content -}} -
- {{ . | replaceRE "()" `${1} ${3}` | safeHTML }} -
- {{- end -}} -
-{{ end }} - - {{ if in "2col-left 2col-right" .Params.Layout }}
@@ -25,4 +11,17 @@ {{- end -}}
+{{ else }} + {{ if .Params.Cover }} + {{ .Title | plainify | default + {{ end }} +
+ {{- with .Content -}} +
+ {{ . | replaceRE "()" `${1} ${3}` | safeHTML }} +
+ {{- end -}} +
{{ end }} + +