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

View File

@ -35,7 +35,7 @@
</div></header> </div></header>
<main><div class="container"> <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> <h2 id="platforms">Platforms</h2>
<dl class="row"> <dl class="row">

View File

@ -40,15 +40,3 @@ func LicenseComment() (string, error) {
lines := strings.Split(license, "\n") lines := strings.Split(license, "\n")
return "// " + strings.Join(lines[:len(lines)-1], "\n// "), nil 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
}