doc: Use latest content

This commit is contained in:
Hajime Hoshi 2016-08-28 02:17:00 +09:00
parent 8110ddda94
commit 2787fd0aeb
18 changed files with 19 additions and 29 deletions

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = '{{.Example.Name}}.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/{{.CurrentBranch}}/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -97,15 +97,6 @@ func init() {
stableVersion = lastStableVersion
}
func currentBranch() string {
r, err := ioutil.ReadFile("../.git/HEAD")
if err != nil {
panic(err)
}
rr := strings.TrimSpace(string(r))
return regexp.MustCompile(`^ref: refs/heads/(.+)$`).FindStringSubmatch(rr)[1]
}
func init() {
b, err := exec.Command("git", "show", "master:version.txt").Output()
if err != nil {
@ -300,9 +291,8 @@ func outputExampleContent(e *example) error {
}
data := map[string]interface{}{
"Copyright": copyright,
"CurrentBranch": currentBranch(),
"Example": e,
"Copyright": copyright,
"Example": e,
}
if err := t.Funcs(funcs).Execute(f, data); err != nil {
return err

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'alphablending.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'audio.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'blocks.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'font.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'gamepad.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'hsv.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'hue.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'keyboard.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'masking.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'mosaic.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'noise.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'paint.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'perspective.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'piano.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'rotate.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);

View File

@ -16,7 +16,7 @@ window.addEventListener('load', function() {
var s = document.createElement('script');
var src = 'sprites.js';
if (isProduction()) {
src = '//hajimehoshi.github.io/ebiten.pagestorage/master/' + src;
src = '//hajimehoshi.github.io/ebiten.pagestorage/latest/' + src;
}
s.src = src;
document.body.appendChild(s);