From f222eaab7c42546734a2d406a3e57e68922721e4 Mon Sep 17 00:00:00 2001 From: Vladimir Chebotarev Date: Sun, 11 Mar 2018 19:04:36 +0300 Subject: Extensibility improvements: custom sections, reordering and disabling. --- exampleSite/config.toml | 64 +++++++++++++++++++++--------------- layouts/index.html | 41 ++++++++++------------- layouts/partials/about.html | 16 --------- layouts/partials/contact.html | 29 ++++++++++++++++ layouts/partials/footer-contact.html | 17 ---------- layouts/partials/footer-social.html | 4 +-- layouts/partials/hero.html | 10 +++--- layouts/partials/infos.html | 15 --------- layouts/partials/list.html | 25 ++++++++++++++ layouts/partials/scripts.html | 16 ++++----- layouts/partials/skills.html | 23 ------------- layouts/partials/text.html | 17 ++++++++++ 12 files changed, 142 insertions(+), 135 deletions(-) delete mode 100644 layouts/partials/about.html create mode 100644 layouts/partials/contact.html delete mode 100644 layouts/partials/footer-contact.html delete mode 100644 layouts/partials/infos.html create mode 100644 layouts/partials/list.html delete mode 100644 layouts/partials/skills.html create mode 100644 layouts/partials/text.html diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 2771375..8ce10df 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -37,15 +37,17 @@ googleAnalytics = "" # If it's disabled you could change the background to overwrite the bg.png and overlay.png to set the background. backgroundpersection = true - # Hero Section + # hero Section [params.hero] + type = "hero" title = "Highlights" description = "a fun litte { responsive } single Pager by [HTML5UP](//html5up.net)" buttontext = "begin" # about section - [params.about] - enable = true + [[params.block]] + id = "about" + type = "text" title = "Who am I" description = "Aliquam ante ac id. Adipiscing interdum lorem praesent fusce pellentesque arcu feugiat. Consequat sed ultricies rutrum. Sed adipiscing eu amet interdum lorem blandit vis ac commodo aliquet integer vulputate phasellus lorem ipsum dolor lorem magna consequat sed etiam adipiscing interdum." buttontext = "next" @@ -53,59 +55,69 @@ googleAnalytics = "" picture = "pic01.jpg" # skill section - [params.skill_list] - enable = true + [[params.block]] + id = "skills" + type = "list" title = "Stuff I do" description = "Consequat sed ultricies rutrum. Sed adipiscing eu amet interdum lorem blandit vis ac commodo aliquet vulputate." buttontext = "next" # the picture is storead at static/images/ picture = "pic02.jpg" - [[params.skills]] + [[params.block.item]] icon = "fa-camera-retro" title = "Magna Etiam" - [[params.skills]] + [[params.block.item]] icon = "fa-pencil" title = "Lorem Ipsum" - [[params.skills]] + [[params.block.item]] icon = "fa-code" title = "Nulla Tempus" - [[params.skills]] + [[params.block.item]] icon = "fa-coffee" title = "Sed Feugiat" + # infos section - [params.infos] - enable = true + [[params.block]] + id = "infos" + type = "text" title = "One more thing" description = "Aliquam ante ac id. Adipiscing interdum lorem praesent fusce pellentesque arcu feugiat. Consequat sed ultricies rutrum. Sed adipiscing eu amet interdum lorem blandit vis ac commodo aliquet integer vulputate phasellus lorem ipsum dolor lorem magna consequat sed etiam adipiscing interdum." # the picture is storead at static/images/ picture = "pic03.jpg" - # footer section - # this section includes - # - # - the contact form - # - social icons - # - # It's possible to disable the whole footer or disable only social icons or contact form - - [params.footer] - enable = true +# # custom section +# [[params.block]] +# id = "important" +# # to make custom section copy /layouts/partials/text.html to /layouts/partials/custom.html and edit it according to your needs. +# type = "custom" +# title = "Don't forget" +# description = "Curabitur massa ante, semper at massa et, semper pellentesque velit. Duis tempor est nisi, a gravida risus malesuada eget. Nunc rutrum arcu laoreet mauris sodales vehicula. Nunc iaculis felis ac dui egestas, vel ullamcorper tellus bibendum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque lacinia sem porttitor, fringilla metus at, convallis quam. Integer convallis a justo non pellentesque." +# # the picture is storead at static/images/ +# picture = "pic04.jpg" + + # contact form + [[params.block]] + id = "contact" + type = "contact" title = "Get in Touch" + picture = "pic05.jpg" - # contact form - [params.footer.contact] - enable = true - - [params.footer.contact.form] + [params.block.form] name = "Name" email = "Your Email" message = "Your Message" buttontext = "send message" + # footer section + # this section includes last block and social icons + + [params.footer] + enable = true + # social icons [params.footer.social_list] enable = true diff --git a/layouts/index.html b/layouts/index.html index 70b051f..8281abe 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,32 +9,25 @@ {{ partial "head.html" . }} - {{ partial "hero.html" . }} - - {{ if .Site.Params.about.enable }} - {{ partial "about.html" . }} - {{ end }} - - {{ if .Site.Params.skill_list.enable }} - {{ partial "skills.html" . }} - {{ end }} - - {{ if .Site.Params.infos.enable }} - {{ partial "infos.html" . }} - {{ end }} - - {{ if .Site.Params.footer.enable }} - - {{"" | safeHTML}} + {{ $list := .Site.Params.block }} + {{ partial "hero.html" (dict "block" .Site.Params.hero "params" $.Site.Params "next" (index $list 0)) }} + {{ range $index, $element := $list }} + {{ $last := eq $index (sub (len $list) 1) }} + {{ if and $.Site.Params.footer.enable $last }} + {{"" | safeHTML}} + + {{ end }} {{ end }} {{ partial "scripts.html" . }} diff --git a/layouts/partials/about.html b/layouts/partials/about.html deleted file mode 100644 index ad09814..0000000 --- a/layouts/partials/about.html +++ /dev/null @@ -1,16 +0,0 @@ - -{{ "" | safeHTML }} -
-
- {{ if eq .Site.Params.backgroundpersection true }} - - {{ end }} -
-
-

