Improve announcements implementation
Signed-off-by: Celeste Horgan <celeste@cncf.io> Co-authored-by: Tim Bannister <tim@scalefactory.com>
This commit is contained in:
+5
-3
@@ -83,10 +83,12 @@ githubWebsiteRepo = "github.com/kubernetes/website"
|
|||||||
githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website"
|
githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website"
|
||||||
|
|
||||||
# param for displaying an announcement block on every page; see PR #16210
|
# param for displaying an announcement block on every page; see PR #16210
|
||||||
announcement = false
|
announcement = true
|
||||||
# announcement_message is only displayed when announcement = true; update with your specific message
|
# announcement_message is only displayed when announcement = true; update with your specific message
|
||||||
announcement_message = "The Kubernetes Documentation team would like your feedback! Please take a <a href='https://www.surveymonkey.com/r/8R237FN' target='_blank'>short survey</a> so we can improve the Kubernetes online documentation."
|
announcement_title = "Announcement title here"
|
||||||
|
announcement_message_full = "Long homepage announcement <br/><br/> Quisque efficitur feugiat neque non accumsan. Sed sed massa pharetra, suscipit mauris ut, viverra felis. Sed id ullamcorper sapien. Vivamus lobortis elementum nunc nec molestie. Ut eleifend tellus diam, in tincidunt purus ullamcorper nec. Morbi quam elit, laoreet at cursus vitae, efficitur condimentum felis. Nam ac felis sed lorem dapibus semper. Integer eu pretium justo. Nunc porta pulvinar ornare. " #appears on homepage. Use md formatting for links and <br/> for line breaks.
|
||||||
|
announcement_message_compact = "One line compact announcement" #appears on subpages
|
||||||
|
announcement_bg = "#000000" #choose a dark color – text is white
|
||||||
|
|
||||||
[params.pushAssets]
|
[params.pushAssets]
|
||||||
css = [
|
css = [
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ title: "Production-Grade Container Orchestration"
|
|||||||
abstract: "Automated container deployment, scaling, and management"
|
abstract: "Automated container deployment, scaling, and management"
|
||||||
cid: home
|
cid: home
|
||||||
---
|
---
|
||||||
{{< announcement >}}
|
|
||||||
|
|
||||||
{{< deprecationwarning >}}
|
{{< deprecationwarning >}}
|
||||||
|
|
||||||
{{< blocks/section id="oceanNodes" >}}
|
{{< blocks/section id="oceanNodes" >}}
|
||||||
|
|||||||
@@ -4,6 +4,13 @@
|
|||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
</head>
|
</head>
|
||||||
<body class="page">
|
<body class="page">
|
||||||
|
{{ block "announcement" . }}
|
||||||
|
{{ if .IsHome }}
|
||||||
|
{{ partial "frontpage-announcement.html" . }}
|
||||||
|
{{ else }}
|
||||||
|
{{ partial "announcement.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
{{ block "hero" . }}
|
{{ block "hero" . }}
|
||||||
<!-- HERO -->
|
<!-- HERO -->
|
||||||
@@ -18,7 +25,6 @@
|
|||||||
</section>
|
</section>
|
||||||
{{ block "post-hero" . }}{{ end }}
|
{{ block "post-hero" . }}{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<article class="page-content">
|
<article class="page-content">
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }}{{ end }}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="{{ "css/blog.css" | relURL }}">
|
<link rel="stylesheet" type="text/css" href="{{ "css/blog.css" | relURL }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{{ partial "announcement.html" . }}
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
<section id="hero" class="light-text no-sub">
|
<section id="hero" class="light-text no-sub">
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
{{ partial "announcement.html" . }}
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
{{ block "hero" . }}
|
{{ block "hero" . }}
|
||||||
<!-- HERO -->
|
<!-- HERO -->
|
||||||
@@ -11,7 +12,6 @@
|
|||||||
{{ partial "docs/top-menu.html" . }}
|
{{ partial "docs/top-menu.html" . }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ block "announcement" . }}{{ partial "announcement.html" . }}{{ end }}
|
|
||||||
{{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
|
{{ block "deprecation" . }}{{ partial "deprecation-warning.html" . }}{{ end }}
|
||||||
<main>
|
<main>
|
||||||
<section id="encyclopedia">
|
<section id="encyclopedia">
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
{{ if .Param "announcement"}}
|
{{ if .Page.Param "announcement" }}
|
||||||
<section id="announcement">
|
<section lang="en" id="announcement" style="background-color:{{ .Page.Param "announcement_bg" }}">
|
||||||
<main>
|
<main>
|
||||||
<div class="content announcement">
|
<div class="content announcement main-section">
|
||||||
<h3>
|
|
||||||
{{ .Param "announcement_message" | markdownify }}
|
<h4 class="announcement">
|
||||||
</h3>
|
{{ .Page.Param "announcement_title" | markdownify }}
|
||||||
|
</h4>
|
||||||
|
<p class="announcement">{{ .Page.Param "announcement_message_compact" | markdownify }}</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
<link rel="stylesheet" href="{{ "css/jquery-ui.min.css" | relURL }}">
|
<link rel="stylesheet" href="{{ "css/jquery-ui.min.css" | relURL }}">
|
||||||
<link rel="stylesheet" href="{{ "css/callouts.css" | relURL }}">
|
<link rel="stylesheet" href="{{ "css/callouts.css" | relURL }}">
|
||||||
<link rel="stylesheet" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
|
<link rel="stylesheet" href="{{ "css/custom-jekyll/tags.css" | relURL }}">
|
||||||
|
{{- if .Site.Params.announcement }}
|
||||||
|
<link rel="stylesheet" href="{{ "css/announcement.css" | relURL }}">
|
||||||
|
{{- end }}
|
||||||
{{- if .Params.deprecated }}
|
{{- if .Params.deprecated }}
|
||||||
<link rel="stylesheet" href="{{ "css/deprecation-warning.css" | relURL }}">
|
<link rel="stylesheet" href="{{ "css/deprecation-warning.css" | relURL }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{{ if .Page.Param "announcement" }}
|
||||||
|
<section lang="en" id="fp-announcement" style="background-color:{{ .Page.Param "announcement_bg" }}">
|
||||||
|
<main>
|
||||||
|
<div class="content announcement main-section">
|
||||||
|
|
||||||
|
<h3>
|
||||||
|
{{ .Page.Param "announcement_title" | markdownify }}
|
||||||
|
</h3>
|
||||||
|
<p>{{ .Page.Param "announcement_message_full" | markdownify }}</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
{{ if .Page.Param "announcement" }}
|
{{ if .Page.Param "announcement" }}
|
||||||
|
<link rel="stylesheet" href="{{ "css/announcement.css" | relURL }}">
|
||||||
<section id="announcement">
|
<section id="announcement">
|
||||||
<main>
|
<main>
|
||||||
<div class="content announcement">
|
<div class="content announcement main-section">
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
{{ .Page.Param "announcement_message" | markdownify }}
|
{{ .Page.Param "announcement_message" | markdownify }}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,6 +1,25 @@
|
|||||||
.announcement {
|
.announcement.content {
|
||||||
padding: 20px;
|
margin-bottom: 0px;
|
||||||
margin: 20px 0;
|
}
|
||||||
border-radius: 3px;
|
|
||||||
background-color: #eeeeee;
|
.announcement > p, .gridPage #announcement .content p, .announcement > h4, .announcement > h3 {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#announcement {
|
||||||
|
padding-top: 75px;
|
||||||
|
padding-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#hero {
|
||||||
|
padding-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fp-announcement {
|
||||||
|
min-height: 30vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fp-announcement main {
|
||||||
|
margin-top: 125px;
|
||||||
|
padding-bottom: 35px;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user