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

Fix indexing for k8s.io #9767

Merged

Conversation

chenopis
Copy link
Contributor

@chenopis chenopis commented Aug 6, 2018

Partial revert of #9225
Partial revert of #9703
Fixes kubernetes/kubernetes#67013
Fixes #9758

@chenopis chenopis self-assigned this Aug 6, 2018
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 6, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 6, 2018
@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented Aug 6, 2018

Deploy preview for kubernetes-io-master-staging ready!

Built with commit 9973900

https://deploy-preview-9767--kubernetes-io-master-staging.netlify.com

@chenopis chenopis force-pushed the website/chenopis-revert-9225 branch 2 times, most recently from 6485677 to a4f5349 Compare August 6, 2018 20:40
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 6, 2018
@chenopis chenopis force-pushed the website/chenopis-revert-9225 branch from a4f5349 to 9973900 Compare August 6, 2018 20:42
@chenopis chenopis changed the title Revert 9225, fix indexing for k8s.io Fix indexing for k8s.io Aug 6, 2018
@chenopis chenopis requested a review from bep August 6, 2018 20:44
@bep
Copy link
Contributor

bep commented Aug 6, 2018

LGTM.

@@ -0,0 +1,3 @@
# Prevent bots from indexing site
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this comment still unclosed?

Copy link
Contributor Author

@chenopis chenopis Aug 6, 2018

Choose a reason for hiding this comment

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

Oh, that's actually not an opening comment delimiter. It's specifying that the header tag should be for all the pages in the site, similar to file path syntax on the command line, e.g. rm -rf /* LOL. See https://www.netlify.com/docs/headers-and-basic-auth/

@mdlinville
Copy link
Contributor

It seems hard to test this before going live, so ....

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mistyhacks

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2018
@k8s-ci-robot k8s-ci-robot merged commit 4920a51 into kubernetes:master Aug 6, 2018
@chenopis chenopis deleted the website/chenopis-revert-9225 branch August 6, 2018 21:33
@colek42
Copy link

colek42 commented Aug 8, 2018

Did this cause google to delist the docs on kubernetes.io?

@zacharysarah
Copy link
Contributor

@colek42 This fixed the reason they were de-indexed. Re-indexing will take time.

@lucperkins
Copy link
Contributor

lucperkins commented Aug 8, 2018

@chenopis May I ask the reasoning behind this PR? There was already a system in place for generating a _headers file and that system has been effectively overwritten by this PR (see here and here especially) because the _headers file is simply copied into the public folder, overwriting the _headers file that is currently being generated by Hugo.

Also, in the future, if a static resource needs to end up in the public folder it should be put in static, not copied from another directory.

I think the best course of action here is to modify the existing _headers generation process to continue to allow for Netlify's HTTP/2 push feature, which was the initial impetus, rather than simply overriding that process.

@zacharysarah
Copy link
Contributor

@lucperkins 👋

May I ask the reasoning behind this PR?

Search results for K8s docs were de-indexed on Google (#9758, #9783), due at least partially to changes introduced in #9225. Any further iterations to _headers generation should be sensitive to the possibility of unintended downstream changes.

@chenopis
Copy link
Contributor Author

chenopis commented Aug 9, 2018

@lucperkins Previously, we had to address the problem of other similar published branches (e.g. https://v1-9.docs.kubernetes.io/) from being indexed by Google search, which diluted the results of the main https://kubernetes.io site. Consequently, I set up a system to add the X-Robots-Tag: noindex header directive to all the branches by default via the build command. However, the master branch for the main site uses a different build context so that it does not add the noindex directive.

I'm not saying this is the best way to solve it, but I had to revert some of @bep and your changes to address the immediate de-indexing problems that were getting reported. Perhaps at the next SIG Docs meeting we can discuss a better way to handle this issue so that it still uses the HTTP/2 push feature but only adds the noindex directive to the non-master branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants