Skip to content

Commit

Permalink
Don't show the autogenerated code for serve
Browse files Browse the repository at this point in the history
Looks ugly; the only reason there's a value there in the first place is
because of the SQL constraint on the column.
  • Loading branch information
arp242 committed May 28, 2020
1 parent bc48d48 commit 94aa265
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pack/pack.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions site.go
Expand Up @@ -379,6 +379,14 @@ func (s Site) Domain() string {
return cfg.Domain
}

// Display format: just the domain (cname or code+domain).
func (s Site) Display() string {
if s.Cname != nil {
return *s.Cname
}
return fmt.Sprintf("%s.%s", s.Code, zhttp.RemovePort(cfg.Domain))
}

// URL to this site.
func (s Site) URL() string {
if s.Cname != nil {
Expand Down
2 changes: 1 addition & 1 deletion tpl/_backend_top.gohtml
Expand Up @@ -3,7 +3,7 @@
<head>
{{template "_favicon.gohtml" .}}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{{.Site.Code}} – GoatCounter</title>
<title>{{if .GoatcounterCom}}{{.Site.Code}} – {{end}}GoatCounter</title>
<link rel="stylesheet" href="{{.Static}}/all.min.css?v={{.Version}}">
<link rel="stylesheet" href="{{.Static}}/pikaday.css?v={{.Version}}">
<link rel="stylesheet" href="{{.Static}}/style_backend.css?v={{.Version}}">
Expand Down
2 changes: 1 addition & 1 deletion tpl/user.gohtml
@@ -1,6 +1,6 @@
{{template "_backend_top.gohtml" .}}

<h1>Sign in at {{.Site.Code}}</h1>
<h1>Sign in at {{.Site.Display}}</h1>
{{template "_backend_signin.gohtml" .}}

{{template "_backend_bottom.gohtml" .}}

0 comments on commit 94aa265

Please sign in to comment.