Browse Source

change headlines from menu to data

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
master
Toshaan Bharvani 3 months ago
parent
commit
5347c2a774
  1. 6
      config/_default/menus.toml
  2. 3
      data/headlines.yaml
  3. 6
      themes/openpowerfoundation/assets/css/header.scss
  4. 15
      themes/openpowerfoundation/layouts/partials/navbar.html

6
config/_default/menus.toml

@ -192,9 +192,3 @@ @@ -192,9 +192,3 @@
pre = "fab fa-weixin"
url = "http://weixin.qq.com/r/2DrD20PEWx4krQe492-K"
weight = -1600


### headlines
[[headlines]]
name = "OpenPOWER Summit 2022 Call-for-Presentations"
url = "https://cfp.openpower.foundation/openpowersummit2022/cfp"

3
data/headlines.yaml

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
- title: OpenPOWER Summit 2022 Call-for-Presentations
url: https://cfp.openpower.foundation/openpowersummit2022/cfp
until: 2022-09-31

6
themes/openpowerfoundation/assets/css/header.scss

@ -298,9 +298,9 @@ body { @@ -298,9 +298,9 @@ body {
-moz-transform: translateX(100%);
-webkit-transform: translateX(100%);
transform: translateX(100%);
-moz-animation: scroll-left 30s linear infinite;
-webkit-animation: scroll-left 30s linear infinite;
animation: scroll-left 30s linear infinite;
-moz-animation: scroll-left 1s linear infinite;
-webkit-animation: scroll-left 1s linear infinite;
animation: scroll-left 45s linear infinite;
}
.headline a {
color: $white;

15
themes/openpowerfoundation/layouts/partials/navbar.html

@ -104,11 +104,20 @@ @@ -104,11 +104,20 @@
</div>
</div>
</div>
{{ if .Site.Menus.headlines }}
{{ if .Site.Data.headlines }}
{{ $now := now.Format "2006-01-02" }}
{{ $headlines := slice }}
{{ range .Site.Data.headlines }}
{{ if gt .until $now }}
{{ $headlines = $headlines | append . }}
{{ end }}
{{ end }}
{{ if gt (len $headlines) 0 }}
<div class="headline"><p>
{{ range .Site.Menus.headlines }}
&nbsp;&nbsp;<a href="{{ .URL }}">{{ .Name }}</a>&nbsp;&nbsp;
{{ range $headlines }}
&nbsp;&nbsp;&nbsp;&nbsp;<a href="{{ .url }}">{{ .title }}</a>&nbsp;&nbsp;&nbsp;&nbsp;
{{ end }}
</p></div>
{{ end }}
{{ end }}
</header>

Loading…
Cancel
Save