parent
822bb61a99
commit
52e0d73526
18
Makefile
18
Makefile
|
@ -1,22 +1,20 @@
|
|||
.PHONY: all clean build
|
||||
.PHONY: all clean build install
|
||||
|
||||
all: build
|
||||
|
||||
build-all: build
|
||||
|
||||
build:
|
||||
go build -trimpath -o ii-tool ./ii-tool
|
||||
go build -trimpath -o ii-node ./ii-node
|
||||
go build -trimpath -o ii-gemini ./ii-gemini
|
||||
go build -trimpath -o ii-tool ./cmd/ii-tool
|
||||
go build -trimpath -o ii-node ./cmd/ii-node
|
||||
go build -trimpath -o ii-gemini ./cmd/ii-gemini
|
||||
|
||||
install-all: install
|
||||
|
||||
install:
|
||||
go install ./ii-tool
|
||||
go install ./ii-node
|
||||
go install ./ii-gemini
|
||||
go install ./cmd/ii-tool
|
||||
go install ./cmd/ii-node
|
||||
go install ./cmd/ii-gemini
|
||||
|
||||
clean:
|
||||
cd ii-node && go clean
|
||||
cd ii-tool && go clean
|
||||
cd ii-gemini && go clean
|
||||
rm -f ii-node ii-tool ii-gemini
|
||||
|
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"git.openbsd.org.ru/vasyahacker/ii-go/ii"
|
||||
"os"
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
|
@ -911,7 +912,19 @@ func WebInit(www *WWW) {
|
|||
return false
|
||||
},
|
||||
}
|
||||
www.tpl = template.Must(template.New("main").Funcs(funcMap).ParseGlob("tpl/*.tpl"))
|
||||
|
||||
tpl_path := "tpl"
|
||||
if _, err := os.Stat(tpl_path); errors.Is(err, os.ErrNotExist) {
|
||||
fmt.Println("./tpl dir not exist")
|
||||
tpl_path = "/usr/local/share/ii-go/tpl"
|
||||
if _, err := os.Stat(tpl_path); errors.Is(err, os.ErrNotExist) {
|
||||
fmt.Println(tpl_path, "dir not exist")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
www.tpl = template.Must(
|
||||
template.New("main").Funcs(funcMap).ParseGlob(tpl_path + "/*.tpl"))
|
||||
}
|
||||
|
||||
func handleErr(ctx *WebContext, w http.ResponseWriter, err error) {
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
@ -4,8 +4,8 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width; initial-scale=1.0">
|
||||
<link rel="icon" href="/lib/icon.png" type="image/png">
|
||||
<link rel="stylesheet" type="text/css" href="/lib/style.css">
|
||||
<link rel="icon" href="/style/icon.png" type="image/png">
|
||||
<link rel="stylesheet" type="text/css" href="/style/style.css">
|
||||
{{ if eq .Template "query.tpl" }}<link href="{{.PfxPath}}/{{.BasePath}}/rss" type="application/rss+xml" rel="alternate" title="{{.Sysname}} {{.BasePath}} :: RSS feed" />{{ end }}
|
||||
{{ if eq .Template "blog.tpl" }}<link href="{{.PfxPath}}/{{.BasePath}}+topics/rss" type="application/rss+xml" rel="alternate" title="{{.Sysname}} {{.BasePath}} :: RSS feed" />{{ end }}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
|||
<table id="header">
|
||||
<tr>
|
||||
<td class="title">
|
||||
<span class="logo"><a href="/"><img class="logo" src="/lib/icon.png">{{.Sysname}}</a></span>
|
||||
<span class="logo"><a href="/"><img class="logo" src="/style/icon.png">{{.Sysname}}</a></span>
|
||||
{{ if eq .BasePath "" }}
|
||||
<span class="info">II/IDEC networks :: <a href="{{ $.PfxPath }}/echo/all">New posts</a>
|
||||
{{ else if gt (len .Topics) 0}}
|
Loading…
Reference in New Issue