+2
-2
handlers/routes.go
+2
-2
handlers/routes.go
+8
-4
html/layouts/default.templ
+8
-4
html/layouts/default.templ
···
3
import "net/http"
4
import "github.com/puregarlic/space/storage"
5
6
-
func RenderDefault(page templ.Component) http.Handler {
7
rels := storage.GetRels()
8
-
document := Default(page, rels)
9
10
return templ.Handler(document)
11
}
12
13
-
templ Default(body templ.Component, rels []*storage.RelEntry) {
14
<!DOCTYPE html>
15
<html>
16
<head>
17
-
<title>puregarlic dot space</title>
18
<meta name="viewport" content="width=device-width, initial-scale=1" />
19
<link rel="preconnect" href="https://fonts.googleapis.com" />
20
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
···
3
import "net/http"
4
import "github.com/puregarlic/space/storage"
5
6
+
func RenderDefault(title string, page templ.Component) http.Handler {
7
rels := storage.GetRels()
8
+
document := Default(title, page, rels)
9
10
return templ.Handler(document)
11
}
12
13
+
templ Default(title string, body templ.Component, rels []*storage.RelEntry) {
14
<!DOCTYPE html>
15
<html>
16
<head>
17
+
if len(title) > 0 {
18
+
<title>{title} | puregarlic dot space</title>
19
+
} else {
20
+
<title>puregarlic dot space</title>
21
+
}
22
<meta name="viewport" content="width=device-width, initial-scale=1" />
23
<link rel="preconnect" href="https://fonts.googleapis.com" />
24
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+39
-11
html/layouts/default_templ.go
+39
-11
html/layouts/default_templ.go
···
11
import "net/http"
12
import "github.com/puregarlic/space/storage"
13
14
-
func RenderDefault(page templ.Component) http.Handler {
15
rels := storage.GetRels()
16
-
document := Default(page, rels)
17
18
return templ.Handler(document)
19
}
20
21
-
func Default(body templ.Component, rels []*storage.RelEntry) templ.Component {
22
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
23
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
24
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
···
36
templ_7745c5c3_Var1 = templ.NopComponent
37
}
38
ctx = templ.ClearChildren(ctx)
39
-
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html><head><title>puregarlic dot space</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin><link href=\"https://fonts.googleapis.com/css2?family=Recursive:slnt,wght,CASL,CRSV,MONO@-15..0,300..1000,0..1,0..1,0..1&display=swap\" rel=\"stylesheet\">")
40
if templ_7745c5c3_Err != nil {
41
return templ_7745c5c3_Err
42
}
43
-
for _, rel := range rels {
44
-
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"")
45
if templ_7745c5c3_Err != nil {
46
return templ_7745c5c3_Err
47
}
48
var templ_7745c5c3_Var2 string
49
-
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(rel.Name)
50
if templ_7745c5c3_Err != nil {
51
-
return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/layouts/default.templ`, Line: 24, Col: 28}
52
}
53
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
54
if templ_7745c5c3_Err != nil {
55
return templ_7745c5c3_Err
56
}
57
-
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" href=\"")
58
if templ_7745c5c3_Err != nil {
59
return templ_7745c5c3_Err
60
}
61
var templ_7745c5c3_Var3 string
62
-
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(rel.HREF)
63
if templ_7745c5c3_Err != nil {
64
-
return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/layouts/default.templ`, Line: 24, Col: 46}
65
}
66
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
67
if templ_7745c5c3_Err != nil {
68
return templ_7745c5c3_Err
69
}
···
11
import "net/http"
12
import "github.com/puregarlic/space/storage"
13
14
+
func RenderDefault(title string, page templ.Component) http.Handler {
15
rels := storage.GetRels()
16
+
document := Default(title, page, rels)
17
18
return templ.Handler(document)
19
}
20
21
+
func Default(title string, body templ.Component, rels []*storage.RelEntry) templ.Component {
22
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
23
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
24
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
···
36
templ_7745c5c3_Var1 = templ.NopComponent
37
}
38
ctx = templ.ClearChildren(ctx)
39
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html><head>")
40
if templ_7745c5c3_Err != nil {
41
return templ_7745c5c3_Err
42
}
43
+
if len(title) > 0 {
44
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<title>")
45
if templ_7745c5c3_Err != nil {
46
return templ_7745c5c3_Err
47
}
48
var templ_7745c5c3_Var2 string
49
+
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
50
if templ_7745c5c3_Err != nil {
51
+
return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/layouts/default.templ`, Line: 18, Col: 21}
52
}
53
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
54
if templ_7745c5c3_Err != nil {
55
return templ_7745c5c3_Err
56
}
57
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" | puregarlic dot space</title>")
58
+
if templ_7745c5c3_Err != nil {
59
+
return templ_7745c5c3_Err
60
+
}
61
+
} else {
62
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<title>puregarlic dot space</title>")
63
+
if templ_7745c5c3_Err != nil {
64
+
return templ_7745c5c3_Err
65
+
}
66
+
}
67
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin><link href=\"https://fonts.googleapis.com/css2?family=Recursive:slnt,wght,CASL,CRSV,MONO@-15..0,300..1000,0..1,0..1,0..1&display=swap\" rel=\"stylesheet\">")
68
+
if templ_7745c5c3_Err != nil {
69
+
return templ_7745c5c3_Err
70
+
}
71
+
for _, rel := range rels {
72
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"")
73
if templ_7745c5c3_Err != nil {
74
return templ_7745c5c3_Err
75
}
76
var templ_7745c5c3_Var3 string
77
+
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(rel.Name)
78
if templ_7745c5c3_Err != nil {
79
+
return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/layouts/default.templ`, Line: 28, Col: 28}
80
}
81
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
82
+
if templ_7745c5c3_Err != nil {
83
+
return templ_7745c5c3_Err
84
+
}
85
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" href=\"")
86
+
if templ_7745c5c3_Err != nil {
87
+
return templ_7745c5c3_Err
88
+
}
89
+
var templ_7745c5c3_Var4 string
90
+
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(rel.HREF)
91
+
if templ_7745c5c3_Err != nil {
92
+
return templ.Error{Err: templ_7745c5c3_Err, FileName: `html/layouts/default.templ`, Line: 28, Col: 46}
93
+
}
94
+
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
95
if templ_7745c5c3_Err != nil {
96
return templ_7745c5c3_Err
97
}
+1
-1
services/indieauth.go
+1
-1
services/indieauth.go