Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise third-party content warning #29877

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions assets/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,35 @@ 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 {
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;
Expand Down
12 changes: 11 additions & 1 deletion data/i18n/en/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://github.com/cncf/foundation/blob/master/website-guidelines.md" target="_blank">CNCF website guidelines</a> by listing projects alphabetically. To add a project to this list, read the <a href="/docs/contribute/style/content-guide/#third-party-content">content guide</a> 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 <a href="/docs/contribute/style/content-guide/#third-party-content">content guide</a> before submitting a change. <a href="#third-party-content-disclaimer">More information.</a>"""

[thirdparty_message_edit_disclaimer]
other="""Third party content advice"""


[thirdparty_message_single_item]
other = """&#128711; This item links to a third party project or product that is not part of Kubernetes itself. <a class="alert-more-info" href="#third-party-content-disclaimer">More information</a>"""

[thirdparty_message_disclaimer]
other = """<p>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 <a href="https://github.com/cncf/foundation/blob/master/website-guidelines.md" target="_blank">CNCF website guidelines</a> for more details.</p><p>You should read the <a href="/docs/contribute/style/content-guide/#third-party-content">content guide</a> before proposing a change that adds an extra third-party link.</p>"""

[ui_search_placeholder]
other = "Search"
Expand Down
5 changes: 5 additions & 0 deletions layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/docs/thirdparty-disclaimer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="pageinfo pageinfo-secondary" id="third-party-content-disclaimer">
{{ T "thirdparty_message_disclaimer" | safeHTML }}
</div>
4 changes: 4 additions & 0 deletions layouts/partials/page-meta-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

{{ if not (.Param "auto_generated") }}
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
{{- if .HasShortcode "thirdparty-content" -}}
<a href="#third-party-content-disclaimer" class="third-party-disclaimer-link"><i class="fa fa-icon-circle fa-fw"></i> {{ T "thirdparty_message_edit_disclaimer" | safeHTML }}</a>
{{- end }}

<a href="{{ $newPageURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_create_child_page" }}</a>
{{ end }}

Expand Down
11 changes: 8 additions & 3 deletions layouts/shortcodes/thirdparty-content.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<blockquote class="callout caution" role="alert">
<strong>{{ T "caution" | safeHTML }}</strong>
{{- $single := .Get "single" | default "false" -}}
<div class="alert alert-secondary callout third-party-content" role="alert">
{{- if not (eq $single "true" ) -}}
<strong>{{ T "note" | safeHTML }}</strong>
{{ T "thirdparty_message" | safeHTML }}
</blockquote>
{{- else -}}
{{ T "thirdparty_message_single_item" | safeHTML }}
{{- end -}}
</div>