From 6524098340fa260c0268c8b343a56ecfe47dc4d6 Mon Sep 17 00:00:00 2001 From: mspnr Date: Sun, 31 Jan 2021 16:47:21 +0100 Subject: [PATCH] adding template support for spotlights --- exampleSite/data/spotlight1.yml | 10 ++++++++++ exampleSite/data/spotlight2.yml | 9 +++++++++ exampleSite/data/spotlight3.yml | 10 ++++++++++ layouts/index.html | 6 +++--- layouts/partials/spotlight.html | 13 +++++++++++++ 5 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 exampleSite/data/spotlight1.yml create mode 100644 exampleSite/data/spotlight2.yml create mode 100644 exampleSite/data/spotlight3.yml create mode 100644 layouts/partials/spotlight.html diff --git a/exampleSite/data/spotlight1.yml b/exampleSite/data/spotlight1.yml new file mode 100644 index 0000000..03058b6 --- /dev/null +++ b/exampleSite/data/spotlight1.yml @@ -0,0 +1,10 @@ +####################### Spotlight ######################### +style: "style1 orient-right content-align-left image-position-center onscroll-image-fade-in" +id: "first" +title : "Spotlight" +content: | + This is a Spotlight element, and it's generally used – as its name implies – to spotlight a particular feature, subject, or pretty much whatever. You can customize its appearance with a number of modifiers, as well as assign it an optional onload or onscroll transition modifier (details). +button: + label: "Learn More" + link: "#" +image: "images/spotlight01.jpg" diff --git a/exampleSite/data/spotlight2.yml b/exampleSite/data/spotlight2.yml new file mode 100644 index 0000000..2a9435f --- /dev/null +++ b/exampleSite/data/spotlight2.yml @@ -0,0 +1,9 @@ +####################### Spotlight ######################### +style: "style1 orient-left content-align-left image-position-center onscroll-image-fade-in" +title : "Spotlight" +content: | + This is also a Spotlight element, and it's here because this demo would look a bit empty with just one spotlight. Like all spotlights, you can customize its appearance with a number of modifiers, as well as assign it an optional onload or onscroll transition modifier (details). +button: + label: "Learn More" + link: "#" +image: "images/spotlight02.jpg" diff --git a/exampleSite/data/spotlight3.yml b/exampleSite/data/spotlight3.yml new file mode 100644 index 0000000..03fa5e5 --- /dev/null +++ b/exampleSite/data/spotlight3.yml @@ -0,0 +1,10 @@ +####################### Spotlight ######################### +style: "style1 orient-right content-align-left image-position-center onscroll-image-fade-in" +id: "first" +title : "Spotlight" +content: | + And yes, this is another Spotlight element, and it's also here because I need to fill a bit of space. Naturally, like any other spotlight, you can customize its appearance with a number of modifiers, as well as assign it an optional onload or onscroll transition modifier (details). +button: + label: "Learn More" + link: "#" +image: "images/spotlight03.jpg" diff --git a/layouts/index.html b/layouts/index.html index 278846d..e795826 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -16,9 +16,9 @@ {{ partial "banner" site.Data.banner }} - {{ partial "spotlight-01-left" . }} - {{ partial "spotlight-02-right" . }} - {{ partial "spotlight-03-left" . }} + {{ partial "spotlight" site.Data.spotlight1 }} + {{ partial "spotlight" site.Data.spotlight2 }} + {{ partial "spotlight" site.Data.spotlight3 }} {{ partial "gallery" . }} {{ partial "items" . }} {{ partial "elements" . }} diff --git a/layouts/partials/spotlight.html b/layouts/partials/spotlight.html new file mode 100644 index 0000000..d171c7e --- /dev/null +++ b/layouts/partials/spotlight.html @@ -0,0 +1,13 @@ + +
+
+ {{ with .title }}

{{ . }}

{{ end }} + {{ with .content }}

{{ . | safeHTML }}

{{ end }} + {{ with .button }}{{ end }} +
+ {{ with .image }}
+ +
{{ end }} +
\ No newline at end of file