diff --git a/routes.go b/routes.go index a59d7c2..1eba995 100644 --- a/routes.go +++ b/routes.go @@ -109,12 +109,14 @@ var funcMap = template.FuncMap{ if err := md.Convert([]byte(body), &buf); err != nil { panic(err) } - converted := strings.Replace(buf.String(), `href="https://`+host, `href="/`+host, -1) + converted := buf.String() converted = strings.Replace(converted, ` 0 { state.Alert = m["alert"][0] diff --git a/templates/login.html b/templates/login.html index f59d3af..9b7fd28 100644 --- a/templates/login.html +++ b/templates/login.html @@ -11,11 +11,10 @@ - all | - {{ $last := (sub (len .TopCommunities) 1) }} {{ $host := .Host }} {{ range $i, $c := .TopCommunities}} {{$c.Community.Name}} - {{ if ne $i $last }} - {{end}} + - {{ end }} more » @@ -54,7 +53,7 @@ email
- {{ if and .Site (eq .Site.SiteView.LocalSite.RegistrationMode "requireapplication") }} + {{ if and .Site (or (eq .Site.SiteView.LocalSite.RegistrationMode "RequireApplication") (eq .Site.SiteView.LocalSite.RegistrationMode "requireapplication")) }}
{{ markdown .Host .Site.SiteView.LocalSite.ApplicationQuestion.String }}
diff --git a/templates/main.html b/templates/main.html index 1733749..cb5714a 100644 --- a/templates/main.html +++ b/templates/main.html @@ -1,6 +1,6 @@ - {{if ne .PostID 0}}{{ (index .Posts 0).Post.Name}} : {{.CommunityName}}{{else if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ .Host }}{{end}} + {{if and .Posts .PostID }}{{ (index .Posts 0).Post.Name}} : {{.CommunityName}}{{else if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ .Host }}{{end}} @@ -67,7 +67,7 @@ {{ template "create_post.html" . }} {{ end }} -{{ if .PostID }} +{{ if and .PostID .Posts}} {{ if .CommentID}}
you are viewing a single comment's thread
view the rest of the comments diff --git a/templates/nav.html b/templates/nav.html index 7fcca7a..8b237cd 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -4,11 +4,10 @@ - all | - {{ $last := (sub (len .TopCommunities) 1) }} {{ $host := .Host }} {{ range $i, $c := .TopCommunities}} {{$c.Community.Name}} - {{ if ne $i $last }} - {{end}} + - {{ end }} more »
diff --git a/templates/sidebar.html b/templates/sidebar.html index 449fcf8..6da0c47 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -40,7 +40,7 @@ {{ end }} -{{ if .PostID }} +{{ if and .PostID .Posts }}
this post was submitted on {{ (index .Posts 0).Post.Published.Time.Format "01 Jan 2006" }}
{{ (index .Posts 0).Counts.Score }} points ({{likedPerc (index .Posts 0).Counts}}% liked)