From 647babeb169322aeb59f5c2f65e19d5d1354ff16 Mon Sep 17 00:00:00 2001 From: Steve Perry Date: Thu, 24 May 2018 13:33:32 -0700 Subject: [PATCH] Update instructions for local preview and Netlify preview. (#8692) * Update instructions for local preview. * Add details. * Added version to Hugo installation step. --- .../home/contribute/create-pull-request.md | 22 ++++- .../contribute/stage-documentation-changes.md | 90 ------------------- static/_redirects | 1 + 3 files changed, 19 insertions(+), 94 deletions(-) delete mode 100644 content/en/docs/home/contribute/stage-documentation-changes.md diff --git a/content/en/docs/home/contribute/create-pull-request.md b/content/en/docs/home/contribute/create-pull-request.md index d6c6a57516..61e7c23a36 100644 --- a/content/en/docs/home/contribute/create-pull-request.md +++ b/content/en/docs/home/contribute/create-pull-request.md @@ -47,11 +47,25 @@ that is the best fit for your content. ## Viewing your changes locally -When you submit a pull request, you can see a preview of your changes at -[Netlify](https://www.netlify.com/). If you prefer to see a preview of your changes -before you submit a pull request, you can build a preview locally. For more information, see -[Staging locally](/docs/home/contribute/stage-documentation-changes/#staging-locally-without-docker). +You can use Hugo to see a preview of your changes locally. +1. [Install Hugo](https://gohugo.io/getting-started/installing/) +version 0.40.3 or later. + +1. Go to the root directory of your clone of the Kubernetes docs, and +enter this command: + + hugo server + +1. In your browser's address bar, enter `localhost:1313`. + +## Viewing you changes in the Netlify preview + +When you submit a pull request, you can see a preview of your changes at +[Netlify](https://www.netlify.com/). In your pull request, at the bottom, +to the right of **deploy/netlify**, click **Details**. Also, there is often +a link to the Netlify preview in the pull request comments. + ## Submitting a pull request to the master branch (Current Release) If you want your change to be published in the released version Kubernetes docs, diff --git a/content/en/docs/home/contribute/stage-documentation-changes.md b/content/en/docs/home/contribute/stage-documentation-changes.md deleted file mode 100644 index ca66897fcc..0000000000 --- a/content/en/docs/home/contribute/stage-documentation-changes.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Staging Your Documentation Changes -content_template: templates/task ---- - -{{% capture overview %}} -This page shows how to stage content that you want to contribute -to the Kubernetes documentation. -{{% /capture %}} - -{{% capture prerequisites %}} -Create a fork of the Kubernetes documentation repository as described in -[Creating a Documentation Pull Request](/docs/home/contribute/create-pull-request/). -{{% /capture %}} - -{{% capture steps %}} - -## Staging a pull request - -When you create a pull request, either against the master or <vnext> -branch, your changes are staged in a custom subdomain on Netlify so that -you can see your changes in rendered form before the pull request is merged. - -1. In your GitHub account, in your new branch, submit a pull request to the -kubernetes/website repository. This opens a page that shows the -status of your pull request. - -1. Scroll down to the list of automated checks. Click **Show all checks**. -Wait for the **deploy/netlify** check to complete. To the right of -**deploy/netlify**, click **Details**. This opens a staging site where you -can see your changes. - -## Staging locally using Docker - -You can use the k8sdocs Docker image to run a local staging server. If you're -interested, you can view the -Dockerfile -for this image. - -1. Install Docker if you don't already have it. - -1. Clone your fork to your local development machine. - -1. In the root of your cloned repository, enter this command to start a local -web server: - - make stage - - This will run the following command: - - docker run -ti --rm -v "$PWD":/k8sdocs -p 4000:4000 gcr.io/google-samples/k8sdocs:1.1 - -1. View your staged content at `http://localhost:4000`. - -## Staging locally without Docker - -1. Install Ruby 2.2 or later. - -1. Install Ruby Gems. - -1. Verify that Ruby and RubyGems are installed: - - gem --version - -1. Install the GitHub Pages package, which includes Jekyll: - - gem install github-pages - -1. Clone your fork to your local development machine. - -1. In the root of your cloned repository, enter this command to start a local -web server: - - jekyll serve - -1. View your staged content at `http://localhost:4000`. - -{{< note >}} -**Note:** If you do not want Jekyll to interfere with your other globally installed gems, you can use `bundler`:

```gem install bundler```
```bundle install```
```bundler exec jekyll serve```

Regardless of whether you use `bundler` or not, your copy of the site will then be viewable at: http://localhost:4000 -{{< /note >}} - -{{% /capture %}} - -{{% capture whatsnext %}} -* Learn about [writing a new topic](/docs/home/contribute/write-new-topic/). -* Learn about [using page templates](/docs/home/contribute/page-templates/). -* Learn about [creating a pull request](/docs/home/contribute/create-pull-request/). -{{% /capture %}} - - diff --git a/static/_redirects b/static/_redirects index a823f3d8fc..1e2782722e 100644 --- a/static/_redirects +++ b/static/_redirects @@ -174,6 +174,7 @@ /docs/getting-started-guides/centos/* /docs/setup/independent/create-cluster-kubeadm/ 301 /docs/hellonode/ /docs/tutorials/stateless-application/hello-minikube/ 301 +/docs/home/contribute/stage-documentation-changes/ /docs/home/contribute/create-pull-request/ 301 /docs/home/coreos/ /docs/getting-started-guides/coreos/ 301 /docs/home/deprecation-policy/ /docs/reference/using-api/deprecation-policy/ 301 /docs/reference/deprecation-policy/ /docs/reference/using-api/deprecation-policy/ 301