docs: Update

This commit is contained in:
Hajime Hoshi 2018-07-28 19:00:05 +09:00
parent da662b384c
commit 88e488a5a6
3 changed files with 4 additions and 25 deletions

View File

@ -27,29 +27,20 @@ import (
"strconv"
"strings"
"sync"
"github.com/hajimehoshi/ebiten/internal"
)
const (
url = "https://hajimehoshi.github.io/ebiten/"
url = "https://hajimehoshi.github.io/ebiten/"
licenseYear = 2013
)
var (
examplesDir = filepath.Join("public", "examples")
copyright = ""
copyright = fmt.Sprintf("© %d Hajime Hoshi", licenseYear)
stableVersion = ""
devVersion = ""
)
func init() {
year, err := internal.LicenseYear()
if err != nil {
panic(err)
}
copyright = fmt.Sprintf("© %d Hajime Hoshi", year)
}
func init() {
b, err := exec.Command("git", "tag").Output()
if err != nil {

View File

@ -35,7 +35,7 @@
</div></header>
<main><div class="container">
<p>Stable version: v1.7.1 / Development version: v1.8.0-alpha</p>
<p>Stable version: v1.7.2 / Development version: v1.8.0-alpha</p>
<h2 id="platforms">Platforms</h2>
<dl class="row">

View File

@ -40,15 +40,3 @@ func LicenseComment() (string, error) {
lines := strings.Split(license, "\n")
return "// " + strings.Join(lines[:len(lines)-1], "\n// "), nil
}
func LicenseYear() (int, error) {
license, err := LicenseComment()
if err != nil {
return 0, err
}
year, err := strconv.Atoi(regexp.MustCompile(`^// Copyright (\d+)`).FindStringSubmatch(license)[1])
if err != nil {
return 0, err
}
return year, nil
}