You've already forked go-url-shortener
Update
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package err
|
||||
|
||||
import "github.com/zhang2092/go-url-shortener/internal/templ/base"
|
||||
import (
|
||||
"github.com/zhang2092/go-url-shortener/internal/templ/base"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
templ Error404() {
|
||||
@base.Base() {
|
||||
templ Error404(r *http.Request) {
|
||||
@base.Base(r, nil, nil) {
|
||||
<h1>404</h1>
|
||||
<p>当前短路径已经失效</p>
|
||||
}
|
||||
|
||||
@@ -8,9 +8,12 @@ package err
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import "github.com/zhang2092/go-url-shortener/internal/templ/base"
|
||||
import (
|
||||
"github.com/zhang2092/go-url-shortener/internal/templ/base"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Error404() templ.Component {
|
||||
func Error404(r *http.Request) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
@@ -49,7 +52,7 @@ func Error404() templ.Component {
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = base.Base().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = base.Base(r, nil, nil).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user