diff --git a/LICENSE b/LICENSE index d101e81..02c2453 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2018, Jon Betti -Copyright (c) 2023, Izuru Yakumo +Copyright (c) 2023-2025, Izuru Yakumo Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice diff --git a/Makefile b/Makefile index 903799b..f3415bb 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,13 @@ GO ?= go -GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=$(VERSION) -X `go list`.Commit=$(COMMIT) -X `go list`.Build=$(BUILD)" -tags "static_build" +GOFLAGS ?= -v -ldflags "-w -X `${GO} list`.Version=${VERSION} -X `${GO} list`.Build=${BUILD}" PREFIX ?= /usr/local -VERSION = `git describe --abbrev=0 --tags 2>/dev/null || echo "$VERSION"` -COMMIT = `git rev-parse --short HEAD || echo "$COMMIT"` -BRANCH = `git rev-parse --abbrev-ref HEAD` -BUILD = `git show -s --pretty=format:%cI` - GOARCH ?= amd64 GOOS ?= linux +VERSION = 0.4.0 +BUILD = `date +%Y-%m-%d:%H:%M:%S%z` + all: toyohime toyohime: @@ -17,10 +15,10 @@ toyohime: clean: rm toyohime install: - install -m0755 toyohime ${DESTDIR}${PREFIX}/bin/yorihime - install -Dm0044 toyohime.1 ${DESTDIR}${PREFIX}/share/man/man1/toyohime.1 + install -m0755 toyohime ${DESTDIR}${PREFIX}/bin/toyohime + install -Dm0044 toyohime.1 ${DESTDIR}${PREFIX}/man/man1/toyohime.1 test: ${GO} test . uninstall: rm -f ${DESTDIR}${PREFIX}/bin/toyohime - rm -f ${DESTDIR}${PREFIX}/share/man/man1/toyohime.1 + rm -f ${DESTDIR}${PREFIX}/man/man1/toyohime.1 diff --git a/README.md b/README.md index 08a2111..ea64667 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,10 @@ BitBucket, etc.). A commonly used vanity import path is * Redirects pkg.go.dev to browsable files ## Installation +Requires Go >=1.16 ```bash -go install marisa.chaotic.ninja/toyohime/cmd/toyohime@latest +go install mahou-no-mori.yakumo.dev/toyohime/cmd/toyohime@latest ``` ## Specification diff --git a/cmd/toyohime/main.go b/cmd/toyohime/main.go index 2204d40..c440a2c 100644 --- a/cmd/toyohime/main.go +++ b/cmd/toyohime/main.go @@ -27,6 +27,7 @@ package main // go.jonnrb.io/vanity import ( "bufio" "bytes" + _ "embed" "flag" "fmt" "html/template" @@ -38,7 +39,7 @@ import ( "strings" "time" - "marisa.chaotic.ninja/toyohime" + "mahou-no-mori.yakumo.dev/toyohime" ) var ( @@ -53,6 +54,9 @@ var ( reposPath string = "repos" // param 2 ) +//go:embed templates/index.tmpl +var IndexPage string + func serveRepo(mux *http.ServeMux, root string, u *url.URL) { vcsScheme, vcsHost := u.Scheme, u.Host @@ -107,78 +111,8 @@ func addRepoHandlers(mux *http.ServeMux, r io.Reader) error { } var b bytes.Buffer - err := template.Must(template.New("").Parse(` - - -
-でホストされているインポート パス {{ html $host }}
-
-
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-*
-
- |
-{{ html $root }}-Package-Repository -{{ else }} -Nothing here. -{{ end }} - |
~から明らかに盗まれた azukifont.com
-でホストされているインポート パス {{ html $host }}
+
+
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+*
+
+ |
+{{ html $root }}+Package+Repository +{{ else }} +Nothing here. +{{ end }} + |
~から明らかに盗まれた azukifont.com
+