From 4e038cbae1f830b27fb1280a2d50f4482f7ab2f1 Mon Sep 17 00:00:00 2001 From: Curtis Timson Date: Sat, 24 Feb 2018 09:44:09 +0000 Subject: :sparkles: Move footer content to data files --- exampleSite/config-prod.toml | 16 ---------------- exampleSite/config.toml | 16 ---------------- exampleSite/data/footer/content.yaml | 15 +++++++++++++++ layouts/partials/footer/index.html | 16 +++++++++------- layouts/partials/footer/recentposts.html | 4 +++- 5 files changed, 27 insertions(+), 40 deletions(-) create mode 100644 exampleSite/data/footer/content.yaml diff --git a/exampleSite/config-prod.toml b/exampleSite/config-prod.toml index 112d17c..dce9e3b 100644 --- a/exampleSite/config-prod.toml +++ b/exampleSite/config-prod.toml @@ -7,22 +7,6 @@ theme = "../.." subtitle = "Howdy. This is Dopetrope." subtitleline2 = "A responsive template by HTML5 UP" -[params.footer] - title1 = "Blandit nisl adipiscing" - - title2 = "What's this all about?" - imagelink2 = "#" - imageurl2 = "images/pic10.jpg" - description2 = "This is Dopetrope a free, fully responsive HTML5 site template by AJ for HTML5 UP It's released for free under the Creative Commons Attribution license so feel free to use it for any personal or commercial project – just don't forget to credit us!" - buttonlink2 = "#" - buttontext2 = "Find out more" - - title3 = "Tempus consequat" - - title4 = "Ipsum et phasellus" - - title5 = "Vitae tempor lorem" - [params.portfolio] title = "My Portfolio" foldername = "portfolio" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 83bec74..ea71d5c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -7,22 +7,6 @@ theme = "../.." subtitle = "Howdy. This is Dopetrope." subtitleline2 = "A responsive template by HTML5 UP" -[params.footer] - title1 = "Blandit nisl adipiscing" - - title2 = "What's this all about?" - imagelink2 = "#" - imageurl2 = "images/pic10.jpg" - description2 = "This is Dopetrope a free, fully responsive HTML5 site template by AJ for HTML5 UP It's released for free under the Creative Commons Attribution license so feel free to use it for any personal or commercial project – just don't forget to credit us!" - buttonlink2 = "#" - buttontext2 = "Find out more" - - title3 = "Tempus consequat" - - title4 = "Ipsum et phasellus" - - title5 = "Vitae tempor lorem" - [params.portfolio] title = "My Portfolio" foldername = "portfolio" diff --git a/exampleSite/data/footer/content.yaml b/exampleSite/data/footer/content.yaml new file mode 100644 index 0000000..7773ea9 --- /dev/null +++ b/exampleSite/data/footer/content.yaml @@ -0,0 +1,15 @@ +sections: +- title: 'Blandit nisl adipiscing' + +- title: "What's this all about?" + imagelink: '#' + imageurl: "images/pic10.jpg" + description: "This is Dopetrope a free, fully responsive HTML5 site template by AJ for HTML5 UP It's released for free under the Creative Commons Attribution license so feel free to use it for any personal or commercial project – just don't forget to credit us!" + buttonlink: "#" + buttontext: "Find out more" + +- title: 'Tempus consequat' + +- title: 'Ipsum et phasellus' + +- title: 'Vitae tempor lorem' diff --git a/layouts/partials/footer/index.html b/layouts/partials/footer/index.html index 6d59f50..39404f9 100644 --- a/layouts/partials/footer/index.html +++ b/layouts/partials/footer/index.html @@ -5,16 +5,18 @@ {{ partial "footer/recentposts.html" . }}
+ {{ with index .Site.Data.footer.content.sections 1 }}
-

{{ .Site.Params.Footer.title2 }}

+

{{ .title }}

- +

- {{ .Site.Params.Footer.description2 }} + {{ .description }}

+ {{ end }}
@@ -22,7 +24,7 @@
-

{{ .Site.Params.Footer.title3 }}

+

{{ (index .Site.Data.footer.content.sections 2).title }}

    {{ range .Site.Data.footer.links.left.links }} @@ -34,7 +36,7 @@
    -

    {{ .Site.Params.Footer.title4 }}

    +

    {{ (index .Site.Data.footer.content.sections 3).title }}

      {{ range .Site.Data.footer.links.right.links }} @@ -46,7 +48,7 @@
      -

      {{ .Site.Params.Footer.title5 }}

      +

      {{ (index .Site.Data.footer.content.sections 4).title }}

      {{ partial "footer/social.html" . }}
        diff --git a/layouts/partials/footer/recentposts.html b/layouts/partials/footer/recentposts.html index 275faaa..1842b3b 100644 --- a/layouts/partials/footer/recentposts.html +++ b/layouts/partials/footer/recentposts.html @@ -1,8 +1,10 @@
        + {{ with index .Site.Data.footer.content.sections 0 }}
        -

        {{ .Site.Params.Footer.title1 }}

        +

        {{ .title }}

        + {{ end }}
          {{ range first 5 (where .Site.Pages "Type" .Site.Params.Blog.foldername) }}
        • -- cgit v1.2.3