diff --git a/README.md b/README.md index efb1d413f2..18bebacdcf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Contributing to the Kubernetes Documentation and Website +## Instructions for Contributing to the Docs/Website -Welcome! We are very pleased you want to contribute to Kubernetes. +Welcome! We are very pleased you want to contribute to the documentation and/or website for Kubernetes. You can click the "Fork" button in the upper-right area of the screen to create a copy of our site on your GitHub account called a "fork." Make any changes you want in your fork, and when you are ready to send those changes to us, go to the index page for your fork and click "New Pull Request" to let us know about it. @@ -13,7 +13,7 @@ Then, visit: [http://YOUR_GITHUB_USERNAME.github.io](http://YOUR_GITHUB_USERNAME You should see a special-to-you version of the site. -## Running the site locally +## Editing/staging the site locally If you have files to upload, or just want to work offline, run the below commands to setup your environment for running GitHub pages locally. Then, any edits you make will be viewable @@ -45,12 +45,12 @@ Clone our site git clone https://github.com/kubernetes/kubernetes.github.io.git -Then, to see it run locally: +Make any changes you want. Then, to see your changes locally: cd kubernetes.github.io jekyll serve -Your copy of the site will then be viewable at: [http://0.0.0.0:4000](http://0.0.0.0:4000) +Your copy of the site will then be viewable at: [http://localhost:4000](http://localhost:4000) (or wherever Ruby tells you). If you're a bit rusty with git/GitHub, you might wanna read @@ -60,6 +60,56 @@ The above instructions work on Mac and Linux. [These instructions ](https://martinbuberl.com/blog/setup-jekyll-on-windows-and-host-it-on-github-pages/) might help for Windows users. +## Common Tasks + +### Edit Page Titles or Change the Left Navigation + +Edit the yaml files in `/_data/` for the Guides, Reference, Samples, or Support areas. + +### Add Images + +Put the new image in `/images/docs/` if it's for the documentation, and just `/images/` if it's for the website. + +### Include code from another file + +To include a file that is hosted on this GitHub repo, insert this code: + +
{% include code.html language="<LEXERVALUE>" file="<RELATIVEPATH>" ghlink="<PATHFROMROOT>" %}
+
+* `LEXERVALUE`: The language in which the file was written; must be [a value supported by Rouge](https://github.com/jneen/rouge/wiki/list-of-supported-languages-and-lexers).
+* `RELATIVEPATH`: The path to the file you're including, relative to the current file.
+* `PATHFROMROOT`: The path to the file relative to root, e.g. `/docs/admin/foo.yaml`
+
+To include a file that is hosted in the external, main Kubernetes repo, make sure it's added to [/update-imported-docs.sh](https://github.com/kubernetes/kubernetes.github.io/blob/master/update-imported-docs.sh), and run it so that the file gets downloaded, then enter:
+
+{% include code.html language="<LEXERVALUE>" file="<RELATIVEPATH>" k8slink="<PATHFROMK8SROOT>" %}
+
+* `PATHFROMK8SROOT`: The path to the file relative to the root of [the Kubernetes repo](https://github.com/kubernetes/kubernetes/tree/release-1.2), e.g. `/examples/rbd/foo.yaml`
+
+## Use a global variable
+
+The `/_config.yml` file defines some useful variables you can use when editing docs.
+
+* `page.githubbranch`: The name of the GitHub branch on the Kubernetes repo that is associated with this branch of the docs. e.g. `release-1.2`
+* `page.version` The version of Kubernetes associated with this branch of the docs. e.g. `v1.2`
+* `page.docsbranch` The name of the GitHub branch on the Docs/Website repo that you are currently using. e.g. `release-1.1` or `master`
+
+This keeps the docs you're editing aligned with the Kubernetes version you're talking about. For example, if you define a link like so, you'll never have to worry about it going stale in future doc branches:
+
+View the README [here](http://releases.k8s.io/{{page.githubbranch}}/cluster/addons/README.md).
+
+That, of course, will send users to:
+
+[http://releases.k8s.io/release-1.2/cluster/addons/README.md](http://releases.k8s.io/release-1.2/cluster/addons/README.md)
+
+(Or whatever Kubernetes release that docs branch is associated with.)
+
+## Branch structure
+
+The current version of the website is served out of the `master` branch.
+
+All versions of the site that relate to past and future versions will be named after their Kubernetes release number. For example, [the old branch for the 1.1 docs is called `release-1.1`](https://github.com/kubernetes/kubernetes.github.io/tree/release-1.1).
+
## Thank you!
Kubernetes thrives on community participation and we really appreciate your
diff --git a/_data/support.yml b/_data/support.yml
index 063293deae..6b7daa8e3f 100644
--- a/_data/support.yml
+++ b/_data/support.yml
@@ -41,4 +41,4 @@ toc:
- title: Release Roadmap
path: https://github.com/kubernetes/kubernetes/milestones/
- title: Contributing to Kubernetes Documentation
- path: /docs/editdocs/
+ path: /editdocs/
diff --git a/_layouts/docwithnav.html b/_layouts/docwithnav.html
index e84481ad6f..e4b7395d02 100755
--- a/_layouts/docwithnav.html
+++ b/_layouts/docwithnav.html
@@ -32,7 +32,7 @@
diff --git a/docs/editdocs.md b/docs/editdocs.md
deleted file mode 100644
index f0f4653f02..0000000000
--- a/docs/editdocs.md
+++ /dev/null
@@ -1,115 +0,0 @@
----
----
-Welcome! We are very pleased you want to contribute to the docs for Kubernetes.
-
-
-
- -
Click the below link to edit the page you were just on. When you are done, press "Commit Changes" at the bottom of the screen. This will create a copy of our site on your GitHub account called a "fork." You can make other changes in your fork after it is created, if you want. When you are ready to send us all your changes, go to the index page for your fork and click "New Pull Request" to let us know about it.
- - - -Click the below button to visit the repo for our site. You can then click the "Fork" button in the upper-right area of the screen to create a copy of our site on your GitHub account called a "fork." Make any changes you want in your fork, and when you are ready to send those changes to us, go to the index page for your fork and click "New Pull Request" to let us know about it.
- - - -The docs for Kubernetes are open-source, just like the code for Kubernetes itself. The docs are on GitHub Pages, so you can fork it and it will auto-stage on username.github.io, previewing your changes!
- Write Docs for K8s + Write Docs for K8s+ +
Click the below link to edit the page you were just on. When you are done, press "Commit Changes" at the bottom of the screen. This will create a copy of our site on your GitHub account called a "fork." You can make other changes in your fork after it is created, if you want. When you are ready to send us all your changes, go to the index page for your fork and click "New Pull Request" to let us know about it.
+ + + +Click the below button to visit the repo for our site. You can then click the "Fork" button in the upper-right area of the screen to create a copy of our site on your GitHub account called a "fork." Make any changes you want in your fork, and when you are ready to send those changes to us, go to the index page for your fork and click "New Pull Request" to let us know about it.
+ + + +