View $PAGE on Github without forking the repo

Adding a "View docs/bla-bla.md on GitHub" button next to the
"Edit docs/bla-bla.md" button so that people can view the file
first without clicking the Edit button (which does not work without
forking the repository).

I did not need this because I was trying to do something without
forking. I just found it to be bit difficult to view source of a page
on GitHub.

I'm open to ideas, perhaps we can instead add an article footer button
named "View on GitHub" next to the "Edit this Page".

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
reviewable/pr2924/r1
Ahmet Alp Balkan 2017-03-20 12:49:47 -07:00
parent 6f8c97f4d2
commit 7cdcff7813
No known key found for this signature in database
GPG Key ID: 5C02521D7B216AD6
1 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,8 @@ $( document ).ready(function() {
$("#continueEdit").show();
$("#continueEditButton").text("Edit " + forwarding);
$("#continueEditButton").attr("href", "https://github.com/kubernetes/kubernetes.github.io/edit/master/" + forwarding)
$("#viewOnGithubButton").text("View " + forwarding + " on GitHub");
$("#viewOnGithubButton").attr("href", "https://github.com/kubernetes/kubernetes.github.io/tree/master/" + forwarding)
} else {
$("#generalInstructions").show();
$("#continueEdit").hide();
@ -26,6 +28,7 @@ $( document ).ready(function() {
<p>Click the button below to edit the page you were just on. When you are done, click <b>Commit Changes</b> at the bottom of the screen. This creates a copy of our site in your GitHub account called a <i>fork</i>. 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 <b>New Pull Request</b> to let us know about it.</p>
<p><a id="continueEditButton" class="button"></a></p>
<p><a id="viewOnGithubButton" class="button"></a></p>
</div>
<div id="generalInstructions">