Skip to content

Conversation

aidanranney
Copy link
Contributor

@aidanranney aidanranney commented May 10, 2020

Revise the Kubernetes website to use Docsy.

In order to base the Kubernetes Hugo site upon the Docsy theme, this site was originally built upon a fresh Hugo project with Docsy installed. This was necessary in order to achieve iterative successful Hugo builds. This PR represents the end result of those changes, applied against the master branch.

Fixes #14992
Fixes #21753

Staging site @ https://kubernetes-docsy-staging.netlify.app/

@k8s-ci-robot
Copy link
Contributor

Welcome @aidanranney!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label May 10, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the language/fr Issues or PRs related to French language label May 10, 2020
@k8s-ci-robot k8s-ci-robot requested review from irvifa and kbhawkey May 10, 2020 19:36
@k8s-ci-robot k8s-ci-robot added language/id Issues or PRs related to Indonesian language size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. language/it Issues or PRs related to Italian language language/ko Issues or PRs related to Korean language language/vi Issues or PRs related to Vietnamese language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels May 10, 2020
@zacharysarah
Copy link
Contributor

@aidanranney 👋 Thanks for opening a pull request! In order for us to accept the PR, you'll need to sign the contributor license agreement.

@zacharysarah
Copy link
Contributor

Netlify is throwing a build error:

12:37:15 PM: ERROR 2020/05/10 19:37:15 Transformation failed: SCSS processing failed: file "stdin", line 6, col 1: File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.

That's the error Hugo throws for a site version pre-0.60.0. We'll need to merge #19907 before this PR's preview builds successfully.

@jimangel @kbarnard10 @sftim @kbhawkey @onlydole

@jimangel
Copy link
Member

We'll need to merge #19907 before this PR's preview builds successfully.

I think we can tackle the couple obvious defects and maybe @bep could help with a conversation script.

If we get it passable along with majority of content legible, maybe we merge and open issues on top?

Would be a good convo for the weekly meeting.

@aidanranney
Copy link
Contributor Author

Thanks @zacharysarah! I've passed the license agreement along to Troy to sign up the organization.

algolia_docsearch = false

# Enable Lunr.js offline search
offlineSearch = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all entries needed in the fields, css and js? Referring specifically to custom-jekyll/tags and "callouts"?

netlify.toml Outdated

[context.production.environment]
HUGO_BASEURL = "https://kubernetes.io/"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

[context.deploy-preview]
command = "make deploy-preview"
command = "cd themes/docsy && git submodule update -f --init && cd ../.. && make deploy-preview"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to update docsy every time or is it better to control when to accept docsy updates?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kbhawkey I suspect it's better to take whatever pain comes with automatic updates--but I'm agnostic. Do you have an opinion one way or another? @sftim @onlydole?

Copy link
Member

Choose a reason for hiding this comment

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

I’ve been bit a few times by not pinning something to a specific version, and would like if we could do so here so we can have a guarantee of consistency. Otherwise we might have some hard to pin down bugs or results.

Copy link
Contributor

Choose a reason for hiding this comment

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

I missed this in my other review, but I recommend the same syntax here as elsewhere:

Suggested change
command = "cd themes/docsy && git submodule update -f --init && cd ../.. && make deploy-preview"
command = "git submodule update --init --recursive && make deploy-preview"

@zacharysarah
Copy link
Contributor

@aidanranney 👋 Please rebase when you have a chance. We merged the dependencies blocking this PR from building on its own merits.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2020
@zacharysarah
Copy link
Contributor

zacharysarah commented May 12, 2020

The preview build for this PR still fails with the same error:

12:37:15 PM: ERROR 2020/05/10 19:37:15 Transformation failed: SCSS processing failed: file "stdin", line 6, col 1: File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.

Eventually I figured out that netlify isn't loading the submodule properly. After some experimentation, I'm able to run the build locally. Here's how I did it:

In my local repo, I ran:

git remote add gearbox-built git@github.com:gearbox-built/website.git
git fetch --all
git checkout -b kubernetes-docsy gearbox-built/kubernetes-docsy
git rebase upstream/master

Then I ran:

git submodule update --init --recursive

The usual make serve works fine to instantiate a server locally.

TLDR: We need to add the --recursive flag into the build commands in netlify.toml.

Copy link
Contributor

@zacharysarah zacharysarah left a comment

Choose a reason for hiding this comment

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

@aidanranney Thanks for addressing feedback so far. Netlify is failing for submodule-related reasons, so I suggest some alternate syntax:

@sftim
Copy link
Contributor

sftim commented Jun 14, 2020

@aidanranney I updated the PR description again; I hope that's OK.

@sftim
Copy link
Contributor

sftim commented Jun 14, 2020

/lgtm

#20874 (review) seems relevant and worth addressing at some point.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 14, 2020
@kbhawkey
Copy link
Contributor

Hi @aidanranney . Here is what I found regarding the anchors on the page:
The anchors.js script (in theme) is looking for the headings under main:

var article = document.getElementsByTagName('main')[0];

However, /website/layouts/partials/announcement.html also has a main element.
I renamed the main tag in announcements.html to main_stuff.
The anchors script then creates the links.
I also fiddled a bit with /website/layouts/partials/head.html (updated jquery version).

Also, does the themes/docsy directory get created as part of this PR.
I worked with this branch, but the docsy dir was empty.

@zacharysarah
Copy link
Contributor

@kbhawkey

Also, does the themes/docsy directory get created as part of this PR. I worked with this branch, but the docsy dir was empty.

Makefile contains the git clone --init --recursive <whatever syntax> command to import the theme files.

@zacharysarah
Copy link
Contributor

zacharysarah commented Jun 15, 2020

Let's aim to merge this at 12pm Pacific on Monday, 15 June. (aka tomorrow)

@sftim Let's thread these PRs to merge shortly afterwards:

@zacharysarah
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zacharysarah

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 Jun 15, 2020
@k8s-ci-robot k8s-ci-robot merged commit 0625ced into kubernetes:master Jun 15, 2020
@sftim
Copy link
Contributor

sftim commented Jun 15, 2020

Good work @aidanranney !

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. area/blog Issues or PRs related to the Kubernetes Blog subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language language/fr Issues or PRs related to French language language/id Issues or PRs related to Indonesian language language/it Issues or PRs related to Italian language language/ja Issues or PRs related to Japanese language language/ko Issues or PRs related to Korean language language/pl Issues or PRs related to Polish language language/pt Issues or PRs related to Portuguese language language/ru Issues or PRs related to Russian language language/uk Issues or PRs related to Ukrainian language language/vi Issues or PRs related to Vietnamese language language/zh Issues or PRs related to Chinese language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch website to use Docsy theme Display left-nav when JavaScript not enabled