This commit is contained in:
1 parent
297efaa4a6
commit
812891a205
7 files changed
+36
-15
No files matched your search
@@ -27,7 +27,7 @@ func (h *Handler) gallery(w http.ResponseWriter, r *http.Request) {
|
||||
ctx = templer.AppendHeader(ctx, fmt.Sprintf(`<link rel="preload" href="%s?w=800" as="image" />`, image.URL()))
|
||||
}
|
||||
|
||||
h.r.Render(ctx, w, r, pages.GallerySet(imgs))
|
||||
h.r.RenderPage(ctx, w, r, pages.GallerySet(imgs))
|
||||
}
|
||||
|
||||
func (h *Handler) image(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -41,5 +41,5 @@ func (h *Handler) image(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
h.r.Render(r.Context(), w, r, pages.GalleryImage(uid, next, prev))
|
||||
h.r.RenderComponent(r.Context(), w, r, pages.GalleryImage(uid, next, prev))
|
||||
}
|
||||
@@ -40,5 +40,6 @@ type galleryService interface {
|
||||
GetPrevAndNext(ctx context.Context, uid string) (previous *gallery.Image, next *gallery.Image, err error)
|
||||
}
|
||||
type renderer interface {
|
||||
Render(ctx context.Context, w io.Writer, r *http.Request, component templ.Component)
|
||||
RenderPage(ctx context.Context, w io.Writer, r *http.Request, component templ.Component)
|
||||
RenderComponent(ctx context.Context, w io.Writer, r *http.Request, component templ.Component)
|
||||
}
|
||||
@@ -17,7 +17,7 @@ func (h *Handler) home(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
h.r.Render(r.Context(), w, r, pages.Home(pageHeaders))
|
||||
h.r.RenderPage(r.Context(), w, r, pages.Home(pageHeaders))
|
||||
}
|
||||
|
||||
func (h *Handler) page(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -43,5 +43,5 @@ func (h *Handler) page(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
ctx = templer.PageTitle(ctx, page.Title)
|
||||
|
||||
h.r.Render(ctx, w, r, pages.ContentPage(page))
|
||||
h.r.RenderPage(ctx, w, r, pages.ContentPage(page))
|
||||
}
|
||||
@@ -33,5 +33,5 @@ type pageService interface {
|
||||
GetPage(ctx context.Context, uid string) (page.Page, error)
|
||||
}
|
||||
type renderer interface {
|
||||
Render(ctx context.Context, w io.Writer, r *http.Request, component templ.Component)
|
||||
RenderPage(ctx context.Context, w io.Writer, r *http.Request, component templ.Component)
|
||||
}
|
||||
Reference in new issue
Block a user