Compare commits

...

3 commits

Author SHA1 Message Date
cf03c723d0
Merge branch 'main' of forge:ari/indir 2026-03-16 18:30:16 +00:00
7aef1a8012
update old domain 2026-03-16 18:29:09 +00:00
6708d9ff33
add makefile 2025-06-08 21:40:19 +01:00
5 changed files with 35 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.DS_Store
tmp
indir
indir-*

28
Makefile Normal file
View file

@ -0,0 +1,28 @@
GOOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOARCH := $(shell uname -m)
TRIPLE := $(GOOS)-$(GOARCH)
.PHONY: build
build:
go build -o indir-$(TRIPLE) .
ln -sf ./indir-$(TRIPLE) ./indir
build-multiplatform: indir-linux-amd64 indir-darwin-arm64
indir-linux-amd64:
GOOS=linux GOARCH=amd64 go build -o ./indir-linux-amd64 .
indir-darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -o ./indir-darwin-arm64 .
clean:
rm -rf \
./indir \
./indir-$(TRIPLE) \
./indir-darwin-arm64 \
./indir-linux-amd64
install: build
cp ./indir-$(TRIPLE) /usr/local/bin/indir
chmod +x /usr/local/bin/indir

2
go.mod
View file

@ -1,3 +1,3 @@
module git.arimelody.me/ari/indir
module forge.arimelody.space/ari/indir
go 1.24.3

View file

@ -15,6 +15,9 @@ import (
_ "embed"
)
//go:embed templates/dir.html
var dirTemplateSrc string
type (
Directory struct {
Name string
@ -101,7 +104,7 @@ func main() {
".DS_Store",
}
dirTemplate, err := template.New("dir").Parse(dirHTML)
dirTemplate, err := template.New("dir").Parse(dirTemplateSrc)
if err != nil {
fmt.Fprintf(os.Stderr, "fatal: failed to parse directory template: %v\n", err)
os.Exit(1)

View file

@ -101,7 +101,7 @@ footer {
<hr>
</main>
<footer>
<em>made with <span aria-label="love"></span> by ari, 2025 <a href="https://git.arimelody.me/ari/indir" target="_blank">[source]</a></em>
<em>made with <span aria-label="love"></span> by ari, 2025 <a href="https://forge.arimelody.space/ari/indir" target="_blank">[source]</a></em>
</footer>
</body>
</html>