github.com/ngsalvo/datastar-rick-and-morty@v0.0.0-20250318143428-01c52f047cfc/web/pages/home_templ.go (about)

     1  // Code generated by templ - DO NOT EDIT.
     2  
     3  // templ: version: v0.3.819
     4  package pages
     5  
     6  //lint:file-ignore SA4006 This context is only used if a nested component is present.
     7  
     8  import "github.com/a-h/templ"
     9  import templruntime "github.com/a-h/templ/runtime"
    10  
    11  import "github.com/ngsalvo/datastar-rick-and-morty/web/layouts"
    12  
    13  func Home() templ.Component {
    14  	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
    15  		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
    16  		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
    17  			return templ_7745c5c3_CtxErr
    18  		}
    19  		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
    20  		if !templ_7745c5c3_IsBuffer {
    21  			defer func() {
    22  				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
    23  				if templ_7745c5c3_Err == nil {
    24  					templ_7745c5c3_Err = templ_7745c5c3_BufErr
    25  				}
    26  			}()
    27  		}
    28  		ctx = templ.InitializeContext(ctx)
    29  		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
    30  		if templ_7745c5c3_Var1 == nil {
    31  			templ_7745c5c3_Var1 = templ.NopComponent
    32  		}
    33  		ctx = templ.ClearChildren(ctx)
    34  		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
    35  			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
    36  			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
    37  			if !templ_7745c5c3_IsBuffer {
    38  				defer func() {
    39  					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
    40  					if templ_7745c5c3_Err == nil {
    41  						templ_7745c5c3_Err = templ_7745c5c3_BufErr
    42  					}
    43  				}()
    44  			}
    45  			ctx = templ.InitializeContext(ctx)
    46  			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"flex flex-col h-screen items-center justify-center\"><h1 class=\"text-primary\">Rick & Morty</h1></div>")
    47  			if templ_7745c5c3_Err != nil {
    48  				return templ_7745c5c3_Err
    49  			}
    50  			return nil
    51  		})
    52  		templ_7745c5c3_Err = layouts.Page("Add some page title").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
    53  		if templ_7745c5c3_Err != nil {
    54  			return templ_7745c5c3_Err
    55  		}
    56  		return nil
    57  	})
    58  }
    59  
    60  var _ = templruntime.GeneratedTemplate