{{ with .Site.Params.about.title }}{{ . | markdownify }}{{ end }}

-
-

{{ with .Site.Params.about.description }}{{ . | markdownify }}{{ end }}

-
- {{ with .Site.Params.about.buttontext }}{{ . | markdownify }}{{ end }} -
-
diff --git a/layouts/partials/contact.html b/layouts/partials/contact.html new file mode 100644 index 0000000..8a4bc7f --- /dev/null +++ b/layouts/partials/contact.html @@ -0,0 +1,29 @@ +{{ print "" | safeHTML }} +
+
+ {{ if eq .params.backgroundpersection true }} + + {{ end }} +
+
+

{{ with .block.title }}{{ . | markdownify }}{{ end }}

+
+

{{ with .block.description }}{{ . | markdownify }}{{ end }}

+
+
+
+
+
+
+
    +
  • +
+
+
+
+
+ {{ if .next }} + {{ with .block.buttontext }}{{ . | markdownify }}{{ end }} + {{ end }} +
+
diff --git a/layouts/partials/footer-contact.html b/layouts/partials/footer-contact.html deleted file mode 100644 index 2e4b302..0000000 --- a/layouts/partials/footer-contact.html +++ /dev/null @@ -1,17 +0,0 @@ -
-
-

{{ with .Site.Params.footer.title }}{{ . | markdownify }}{{ end }}

-
-
-
-
-
-
-
-
    -
  • -
-
-
-
-
diff --git a/layouts/partials/footer-social.html b/layouts/partials/footer-social.html index a2e2765..5e56bd5 100644 --- a/layouts/partials/footer-social.html +++ b/layouts/partials/footer-social.html @@ -1,11 +1,11 @@