From 8a736308a9039db3516f26619728e94e8c749f2f Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 2 Oct 2021 16:28:54 +0100 Subject: [PATCH 1/3] Revise third-party content warning --- data/i18n/en/en.toml | 12 +++++++++++- layouts/docs/baseof.html | 5 +++++ layouts/partials/docs/thirdparty-disclaimer.html | 3 +++ layouts/partials/page-meta-links.html | 4 ++++ layouts/shortcodes/thirdparty-content.html | 11 ++++++++--- 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 layouts/partials/docs/thirdparty-disclaimer.html diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml index e32d8819d2..6ed8b8a731 100644 --- a/data/i18n/en/en.toml +++ b/data/i18n/en/en.toml @@ -217,7 +217,17 @@ other = "Subscribe" other = "Synopsis" [thirdparty_message] -other = """This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for these projects. This page follows CNCF website guidelines by listing projects alphabetically. To add a project to this list, read the content guide before submitting a change.""" +other = """This section links to third party projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for these projects, which are listed alphabetically. To add a project to this list, read the content guide before submitting a change. More information.""" + +[thirdparty_message_edit_disclaimer] +other="""Third party content advice""" + + +[thirdparty_message_single_item] +other = """🛇 This item links to a third party project or product that is not part of Kubernetes itself. More information""" + +[thirdparty_message_disclaimer] +other = """

Items on this page refer to third party products or projects that provide functionality required by Kubernetes. The Kubernetes project authors aren't responsible for those third-party products or projects. See the CNCF website guidelines for more details.

You should read the content guide before proposing a change that adds an extra third-party link.

""" [ui_search_placeholder] other = "Search" diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html index cc6237938b..7dae9a6e90 100644 --- a/layouts/docs/baseof.html +++ b/layouts/docs/baseof.html @@ -22,6 +22,11 @@ {{ partial "deprecation-warning.html" . }} {{ end }} {{ block "main" . }}{{ end }} + {{- if .HasShortcode "thirdparty-content" -}} + {{ block "thirdparty-disclaimer" . }} + {{ partial "docs/thirdparty-disclaimer.html" . }} + {{- end -}} + {{- end -}} {{ if (and (not .Params.hide_feedback) (.Site.Params.ui.feedback.enable) (.Site.GoogleAnalytics)) }} {{ partial "feedback.html" .Site.Params.ui.feedback }} {{ end }} diff --git a/layouts/partials/docs/thirdparty-disclaimer.html b/layouts/partials/docs/thirdparty-disclaimer.html new file mode 100644 index 0000000000..0eca49d071 --- /dev/null +++ b/layouts/partials/docs/thirdparty-disclaimer.html @@ -0,0 +1,3 @@ +
+{{ T "thirdparty_message_disclaimer" | safeHTML }} +
diff --git a/layouts/partials/page-meta-links.html b/layouts/partials/page-meta-links.html index 529bcea29c..83571db525 100644 --- a/layouts/partials/page-meta-links.html +++ b/layouts/partials/page-meta-links.html @@ -24,6 +24,10 @@ {{ if not (.Param "auto_generated") }} {{ T "post_edit_this" }} + {{- if .HasShortcode "thirdparty-content" -}} + {{ T "thirdparty_message_edit_disclaimer" | safeHTML }} + {{- end }} + {{ T "post_create_child_page" }} {{ end }} diff --git a/layouts/shortcodes/thirdparty-content.html b/layouts/shortcodes/thirdparty-content.html index 5a98081e49..36fbdef13e 100644 --- a/layouts/shortcodes/thirdparty-content.html +++ b/layouts/shortcodes/thirdparty-content.html @@ -1,4 +1,9 @@ - +{{- else -}} + {{ T "thirdparty_message_single_item" | safeHTML }} +{{- end -}} + From feb2785238a638cdb6ba00a0087d92f73c2c085f Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 2 Oct 2021 16:53:59 +0100 Subject: [PATCH 2/3] Highlight third party content disclaimer When the (new) third party content disclaimer is the current target, highlight it with a flash of yellow that fades to a yellow background, rather than the usual gray. --- assets/scss/_custom.scss | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index 7d6aa6784f..752af266cb 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -343,6 +343,26 @@ main { } } +// Highlight disclaimer when targeted as a fragment + +#third-party-content-disclaimer { + color: #000; + background: #f8f9fa; + transition: all 0.5s ease; +} + +@keyframes disclaimer-highlight { + from { background: #f8f922; color: #000; } + 50% { background: #f8f944; color: #000; } + to { background: #f8f9cb; color: #000; } +} + +#third-party-content-disclaimer:target { + color: #000; + animation: disclaimer-highlight 1.25s ease; + background: #f8f9cb; +} + .deprecation-warning { padding: 20px; margin: 20px 0; From bab43543f072053d5b0f68ca352c1abe722fba9f Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 2 Oct 2021 17:01:11 +0100 Subject: [PATCH 3/3] Set custom color for third-party-content alert --- assets/scss/_custom.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index 752af266cb..20a36b6175 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -338,11 +338,15 @@ main { border-left-color: #d9534f; } + h1:first-of-type + blockquote.callout { margin-top: 1.5em; } } +// Special color for third party content disclaimers +.alert.third-party-content { border-left-color: #222 }; + // Highlight disclaimer when targeted as a fragment #third-party-content-disclaimer {