diff --git a/config/_default/menus.toml b/config/_default/menus.toml index 0eb877b..d0baab9 100644 --- a/config/_default/menus.toml +++ b/config/_default/menus.toml @@ -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" diff --git a/data/headlines.yaml b/data/headlines.yaml new file mode 100644 index 0000000..c8b05a7 --- /dev/null +++ b/data/headlines.yaml @@ -0,0 +1,3 @@ +- title: OpenPOWER Summit 2022 Call-for-Presentations + url: https://cfp.openpower.foundation/openpowersummit2022/cfp + until: 2022-09-31 diff --git a/themes/openpowerfoundation/assets/css/header.scss b/themes/openpowerfoundation/assets/css/header.scss index e6c9eb5..4096119 100644 --- a/themes/openpowerfoundation/assets/css/header.scss +++ b/themes/openpowerfoundation/assets/css/header.scss @@ -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; diff --git a/themes/openpowerfoundation/layouts/partials/navbar.html b/themes/openpowerfoundation/layouts/partials/navbar.html index 71a4965..541af8d 100644 --- a/themes/openpowerfoundation/layouts/partials/navbar.html +++ b/themes/openpowerfoundation/layouts/partials/navbar.html @@ -104,11 +104,20 @@ -{{ 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 }}
-{{ range .Site.Menus.headlines }} - {{ .Name }} +{{ range $headlines }} + {{ .title }} {{ end }}