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

Block web crawlers on v1.9-branch #3862

Open
wants to merge 5 commits into
base: v1.9-branch
Choose a base branch
from
Open
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
18 changes: 11 additions & 7 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,34 +129,38 @@ enable = true
gcs_engine_id = "007239566369470735695:624rglujm-w"

# Text label for the version menu in the top bar of the website.
version_menu = "Kubeflow Version"
version_menu = "v1.9"

# The major.minor version tag for the version of the docs represented in this
# branch of the repository. Used in the "version-banner" partial to display a
# version number for this doc set.
version = "master"
version = "v1.9"

# Flag used in the "version-banner" partial to decide whether to display a
# banner on every page indicating that this is an archived version of the docs.
archived_version = false
archived_version = true

# A link to latest version of the docs. Used in the "version-banner" partial to
# point people to the main doc site.
url_latest_version = "https://kubeflow.org/docs/"
url_latest_version = "https://www.kubeflow.org/docs/"

# A variable used in various docs to determine URLs for config files etc.
# To find occurrences, search the repo for 'params "githubbranch"'.
github_branch = "master"
github_branch = "v1.9-branch"

# Disable MathJax by default
# NOTE: enable it per-page with `mathjax: true` in front matter
mathjax = false

# These entries appear in the drop-down menu at the top of the website.
[[params.versions]]
version = "master"
version = "Latest"
githubbranch = "master"
url = "https://master.kubeflow.org"
url = "https://www.kubeflow.org"
Copy link
Member

@ederign ederign Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, do the www prefix instead of kubeflow.org change anything on google indexing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or did you change the other PRs for the sake of consistency?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Google prefers direct links, and only adds to the "backlinks" count for real links, not ones that are redirected (at least that's my experience).

[[params.versions]]
version = "v1.9"
githubbranch = "v1.9-branch"
url = "https://v1-9-branch.kubeflow.org"
[[params.versions]]
version = "v1.8"
githubbranch = "v1.8-branch"
Expand Down
8 changes: 2 additions & 6 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end -}}

{{ $outputFormat := partial "outputformat.html" . -}}
{{ if and hugo.IsProduction (ne $outputFormat "print") -}}
<meta name="robots" content="index, follow">
{{ else -}}
<meta name="robots" content="noindex, nofollow">
{{ end -}}
<!-- Prevent search engines from indexing this old site -->
<meta name="robots" content="noindex">

{{ partialCached "favicons.html" . }}
<title>
Expand Down
33 changes: 33 additions & 0 deletions layouts/partials/version-banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- Check the variable that indicates whether this is an archived doc set. If yes, display a banner. -->
{{- $latest_version_url := .Site.Params.url_latest_version }}
{{- $current_version := replace .Site.Params.version "v" "" | markdownify }}
{{- if .Site.Params.archived_version }}
<style>
.version-banner {
padding: 1.5rem;
margin: 2rem 0;
max-width: 40rem;
border-style: solid;
border-color: #f0ad4e;
background-color: #faf5b6;
border-radius: 0.25rem;
}
.version-banner h3 {
margin-top: 0;
margin-bottom: 0.6em;
font-size: 1.25em;
}
.version-banner p {
margin-top: 0;
margin-bottom: 0;
}
</style>
<div class="version-banner">
<h3>You are viewing documentation for <strong>Kubeflow {{ $current_version }}</strong></h3>
<p>
This is a static snapshot from the time of the Kubeflow {{ $current_version }} release.
<br>
For up-to-date information, see the <a href="{{ $latest_version_url | safeURL }}">latest version</a>.
</p>
</div>
{{- end }}