diff options
author | Nelson/Roberto <dewittn@gmail.com> | 2020-05-12 00:18:15 +0300 |
---|---|---|
committer | Nelson/Roberto <dewittn@gmail.com> | 2020-05-12 00:18:15 +0300 |
commit | 539737e8510a07428d3809674e75941655099225 (patch) | |
tree | e5a940c99a2a237718bc48f4457c6bff2eaa817b | |
parent | c93f9d84777ab0059a2b5235ab0e702603925551 (diff) |
Created data file for global header.
-rw-r--r-- | exampleSite/config/_default/config.toml | 1 | ||||
-rw-r--r-- | exampleSite/data/globalheader.yml | 5 | ||||
-rw-r--r-- | exampleSite/data/homepage.yml | 16 | ||||
-rw-r--r-- | layouts/index.html | 16 | ||||
-rw-r--r-- | layouts/partials/header.html | 7 |
5 files changed, 35 insertions, 10 deletions
diff --git a/exampleSite/config/_default/config.toml b/exampleSite/config/_default/config.toml index 8021872..8cc446d 100644 --- a/exampleSite/config/_default/config.toml +++ b/exampleSite/config/_default/config.toml @@ -12,6 +12,7 @@ disqusShortname = "" copyright = "© Untitled. All rights reserved." design = "Desing: [HTML5 UP](http://html5up.net/) | Hugo Port: [Nelson/Roberto](https://nelsonroberto.com/)." + # For Pages the .RelPermalink must match the menu .URL # For sections the name/directory must match the menu .Identifier [menu] diff --git a/exampleSite/data/globalheader.yml b/exampleSite/data/globalheader.yml new file mode 100644 index 0000000..c58ea43 --- /dev/null +++ b/exampleSite/data/globalheader.yml @@ -0,0 +1,5 @@ +title: "[Alpha](/) by HTML5 UP" +button: + enable: true + title: "Sign up" + link: "#"
\ No newline at end of file diff --git a/exampleSite/data/homepage.yml b/exampleSite/data/homepage.yml index f988230..ff86ca9 100644 --- a/exampleSite/data/homepage.yml +++ b/exampleSite/data/homepage.yml @@ -1,11 +1,23 @@ -### highlight ### +### Banner ### +banner: + enable: true + title: "Alpha" + content: "Another fine responsive site template freebie by HTML5 UP." + buttons: + - title: "Sign Up" + link: "#" + class: "primary" + - title: "Learn More" + link: "#" + +### Highlight ### highlight: enable: true header: "Introducing the ultimate mobile app <br /> for doing stuff with your phone" content: "Blandit varius ut praesent nascetur eu penatibus nisi risus faucibus nunc ornare<br /> adipiscing nunc adipiscing. Condimentum turpis massa." image: "images/pic01.jpg" -### features ### +### Features ### features: enable: true rows: diff --git a/layouts/index.html b/layouts/index.html index ae69809..d5e293f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -7,16 +7,20 @@ <body class="landing is-preload"> <div id="page-wrapper"> {{- partial "header.html" . -}} + <!-- Banner --> <section id="banner"> - <h2>{{ .Site.Title }}</h2> - {{ with .Site.Params.description }} - <p>{{ . }}</p> - {{ end }} + {{ if .Site.Data.homepage.banner.enable }} + {{ with .Site.Data.homepage.banner }} + <h2>{{ .title }}</h2> + <p>{{ .content }}</p> <ul class="actions special"> - <li><a href="#" class="button primary">Sign Up</a></li> - <li><a href="#" class="button">Learn More</a></li> + {{ range .buttons }} + <li><a href="{{ .link }}" class="button {{ .class }}">{{ .title }}</a></li> + {{ end }} </ul> + {{ end }} + {{ end }} </section> <!-- Main --> diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2661175..e78bc14 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,6 +1,6 @@ <!-- Header --> <header id="header" {{- if .IsHome -}}class="alt"{{- end -}}> - <h1><a href="index.html">Alpha</a> by HTML5 UP</h1> + <h1>{{ with .Site.Data.globalheader.title }}{{ . | markdownify }}{{else}}{{ .Site.Title }}{{end}}</h1> <nav id="nav"> <ul> <li><a href="{{ .Site.BaseURL }}">Home</a></li> @@ -23,7 +23,10 @@ {{- end -}} </ul> </li> - <li><a href="#" class="button">Sign Up</a></li> + {{ $button := .Site.Data.globalheader.button }} + {{ if $button.enable }} + <li><a href="{{ $button.link }}" class="button">{{ $button.title }}</a></li> + {{ end }} </ul> </nav> </header>
\ No newline at end of file |